Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-kernel/Controller/ControllerResolverInterface.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 1fec387a4317 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 /* | |
4 * This file is part of the Symfony package. | |
5 * | |
6 * (c) Fabien Potencier <fabien@symfony.com> | |
7 * | |
8 * For the full copyright and license information, please view the LICENSE | |
9 * file that was distributed with this source code. | |
10 */ | |
11 | |
12 namespace Symfony\Component\HttpKernel\Controller; | |
13 | |
14 use Symfony\Component\HttpFoundation\Request; | |
15 | |
16 /** | |
17 * A ControllerResolverInterface implementation knows how to determine the | |
18 * controller to execute based on a Request object. | |
19 * | |
20 * It can also determine the arguments to pass to the Controller. | |
21 * | |
22 * A Controller can be any valid PHP callable. | |
23 * | |
24 * @author Fabien Potencier <fabien@symfony.com> | |
25 */ | |
26 interface ControllerResolverInterface | |
27 { | |
28 /** | |
29 * Returns the Controller instance associated with a Request. | |
30 * | |
31 * As several resolvers can exist for a single application, a resolver must | |
32 * return false when it is not able to determine the controller. | |
33 * | |
34 * The resolver must only throw an exception when it should be able to load | |
35 * controller but cannot because of some errors made by the developer. | |
36 * | |
37 * @param Request $request A Request instance | |
38 * | |
39 * @return callable|false A PHP callable representing the Controller, | |
40 * or false if this resolver is not able to determine the controller | |
41 * | |
42 * @throws \LogicException If the controller can't be found | |
43 */ | |
44 public function getController(Request $request); | |
45 | |
46 /** | |
47 * Returns the arguments to pass to the controller. | |
48 * | |
49 * @param Request $request A Request instance | |
50 * @param callable $controller A PHP callable | |
51 * | |
52 * @return array An array of arguments to pass to the controller | |
53 * | |
54 * @throws \RuntimeException When value for argument given is not provided | |
55 * | |
56 * @deprecated This method is deprecated as of 3.1 and will be removed in 4.0. Please use the {@see ArgumentResolverInterface} instead. | |
57 */ | |
58 public function getArguments(Request $request, $controller); | |
59 } |