DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -44,20 +44,8 @@ class CustomFieldDate extends AbstractCustomField
*/
public const MIN = 'min';
/**
* @var TwigEngine
*/
private $templating;
/**
* @var TranslatableStringHelper
*/
private $translatableStringHelper;
public function __construct(TwigEngine $templating, TranslatableStringHelper $translatableStringHelper)
public function __construct(private TwigEngine $templating, private TranslatableStringHelper $translatableStringHelper)
{
$this->templating = $templating;
$this->translatableStringHelper = $translatableStringHelper;
}
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
@@ -82,7 +70,7 @@ class CustomFieldDate extends AbstractCustomField
$validatorFunction = static function ($value, ExecutionContextInterface $context) {
try {
$date = new DateTime($value);
} catch (Exception $e) {
} catch (Exception) {
$context->buildViolation('The expression "%expression%" is invalid', [
'%expression%' => $value,
])