You are here

public function RouteMatchValueResolver::supports 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::supports()

File

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

Class

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

Namespace

Drupal\Core\Controller\ArgumentResolver

Code

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