diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 18262b901b..27b1643cac 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -33,5 +33,6 @@ 'blank_line_between_import_groups' => false, 'no_trailing_comma_in_singleline' => false, 'nullable_type_declaration_for_default_null_value' => true, + 'phpdoc_to_comment' => false, )) ; diff --git a/src/Field/Configurator/ChoiceConfigurator.php b/src/Field/Configurator/ChoiceConfigurator.php index e726675622..3cbff04cf4 100644 --- a/src/Field/Configurator/ChoiceConfigurator.php +++ b/src/Field/Configurator/ChoiceConfigurator.php @@ -12,6 +12,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Translation\TranslatableChoiceMessageCollection; use function Symfony\Component\String\u; use function Symfony\Component\Translation\t; +use Symfony\Component\Translation\TranslatableMessage; use Symfony\Contracts\Translation\TranslatableInterface; /** @@ -120,6 +121,8 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c $translationDomain ); } + + /** @var TranslatableMessage $choiceMessage */ $choiceMessages[] = new TranslatableChoiceMessage( $choiceMessage, $isRenderedAsBadge ? $this->getBadgeCssClass($badgeSelector, $selectedValue, $field) : null diff --git a/src/Translation/TranslatableMessageBuilder.php b/src/Translation/TranslatableMessageBuilder.php index 1b114eeed5..06844161e2 100644 --- a/src/Translation/TranslatableMessageBuilder.php +++ b/src/Translation/TranslatableMessageBuilder.php @@ -20,7 +20,7 @@ class TranslatableMessageBuilder */ public static function withParameters(TranslatableInterface $translatable, array $parameters): TranslatableInterface { - if (TranslatableMessage::class !== $translatable::class) { + if (!($translatable instanceof TranslatableMessage)) { return $translatable; }