Continuous Integration Fixes
This commit is contained in:
parent
0aa25d107b
commit
7fb0614db4
5 changed files with 22 additions and 16 deletions
|
@ -4,18 +4,15 @@ namespace App\Form;
|
|||
|
||||
use App\Entity\MenuItem;
|
||||
use App\Repository\MenuItemRepository;
|
||||
use Doctrine\DBAL\Types\TextType;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Override;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Bridge\Doctrine\Types\UlidType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Uid\Ulid;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\Length;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use function array_map;
|
||||
|
||||
use function assert;
|
||||
|
||||
final class MenuItemType extends AbstractType
|
||||
|
@ -28,16 +25,18 @@ final class MenuItemType extends AbstractType
|
|||
|
||||
$builder->add('name', \Symfony\Component\Form\Extension\Core\Type\TextType::class, [
|
||||
'constraints' => [
|
||||
new NotBlank(),
|
||||
new \Symfony\Component\Validator\Constraints\Length(['min' => 3]),
|
||||
]
|
||||
new NotBlank,
|
||||
new Length([
|
||||
'min' => 3,
|
||||
]),
|
||||
],
|
||||
]);
|
||||
$builder->add('aliases', EntityType::class, [
|
||||
'class' => MenuItem::class,
|
||||
'choice_label' => 'name',
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'query_builder' => static fn (MenuItemRepository $repository): QueryBuilder
|
||||
'query_builder' => static fn(MenuItemRepository $repository): QueryBuilder
|
||||
=> $repository->getSuitableAliasQueryBuilder($item),
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue