@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @see Respect\Rest\Request::forwardErrors |
76 | 76 | * @see http://php.net/set_error_handler |
77 | 77 | * |
78 | - * @return mixed The previous error handler |
|
78 | + * @return null|callable The previous error handler |
|
79 | 79 | */ |
80 | 80 | protected function prepareForErrorForwards() |
81 | 81 | { |
@@ -169,10 +169,10 @@ discard block |
||
169 | 169 | * Restores the previous error handler if present then check error routes |
170 | 170 | * for logged errors, forwarding them or returning null silently |
171 | 171 | * |
172 | - * @param mixed $errorHandler Some error handler (internal or external to |
|
172 | + * @param null|callable $errorHandler Some error handler (internal or external to |
|
173 | 173 | * Respect) |
174 | 174 | * |
175 | - * @return mixed A route forwarding or a silent null |
|
175 | + * @return string|null A route forwarding or a silent null |
|
176 | 176 | */ |
177 | 177 | protected function forwardErrors($errorHandler) |
178 | 178 | { |
@@ -195,9 +195,9 @@ discard block |
||
195 | 195 | * Does a catch-like operation on an exception based on previously |
196 | 196 | * declared instances from Router::exceptionRoute |
197 | 197 | * |
198 | - * @param Exception $e Any exception |
|
198 | + * @param \Exception $e Any exception |
|
199 | 199 | * |
200 | - * @return mixed A route forwarding or a silent null |
|
200 | + * @return string|null A route forwarding or a silent null |
|
201 | 201 | */ |
202 | 202 | protected function catchExceptions($e) |
203 | 203 | { |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * @param Routinable $routine Some routine instance |
270 | 270 | * @param array $params Params from the routine |
271 | 271 | * |
272 | - * @return mixed Whatever the routine returns |
|
272 | + * @return AbstractRoute Whatever the routine returns |
|
273 | 273 | */ |
274 | 274 | public function routineCall($type, $method, Routinable $routine, &$params) |
275 | 275 | { |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | * |
332 | 332 | * @param AbstractRoute $route Any route |
333 | 333 | * |
334 | - * @return Response from the forwarded route |
|
334 | + * @return string from the forwarded route |
|
335 | 335 | */ |
336 | 336 | public function forward(AbstractRoute $route) |
337 | 337 | { |
@@ -17,6 +17,11 @@ |
||
17 | 17 | /** @var ReflectionFunctionAbstract */ |
18 | 18 | protected $reflection; |
19 | 19 | |
20 | + /** |
|
21 | + * @param string $method |
|
22 | + * @param string $pattern |
|
23 | + * @param string $value |
|
24 | + */ |
|
20 | 25 | public function __construct($method, $pattern, $value) |
21 | 26 | { |
22 | 27 | $this->value = $value; |
@@ -54,6 +54,10 @@ |
||
54 | 54 | |
55 | 55 | return array_key_exists($key, $this); |
56 | 56 | } |
57 | + |
|
58 | + /** |
|
59 | + * @param string $needle |
|
60 | + */ |
|
57 | 61 | public function filterKeysContain($needle) |
58 | 62 | { |
59 | 63 | return array_filter($this->getKeys(), function ($key) use ($needle) { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | /** |
42 | 42 | * Executes the routine and return its result. |
43 | 43 | * |
44 | - * @param Respect\Rest\Request $request |
|
44 | + * @param Request $request |
|
45 | 45 | * @param array $params |
46 | 46 | * @return mixed |
47 | 47 | */ |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | * @param callable $callback Any callback for this route |
320 | 320 | * @param array $arguments Additional arguments for the callback |
321 | 321 | * |
322 | - * @return Respect\Rest\Routes\Callback The route instance |
|
322 | + * @return Routes\Callback The route instance |
|
323 | 323 | */ |
324 | 324 | public function callbackRoute( |
325 | 325 | $method, |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | * @param string $class Some class name |
342 | 342 | * @param array $arguments The class constructor arguments |
343 | 343 | * |
344 | - * @return Respect\Rest\Routes\ClassName The route instance |
|
344 | + * @return Routes\ClassName The route instance |
|
345 | 345 | */ |
346 | 346 | public function classRoute($method, $path, $class, array $arguments = array()) |
347 | 347 | { |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | * catch. 'Exception' will catch them all. |
388 | 388 | * @param string $callback The function to run when an exception is cautght |
389 | 389 | * |
390 | - * @return Respect\Rest\Routes\Exception |
|
390 | + * @return Routes\Exception |
|
391 | 391 | */ |
392 | 392 | public function exceptionRoute($className, $callback = null) |
393 | 393 | { |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | * |
403 | 403 | * @param string $callback The function to run when an error is cautght |
404 | 404 | * |
405 | - * @return Respect\Rest\Routes\Error |
|
405 | + * @return Routes\Error |
|
406 | 406 | */ |
407 | 407 | public function errorRoute($callback) |
408 | 408 | { |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | * @param string $className The class name of the factored instance |
421 | 421 | * @param string $factory Any callable |
422 | 422 | * |
423 | - * @return Respect\Rest\Routes\Factory The route created |
|
423 | + * @return Routes\Factory The route created |
|
424 | 424 | */ |
425 | 425 | public function factoryRoute($method, $path, $className, $factory) |
426 | 426 | { |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | * @param string $path The URI Path (/foo/bar...) |
470 | 470 | * @param string $instance An instance of Routinable |
471 | 471 | * |
472 | - * @return Respect\Rest\Routes\Instance The route created |
|
472 | + * @return Routes\Instance The route created |
|
473 | 473 | */ |
474 | 474 | public function instanceRoute($method, $path, $instance) |
475 | 475 | { |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | * |
496 | 496 | * @param Request $request A request |
497 | 497 | * |
498 | - * @return bool true if the request doesn't apply for routes |
|
498 | + * @return boolean|null true if the request doesn't apply for routes |
|
499 | 499 | */ |
500 | 500 | public function isRoutelessDispatch(Request $request = null) |
501 | 501 | { |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | * @param string $path The URI Path (/foo/bar...) |
585 | 585 | * @param string $staticValue Some static value to be printed |
586 | 586 | * |
587 | - * @return Respect\Rest\Routes\StaticValue The route created |
|
587 | + * @return Routes\StaticValue The route created |
|
588 | 588 | */ |
589 | 589 | public function staticRoute($method, $path, $staticValue) |
590 | 590 | { |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | /** |
632 | 632 | * Return routes matched by path |
633 | 633 | * |
634 | - * @return SplObjectStorage a list of routes matched by path |
|
634 | + * @return \SplObjectStorage a list of routes matched by path |
|
635 | 635 | */ |
636 | 636 | protected function getMatchedRoutesByPath() |
637 | 637 | { |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | * |
727 | 727 | * @see Respect\Rest\Request::$params |
728 | 728 | * |
729 | - * @return bool true if the route matches the request with that params |
|
729 | + * @return boolean|null true if the route matches the request with that params |
|
730 | 730 | */ |
731 | 731 | protected function matchRoute( |
732 | 732 | Request $request, |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | * |
746 | 746 | * @param \SplObjectStorage $matchedByPath A list of routes matched by path |
747 | 747 | * |
748 | - * @return bool true if route matches its routines |
|
748 | + * @return Request|null true if route matches its routines |
|
749 | 749 | */ |
750 | 750 | protected function routineMatch(\SplObjectStorage $matchedByPath) |
751 | 751 | { |