matomo
/
app
/
vendor
/
prefixed
/
symfony
/
http-kernel
/
Controller
/
ArgumentResolver
/
RequestValueResolver.php
matomo
/
app
/
vendor
/
prefixed
/
symfony
/
http-kernel
/
Controller
/
ArgumentResolver
Last commit date
DefaultValueResolver.php
2 years ago
NotTaggedControllerValueResolver.php
1 year ago
RequestAttributeValueResolver.php
2 years ago
RequestValueResolver.php
2 years ago
ServiceValueResolver.php
1 year ago
SessionValueResolver.php
1 year ago
TraceableValueResolver.php
2 years ago
VariadicValueResolver.php
2 years ago
RequestValueResolver.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | namespace Matomo\Dependencies\Symfony\Component\HttpKernel\Controller\ArgumentResolver; |
| 12 | |
| 13 | use Matomo\Dependencies\Symfony\Component\HttpFoundation\Request; |
| 14 | use Matomo\Dependencies\Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface; |
| 15 | use Matomo\Dependencies\Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata; |
| 16 | /** |
| 17 | * Yields the same instance as the request object passed along. |
| 18 | * |
| 19 | * @author Iltar van der Berg <kjarli@gmail.com> |
| 20 | */ |
| 21 | final class RequestValueResolver implements ArgumentValueResolverInterface |
| 22 | { |
| 23 | /** |
| 24 | * {@inheritdoc} |
| 25 | */ |
| 26 | public function supports(Request $request, ArgumentMetadata $argument) : bool |
| 27 | { |
| 28 | return Request::class === $argument->getType() || is_subclass_of($argument->getType(), Request::class); |
| 29 | } |
| 30 | /** |
| 31 | * {@inheritdoc} |
| 32 | */ |
| 33 | public function resolve(Request $request, ArgumentMetadata $argument) : iterable |
| 34 | { |
| 35 | (yield $request); |
| 36 | } |
| 37 | } |
| 38 |