mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Made the ALLOWED_ELEMENT_CLASS protected so we can apply rector
Its bad style to override a public const in a child class
This commit is contained in:
parent
affed459df
commit
dc6a67c2f0
2 changed files with 21 additions and 2 deletions
|
@ -71,8 +71,9 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
|
||||
/**
|
||||
* @var string The class of the element that can be passed to this attachment. Must be overridden in subclasses.
|
||||
*
|
||||
*/
|
||||
public const ALLOWED_ELEMENT_CLASS = '';
|
||||
protected const ALLOWED_ELEMENT_CLASS = '';
|
||||
|
||||
/**
|
||||
* @var string|null the original filename the file had, when the user uploaded it
|
||||
|
@ -463,4 +464,13 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
|
||||
return (bool) filter_var($string, FILTER_VALIDATE_URL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class of the element that is allowed to be associated with this attachment.
|
||||
* @return string
|
||||
*/
|
||||
public function getElementClass(): string
|
||||
{
|
||||
return static::ALLOWED_ELEMENT_CLASS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement
|
|||
/**
|
||||
* @var string The class of the element that can be passed to this attachment. Must be overridden in subclasses.
|
||||
*/
|
||||
public const ALLOWED_ELEMENT_CLASS = '';
|
||||
protected const ALLOWED_ELEMENT_CLASS = '';
|
||||
|
||||
/**
|
||||
* @var string The mathematical symbol for this specification. Can be rendered pretty later. Should be short
|
||||
|
@ -400,4 +400,13 @@ abstract class AbstractParameter extends AbstractNamedDBElement
|
|||
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the class of the element that is allowed to be associated with this attachment.
|
||||
* @return string
|
||||
*/
|
||||
public function getElementClass(): string
|
||||
{
|
||||
return static::ALLOWED_ELEMENT_CLASS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue