Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\HttpKernel\Controller; Chris@0: Chris@0: use Symfony\Component\HttpFoundation\Request; Chris@0: Chris@0: /** Chris@0: * A ControllerResolverInterface implementation knows how to determine the Chris@0: * controller to execute based on a Request object. Chris@0: * Chris@0: * It can also determine the arguments to pass to the Controller. Chris@0: * Chris@0: * A Controller can be any valid PHP callable. Chris@0: * Chris@0: * @author Fabien Potencier Chris@0: */ Chris@0: interface ControllerResolverInterface Chris@0: { Chris@0: /** Chris@0: * Returns the Controller instance associated with a Request. Chris@0: * Chris@0: * As several resolvers can exist for a single application, a resolver must Chris@0: * return false when it is not able to determine the controller. Chris@0: * Chris@0: * The resolver must only throw an exception when it should be able to load Chris@0: * controller but cannot because of some errors made by the developer. Chris@0: * Chris@0: * @return callable|false A PHP callable representing the Controller, Chris@0: * or false if this resolver is not able to determine the controller Chris@0: * Chris@0: * @throws \LogicException If the controller can't be found Chris@0: */ Chris@0: public function getController(Request $request); Chris@0: Chris@0: /** Chris@0: * Returns the arguments to pass to the controller. Chris@0: * Chris@0: * @param Request $request A Request instance Chris@0: * @param callable $controller A PHP callable Chris@0: * Chris@0: * @return array An array of arguments to pass to the controller Chris@0: * Chris@0: * @throws \RuntimeException When value for argument given is not provided Chris@0: * Chris@0: * @deprecated This method is deprecated as of 3.1 and will be removed in 4.0. Please use the {@see ArgumentResolverInterface} instead. Chris@0: */ Chris@0: public function getArguments(Request $request, $controller); Chris@0: }