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 | * |
||
33 | * |
||
34 | 4 | * @return void |
|
|
|||
35 | */ |
||
36 | 4 | public function __construct(Container $container = null) |
|
42 | |||
43 | /** |
||
44 | * @param Request|null $request |
||
45 | * @return ResponseInterface |
||
46 | * @throws Exception |
||
47 | * |
||
48 | * @return null|Response |
||
49 | */ |
||
50 | public function dispatch(Request $request = null) |
||
59 | |||
60 | |||
61 | /** |
||
62 | * @param $action |
||
63 | * @param array $params |
||
64 | * @return mixed |
||
65 | * @throws Exception |
||
66 | */ |
||
67 | public function call($action, $params = []) |
||
80 | |||
81 | /** |
||
82 | * @param Request|null $request |
||
83 | * @param array $params |
||
84 | * @return |
||
85 | * @throws Exception |
||
86 | */ |
||
87 | public function callFromRequest(Request $request = null, $params = []) |
||
95 | 3 | ||
96 | /** |
||
97 | * @param Command $command |
||
98 | * @return Command |
||
99 | 3 | */ |
|
100 | 1 | public function dispatchCommand(Command $command) |
|
114 | |||
115 | /** |
||
116 | * @param bool $params |
||
117 | * @throws ForwardException |
||
118 | */ |
||
119 | public function throwError($params = false) |
||
125 | |||
126 | /** |
||
127 | * @return $this |
||
128 | */ |
||
129 | public function setErrorController() |
||
137 | |||
138 | /** |
||
139 | * @param bool $action |
||
140 | * @param bool $controller |
||
141 | * @param bool $module |
||
142 | * @param array $params |
||
143 | * |
||
144 | * @throws ForwardException |
||
145 | */ |
||
146 | public function forward($action = false, $controller = false, $module = false, $params = []) |
||
163 | |||
164 | /** |
||
165 | * @param $module |
||
166 | * @param $controller |
||
167 | * |
||
168 | * @return string |
||
169 | */ |
||
170 | protected function generateFullControllerNameNamespace($module, $controller) |
||
179 | |||
180 | /** |
||
181 | * @param string $namespaceClass |
||
182 | * |
||
183 | * @return bool |
||
184 | */ |
||
185 | protected function isValidControllerNamespace($namespaceClass) |
||
189 | |||
190 | /** |
||
191 | * @return \Nip\AutoLoader\AutoLoader |
||
192 | */ |
||
193 | protected function getAutoloader() |
||
197 | |||
198 | /** |
||
199 | * @param $module |
||
200 | * @param $controller |
||
201 | * |
||
202 | * @return string |
||
203 | */ |
||
204 | protected function generateFullControllerNameString($module, $controller) |
||
208 | } |
||
209 |
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.