mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-03 06:54:34 +02:00
Fixed some inspection issues
This commit is contained in:
parent
33475dca66
commit
42e604245c
85 changed files with 272 additions and 291 deletions
|
@ -47,8 +47,8 @@ class ProviderSelectType extends AbstractType
|
|||
{
|
||||
$resolver->setDefaults([
|
||||
'choices' => $this->providerRegistry->getActiveProviders(),
|
||||
'choice_label' => ChoiceList::label($this, fn (?InfoProviderInterface $choice) => $choice?->getProviderInfo()['name']),
|
||||
'choice_value' => ChoiceList::value($this, fn(?InfoProviderInterface $choice) => $choice?->getProviderKey()),
|
||||
'choice_label' => ChoiceList::label($this, static fn (?InfoProviderInterface $choice) => $choice?->getProviderInfo()['name']),
|
||||
'choice_value' => ChoiceList::value($this, static fn(?InfoProviderInterface $choice) => $choice?->getProviderKey()),
|
||||
|
||||
'multiple' => true,
|
||||
]);
|
||||
|
|
|
@ -49,13 +49,15 @@ class ProjectAddPartsType extends AbstractType
|
|||
$builder->add('bom_entries', ProjectBOMEntryCollectionType::class, [
|
||||
'entry_options' => [
|
||||
'constraints' => [
|
||||
new UniqueEntity(fields: ['part', 'project'], entityClass: ProjectBOMEntry::class, message: 'project.bom_entry.part_already_in_bom'),
|
||||
new UniqueEntity(fields: ['name', 'project'], entityClass: ProjectBOMEntry::class, message: 'project.bom_entry.name_already_in_bom', ignoreNull: true),
|
||||
new UniqueEntity(fields: ['part', 'project'], message: 'project.bom_entry.part_already_in_bom',
|
||||
entityClass: ProjectBOMEntry::class),
|
||||
new UniqueEntity(fields: ['name', 'project'], message: 'project.bom_entry.name_already_in_bom',
|
||||
entityClass: ProjectBOMEntry::class, ignoreNull: true),
|
||||
]
|
||||
],
|
||||
'constraints' => [
|
||||
new UniqueObjectCollection(fields: ['part'], message: 'project.bom_entry.part_already_in_bom'),
|
||||
new UniqueObjectCollection(fields: ['name'], message: 'project.bom_entry.name_already_in_bom'),
|
||||
new UniqueObjectCollection(message: 'project.bom_entry.part_already_in_bom', fields: ['part']),
|
||||
new UniqueObjectCollection(message: 'project.bom_entry.name_already_in_bom', fields: ['name']),
|
||||
]
|
||||
]);
|
||||
$builder->add('submit', SubmitType::class, ['label' => 'save']);
|
||||
|
|
|
@ -34,7 +34,7 @@ class UserSelectType extends AbstractType
|
|||
{
|
||||
$resolver->setDefaults([
|
||||
'class' => User::class,
|
||||
'choice_label' => fn(Options $options) => fn(User $choice, $key, $value) => $choice->getFullName(true),
|
||||
'choice_label' => fn(Options $options) => static fn(User $choice, $key, $value) => $choice->getFullName(true),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue