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:
Jan Böhmer 2023-06-11 14:01:09 +02:00
parent affed459df
commit dc6a67c2f0
2 changed files with 21 additions and 2 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}