diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f15be628c8..a68718da75 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -3462,12 +3462,6 @@ parameters: count: 1 path: src/lib/FieldType/Mapper/UserAccountFormMapper.php - - - message: '#^Method Ibexa\\AdminUi\\Form\\ActionDispatcher\\ContentTypeDispatcher\:\:configureOptions\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: src/lib/Form/ActionDispatcher/ContentTypeDispatcher.php - - message: '#^Method Ibexa\\AdminUi\\Form\\Data\\Content\\CustomUrl\\CustomUrlRemoveData\:\:__construct\(\) has parameter \$urlAliases with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -9348,12 +9342,6 @@ parameters: count: 1 path: src/lib/Validator/Constraints/ValidatorConfigurationValidator.php - - - message: '#^Parameter \#1 \$validationErrors of method Ibexa\\ContentForms\\Validator\\Constraints\\FieldTypeValidator\:\:processValidationErrors\(\) expects array\, iterable\ given\.$#' - identifier: argument.type - count: 1 - path: src/lib/Validator/Constraints/ValidatorConfigurationValidator.php - - message: '#^Call to an undefined method Symfony\\Component\\Form\\FormInterface\:\:getClickedButton\(\)\.$#' identifier: method.notFound @@ -9660,12 +9648,6 @@ parameters: count: 1 path: tests/lib/Config/AdminUiForms/ContentTypeFieldTypesResolverTest.php - - - message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertNull\(\) with Symfony\\Component\\HttpFoundation\\Response will always evaluate to false\.$#' - identifier: staticMethod.impossibleType - count: 2 - path: tests/lib/Event/FormActionEventTest.php - - message: '#^Method Ibexa\\Tests\\AdminUi\\EventListener\\ContentProxyCreateDraftListenerTest\:\:getContentType\(\) has parameter \$fieldDefs with no value type specified in iterable type array\.$#' identifier: missingType.iterableValue diff --git a/src/lib/Form/ActionDispatcher/ContentTypeDispatcher.php b/src/lib/Form/ActionDispatcher/ContentTypeDispatcher.php index ebb14de86f..e751e80124 100644 --- a/src/lib/Form/ActionDispatcher/ContentTypeDispatcher.php +++ b/src/lib/Form/ActionDispatcher/ContentTypeDispatcher.php @@ -13,12 +13,12 @@ class ContentTypeDispatcher extends AbstractActionDispatcher { - protected function configureOptions(OptionsResolver $resolver) + protected function configureOptions(OptionsResolver $resolver): void { $resolver->setRequired('languageCode'); } - protected function getActionEventBaseName() + protected function getActionEventBaseName(): string { return FormEvents::CONTENT_TYPE_UPDATE; } diff --git a/src/lib/Validator/Constraints/ValidatorConfigurationValidator.php b/src/lib/Validator/Constraints/ValidatorConfigurationValidator.php index 38eb2c0d33..e47f7a3922 100644 --- a/src/lib/Validator/Constraints/ValidatorConfigurationValidator.php +++ b/src/lib/Validator/Constraints/ValidatorConfigurationValidator.php @@ -22,19 +22,23 @@ class ValidatorConfigurationValidator extends FieldTypeValidator * @param \Ibexa\AdminUi\Form\Data\FieldDefinitionData $value The value that should be validated * @param \Symfony\Component\Validator\Constraint $constraint The constraint for the validation * + * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException + * * @api */ - public function validate($value, Constraint $constraint): void + public function validate(mixed $value, Constraint $constraint): void { if (!$value instanceof FieldDefinitionData) { return; } $fieldType = $this->fieldTypeService->getFieldType($value->getFieldTypeIdentifier()); - $this->processValidationErrors($fieldType->validateValidatorConfiguration($value->validatorConfiguration)); + $this->processValidationErrors( + iterator_to_array($fieldType->validateValidatorConfiguration($value->validatorConfiguration)) + ); } - protected function generatePropertyPath($errorIndex, $errorTarget) + protected function generatePropertyPath($errorIndex, $errorTarget): string { return 'defaultValue'; }