final class Psr7RequestValueResolver in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Controller/ArgumentResolver/Psr7RequestValueResolver.php \Drupal\Core\Controller\ArgumentResolver\Psr7RequestValueResolver
- 9 core/lib/Drupal/Core/Controller/ArgumentResolver/Psr7RequestValueResolver.php \Drupal\Core\Controller\ArgumentResolver\Psr7RequestValueResolver
Yields a PSR7 request object based on the request object passed along.
Hierarchy
- class \Drupal\Core\Controller\ArgumentResolver\Psr7RequestValueResolver implements \Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface
Expanded class hierarchy of Psr7RequestValueResolver
1 string reference to 'Psr7RequestValueResolver'
- core.services.yml in core/
core.services.yml - core/core.services.yml
1 service uses Psr7RequestValueResolver
File
- core/
lib/ Drupal/ Core/ Controller/ ArgumentResolver/ Psr7RequestValueResolver.php, line 14
Namespace
Drupal\Core\Controller\ArgumentResolverView source
final class Psr7RequestValueResolver implements ArgumentValueResolverInterface {
/**
* The PSR-7 converter.
*
* @var \Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface
*/
protected $httpMessageFactory;
/**
* Constructs a new ControllerResolver.
*
* @param \Symfony\Bridge\PsrHttpMessage\HttpMessageFactoryInterface $http_message_factory
* The PSR-7 converter.
*/
public function __construct(HttpMessageFactoryInterface $http_message_factory) {
$this->httpMessageFactory = $http_message_factory;
}
/**
* {@inheritdoc}
*/
public function supports(Request $request, ArgumentMetadata $argument) : bool {
return $argument
->getType() == ServerRequestInterface::class;
}
/**
* {@inheritdoc}
*/
public function resolve(Request $request, ArgumentMetadata $argument) : iterable {
(yield $this->httpMessageFactory
->createRequest($request));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Psr7RequestValueResolver:: |
protected | property | The PSR-7 converter. | |
Psr7RequestValueResolver:: |
public | function | ||
Psr7RequestValueResolver:: |
public | function | ||
Psr7RequestValueResolver:: |
public | function | Constructs a new ControllerResolver. |