callableResolver->getCallableFromDefinition($route->getRequirement('_custom_access')); } catch (\InvalidArgumentException $e) { // The custom access controller method was not found. throw new \BadMethodCallException(sprintf('The "%s" method is not callable as a _custom_access callback in route "%s"', $route->getRequirement('_custom_access'), $route->getPath())); } $arguments_resolver = $this->argumentsResolverFactory->getArgumentsResolver($route_match, $account, $request); $arguments = $arguments_resolver->getArguments($callable); return call_user_func_array($callable, $arguments); } }