apply rules rector up to php82

This commit is contained in:
2023-05-01 21:39:45 +02:00
parent 81e8928344
commit 6d63177ff4
733 changed files with 1257 additions and 1322 deletions

View File

@@ -32,15 +32,15 @@ use function LogicException;
class CustomFieldChoice extends AbstractCustomField
{
public const ALLOW_OTHER = 'other';
final public const ALLOW_OTHER = 'other';
public const CHOICES = 'choices';
final public const CHOICES = 'choices';
public const EXPANDED = 'expanded';
final public const EXPANDED = 'expanded';
public const MULTIPLE = 'multiple';
final public const MULTIPLE = 'multiple';
public const OTHER_VALUE_LABEL = 'otherValueLabel';
final public const OTHER_VALUE_LABEL = 'otherValueLabel';
private $defaultLocales;
@@ -49,11 +49,11 @@ class CustomFieldChoice extends AbstractCustomField
*/
public function __construct(
TranslatorInterface $translator,
private TwigEngine $templating,
private readonly TwigEngine $templating,
/**
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
*/
private TranslatableStringHelper $translatableStringHelper
private readonly TranslatableStringHelper $translatableStringHelper
) {
$this->defaultLocales = $translator->getFallbackLocales();
}

View File

@@ -33,18 +33,18 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
*/
class CustomFieldDate extends AbstractCustomField
{
public const DATE_FORMAT = DateTime::RFC3339;
final public const DATE_FORMAT = DateTime::RFC3339;
public const FORMAT = 'format';
final public const FORMAT = 'format';
public const MAX = 'max';
final public const MAX = 'max';
/**
* key for the minimal value of the field.
*/
public const MIN = 'min';
final public const MIN = 'min';
public function __construct(private TwigEngine $templating, private TranslatableStringHelper $translatableStringHelper)
public function __construct(private readonly TwigEngine $templating, private readonly TranslatableStringHelper $translatableStringHelper)
{
}

View File

@@ -30,12 +30,12 @@ use function is_object;
class CustomFieldLongChoice extends AbstractCustomField
{
public const KEY = 'key';
final public const KEY = 'key';
public function __construct(
private OptionRepository $optionRepository,
private TranslatableStringHelper $translatableStringHelper,
private EngineInterface $templating,
private readonly OptionRepository $optionRepository,
private readonly TranslatableStringHelper $translatableStringHelper,
private readonly EngineInterface $templating,
) {
}

View File

@@ -28,18 +28,18 @@ use Symfony\Component\Validator\Constraints\LessThanOrEqual;
*/
class CustomFieldNumber extends AbstractCustomField
{
public const MAX = 'max';
final public const MAX = 'max';
/**
* key for the minimal value of the field.
*/
public const MIN = 'min';
final public const MIN = 'min';
public const POST_TEXT = 'post_text';
final public const POST_TEXT = 'post_text';
public const SCALE = 'scale';
final public const SCALE = 'scale';
public function __construct(private TwigEngine $templating, private TranslatableStringHelper $translatableStringHelper)
public function __construct(private readonly TwigEngine $templating, private readonly TranslatableStringHelper $translatableStringHelper)
{
}

View File

@@ -25,17 +25,17 @@ use function array_key_exists;
class CustomFieldText extends AbstractCustomField
{
public const MAX_LENGTH = 'maxLength';
final public const MAX_LENGTH = 'maxLength';
public const MULTIPLE_CF_INLINE = 'multipleCFInline';
final public const MULTIPLE_CF_INLINE = 'multipleCFInline';
public function __construct(
private RequestStack $requestStack,
private TwigEngine $templating,
private readonly RequestStack $requestStack,
private readonly TwigEngine $templating,
/**
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
*/
private TranslatableStringHelper $translatableStringHelper
private readonly TranslatableStringHelper $translatableStringHelper
) {
}

View File

@@ -21,19 +21,19 @@ use Symfony\Component\HttpFoundation\RequestStack;
class CustomFieldTitle extends AbstractCustomField
{
public const TYPE = 'type';
final public const TYPE = 'type';
public const TYPE_SUBTITLE = 'subtitle';
final public const TYPE_SUBTITLE = 'subtitle';
public const TYPE_TITLE = 'title';
final public const TYPE_TITLE = 'title';
public function __construct(
private RequestStack $requestStack,
private TwigEngine $templating,
private readonly RequestStack $requestStack,
private readonly TwigEngine $templating,
/**
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
*/
private TranslatableStringHelper $translatableStringHelper
private readonly TranslatableStringHelper $translatableStringHelper
) {
}