1 | <?php |
||
21 | class Dispatcher |
||
22 | { |
||
23 | use ContainerAwareTrait; |
||
24 | use HasResolverPipelineTrait; |
||
25 | use HasRequestTrait; |
||
26 | use HasCommandsCollection; |
||
27 | |||
28 | /** |
||
29 | * Create a new controller dispatcher instance. |
||
30 | * |
||
31 | * @param Container $container |
||
32 | * @return void |
||
|
|||
33 | */ |
||
34 | 4 | public function __construct(Container $container = null) |
|
40 | |||
41 | /** |
||
42 | * @param Request|null $request |
||
43 | * @return \Psr\Http\Message\ResponseInterface |
||
44 | * @throws Exception |
||
45 | */ |
||
46 | public function dispatch(Request $request = null) |
||
55 | |||
56 | |||
57 | /** |
||
58 | * @param $action |
||
59 | * @param array $params |
||
60 | * @return mixed |
||
61 | * @throws Exception |
||
62 | */ |
||
63 | public function call($action, $params = []) |
||
76 | |||
77 | /** |
||
78 | * @param Request|null $request |
||
79 | * @return |
||
80 | */ |
||
81 | public function callFromRequest(Request $request = null) |
||
88 | |||
89 | /** |
||
90 | * @param Command $command |
||
91 | * @return Command |
||
92 | */ |
||
93 | 3 | public function dispatchCommand(Command $command) |
|
107 | |||
108 | /** |
||
109 | * @param bool $params |
||
110 | */ |
||
111 | public function throwError($params = false) |
||
119 | |||
120 | /** |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function setErrorController() |
||
131 | |||
132 | /** |
||
133 | * @param bool $action |
||
134 | * @param bool $controller |
||
135 | * @param bool $module |
||
136 | * @param array $params |
||
137 | * @throws ForwardException |
||
138 | */ |
||
139 | public function forward($action = false, $controller = false, $module = false, $params = []) |
||
156 | } |
||
157 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.