callableResolver = \Drupal::service("callable_resolver"); } if ($class_resolver !== NULL) { @trigger_error('Calling ' . __METHOD__ . '() with the $class_resolver argument is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3353869', E_USER_DEPRECATED); } } /** * {@inheritdoc} */ public function getControllerFromDefinition($controller, $path = '') { try { $callable = $this->callableResolver->getCallableFromDefinition($controller); } catch (\InvalidArgumentException $e) { throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable.', $path), 0, $e); } return $callable; } /** * {@inheritdoc} */ public function getController(Request $request): callable|FALSE { if (!$controller = $request->attributes->get('_controller')) { return FALSE; } return $this->getControllerFromDefinition($controller, $request->getPathInfo()); } }