mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 05:44:58 +00:00
DX: apply rector rules up to php8.0
This commit is contained in:
@@ -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,
|
||||
])
|
||||
|
Reference in New Issue
Block a user