Fixes phpstan

This commit is contained in:
2024-10-01 15:51:45 +02:00
parent 77ece243c0
commit 052e09cf64
7 changed files with 28 additions and 45 deletions

View File

@@ -5,6 +5,7 @@ namespace Chill\MainBundle\Entity;
use Chill\MainBundle\Repository\GenderRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
#[Serializer\DiscriminatorMap(typeProperty: 'type', mapping: ['chill_main_gender' => Gender::class])]
#[ORM\Entity(repositoryClass: GenderRepository::class)]

View File

@@ -34,7 +34,7 @@ class GenderType extends AbstractType
'multiple' => false,
'mapped' => true,
'choice_label' => fn(GenderIconEnum $enum) => '<i class="' . strtolower($enum->value) . '"></i>',
'choice_value' => fn(?GenderIconEnum $enum) => $enum ? $enum->value : null,
'choice_value' => fn(?GenderIconEnum $enum) => null !== $enum ? $enum->value : null,
'label' => 'gender.admin.Select Gender Icon',
'label_html' => true,
])