From ea70eca27cdd40f413fc203e3e9755522201fa56 Mon Sep 17 00:00:00 2001 From: "lina.wolf" Date: Mon, 1 Dec 2025 07:20:18 +0100 Subject: [PATCH 1/2] [FEATURE] Make validation attributes usable for method parameters Resolves: https://github.com/TYPO3-Documentation/Changelog-To-Doc/issues/1488 Releases: main --- .../CustomValidator/_ObjectValidatorUsage.php | 12 ++++++------ .../Extbase/Reference/Validation/Index.rst | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_ObjectValidatorUsage.php b/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_ObjectValidatorUsage.php index b4a981d565..10e101766b 100644 --- a/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_ObjectValidatorUsage.php +++ b/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/CustomValidator/_ObjectValidatorUsage.php @@ -21,12 +21,12 @@ class BlogController extends ActionController * * @throws NoBlogAdminAccessException */ - #[Validate([ - 'param' => 'blog', - 'validator' => BlogValidator::class, - ])] - public function updateAction(Blog $blog): ResponseInterface - { + public function updateAction( + #[Validate([ + 'validator' => BlogValidator::class, + ])] + Blog $blog, + ): ResponseInterface { // do something return $this->htmlResponse(); } diff --git a/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst b/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst index 679eb34b1a..06e88908ef 100644 --- a/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst +++ b/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst @@ -101,7 +101,12 @@ is applied with one argument. .. _extbase-validation-controller: Validation of controller arguments -=================================== +================================== + +.. deprecated:: 14.0 + Applying controller argument validation of **method level** has been + deprecated. Define the validator on **argument level** once dropping + TYPO3 v13 support. You can also define controller argument validators: @@ -110,8 +115,12 @@ You can also define controller argument validators: .. code-block:: php :caption: Examples for controller argument validators - #[Validate(['validator' => 'EmailAddress', 'param' => 'email'])] - public function submitAction(string $email): ResponseInterface + public function submitAction( + #[Validate(validator: 'EmailAddress')] + string $email, + ): ResponseInterface { + // Do something... + } The following rules validate each controller argument: @@ -154,5 +163,5 @@ Manually call a validator It is possible to call a validator in your own code with the method :php:`\TYPO3\CMS\Extbase\Validation\ValidatorResolver::createValidator()`. -However please note that the class :php:`ValidatorResolver` is marked as +However please note that the class :php-short:`\TYPO3\CMS\Extbase\Validation\ValidatorResolver` is marked as :php:`@internal` and it is therefore not advisable to use it. From 9ec2f766ed267f830b7bd87b9ea4d824674f80f8 Mon Sep 17 00:00:00 2001 From: Sarah McCarthy Date: Wed, 3 Dec 2025 11:03:45 +0100 Subject: [PATCH 2/2] [TASK] Language check Releases: main --- .../Extbase/Reference/Validation/Index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst b/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst index 06e88908ef..6b511fe5cd 100644 --- a/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst +++ b/Documentation/ExtensionArchitecture/Extbase/Reference/Validation/Index.rst @@ -104,9 +104,9 @@ Validation of controller arguments ================================== .. deprecated:: 14.0 - Applying controller argument validation of **method level** has been - deprecated. Define the validator on **argument level** once dropping - TYPO3 v13 support. + Applying controller argument validation at **method level** has been + deprecated. Define validators at **argument level** from + TYPO3 v14. You can also define controller argument validators: