function Psr7RequestValueResolver::resolve

Same name in other branches
  1. 9 core/lib/Drupal/Core/Controller/ArgumentResolver/Psr7RequestValueResolver.php \Drupal\Core\Controller\ArgumentResolver\Psr7RequestValueResolver::resolve()
  2. 8.9.x core/lib/Drupal/Core/Controller/ArgumentResolver/Psr7RequestValueResolver.php \Drupal\Core\Controller\ArgumentResolver\Psr7RequestValueResolver::resolve()
  3. 11.x core/lib/Drupal/Core/Controller/ArgumentResolver/Psr7RequestValueResolver.php \Drupal\Core\Controller\ArgumentResolver\Psr7RequestValueResolver::resolve()

File

core/lib/Drupal/Core/Controller/ArgumentResolver/Psr7RequestValueResolver.php, line 49

Class

Psr7RequestValueResolver
Yields a PSR7 request object based on the request object passed along.

Namespace

Drupal\Core\Controller\ArgumentResolver

Code

public function resolve(Request $request, ArgumentMetadata $argument) : array {
    return $argument->getType() === ServerRequestInterface::class ? [
        $this->httpMessageFactory
            ->createRequest($request),
    ] : [];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.