ValueResolver.php 967 B

12345678910111213141516171819202122232425262728293031
  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\HttpKernel\Controller\ValueResolverInterface;
  12. /**
  13. * Defines which value resolver should be used for a given parameter.
  14. */
  15. #[\Attribute(\Attribute::TARGET_PARAMETER | \Attribute::IS_REPEATABLE)]
  16. class ValueResolver
  17. {
  18. /**
  19. * @param class-string<ValueResolverInterface>|string $resolver The class name of the resolver to use
  20. * @param bool $disabled Whether this value resolver is disabled; this allows to enable a value resolver globally while disabling it in specific cases
  21. */
  22. public function __construct(
  23. public string $resolver,
  24. public bool $disabled = false,
  25. ) {
  26. }
  27. }