File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -502,6 +502,26 @@ payload formats::
502502 // ...
503503 }
504504
505+ Make sure to install `phpstan/phpdoc-parser `_ and `phpdocumentor/type-resolver `_
506+ if you want to map a nested array of specific DTOs::
507+
508+ public function dashboard(
509+ #[MapRequestPayload()] EmployeesDTO $employeesDto
510+ ): Response
511+ {
512+ // ...
513+ }
514+
515+ final class EmployeesDTO
516+ {
517+ /**
518+ * @param UserDTO[] $users
519+ */
520+ public function __construct(
521+ public readonly array $users = []
522+ ) {}
523+ }
524+
505525.. versionadded :: 6.3
506526
507527 The :class: `Symfony\\ Component\\ HttpKernel\\ Attribute\\ MapRequestPayload ` attribute
@@ -771,3 +791,5 @@ Learn more about Controllers
771791.. _`SAPI` : https://www.php.net/manual/en/function.php-sapi-name.php
772792.. _`FrankenPHP` : https://frankenphp.dev
773793.. _`Validate Filters` : https://www.php.net/manual/en/filter.filters.validate.php
794+ .. _`phpstan/phpdoc-parser` : https://packagist.org/packages/phpstan/phpdoc-parser
795+ .. _`phpdocumentor/type-resolver` : https://packagist.org/packages/phpdocumentor/type-resolver
You can’t perform that action at this time.
0 commit comments