You are here

final class RouteMatchValueResolver in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Controller/ArgumentResolver/RouteMatchValueResolver.php \Drupal\Core\Controller\ArgumentResolver\RouteMatchValueResolver
  2. 10 core/lib/Drupal/Core/Controller/ArgumentResolver/RouteMatchValueResolver.php \Drupal\Core\Controller\ArgumentResolver\RouteMatchValueResolver

Yields a RouteMatch object based on the request object passed along.

Hierarchy

  • class \Drupal\Core\Controller\ArgumentResolver\RouteMatchValueResolver implements \Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface

Expanded class hierarchy of RouteMatchValueResolver

1 string reference to 'RouteMatchValueResolver'
core.services.yml in core/core.services.yml
core/core.services.yml
1 service uses RouteMatchValueResolver
argument_resolver.route_match in core/core.services.yml
Drupal\Core\Controller\ArgumentResolver\RouteMatchValueResolver

File

core/lib/Drupal/Core/Controller/ArgumentResolver/RouteMatchValueResolver.php, line 14

Namespace

Drupal\Core\Controller\ArgumentResolver
View source
final class RouteMatchValueResolver implements ArgumentValueResolverInterface {

  /**
   * {@inheritdoc}
   */
  public function supports(Request $request, ArgumentMetadata $argument) {
    return $argument
      ->getType() == RouteMatchInterface::class || is_subclass_of($argument
      ->getType(), RouteMatchInterface::class);
  }

  /**
   * {@inheritdoc}
   */
  public function resolve(Request $request, ArgumentMetadata $argument) {
    (yield RouteMatch::createFromRequest($request));
  }

}

Members