MapUploadedFile.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel\Attribute;
  11. use Symfony\Component\HttpFoundation\Response;
  12. use Symfony\Component\HttpKernel\Controller\ArgumentResolver\RequestPayloadValueResolver;
  13. use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
  14. use Symfony\Component\Validator\Constraint;
  15. #[\Attribute(\Attribute::TARGET_PARAMETER)]
  16. class MapUploadedFile extends ValueResolver
  17. {
  18. public ArgumentMetadata $metadata;
  19. public function __construct(
  20. /** @var Constraint|array<Constraint>|null */
  21. public Constraint|array|null $constraints = null,
  22. public ?string $name = null,
  23. string $resolver = RequestPayloadValueResolver::class,
  24. public readonly int $validationFailedStatusCode = Response::HTTP_UNPROCESSABLE_ENTITY,
  25. ) {
  26. parent::__construct($resolver);
  27. }
  28. }