@@ -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 | { |
@@ -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 | { |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | * |
468 | 468 | * @param string $method The HTTP metod (GET, POST, etc) |
469 | 469 | * @param string $path The URI Path (/foo/bar...) |
470 | - * @param string $intance An instance of Routinable |
|
470 | + * @param Routable $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 | { |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | * @param string $path The URI Path (/foo/bar...) |
584 | 584 | * @param string $staticValue Some static value to be printed |
585 | 585 | * |
586 | - * @return Respect\Rest\Routes\StaticValue The route created |
|
586 | + * @return Routes\StaticValue The route created |
|
587 | 587 | */ |
588 | 588 | public function staticRoute($method, $path, $staticValue) |
589 | 589 | { |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | * |
611 | 611 | * @param Request $request Some request |
612 | 612 | * @param AbstractRoute $route Some route |
613 | - * @param array $param A list of URI params |
|
613 | + * @param array $params A list of URI params |
|
614 | 614 | * |
615 | 615 | * @see Respect\Rest\Request::$params |
616 | 616 | * |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | /** |
631 | 631 | * Return routes matched by path |
632 | 632 | * |
633 | - * @return SplObjectStorage a list of routes matched by path |
|
633 | + * @return \SplObjectStorage a list of routes matched by path |
|
634 | 634 | */ |
635 | 635 | protected function getMatchedRoutesByPath() |
636 | 636 | { |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | /** |
649 | 649 | * Sends an Allow header with allowed methods from a list |
650 | 650 | * |
651 | - * @param array $allowedMehods A list of allowed methods |
|
651 | + * @param array $allowedMethods A list of allowed methods |
|
652 | 652 | * |
653 | 653 | * @return null sends an Allow header. |
654 | 654 | */ |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | * Informs the PHP environment of a not allowed method alongside |
662 | 662 | * its allowed methods for that path |
663 | 663 | * |
664 | - * @param array $allowedMehods A list of allowed methods |
|
664 | + * @param array $allowedMethods A list of allowed methods |
|
665 | 665 | * |
666 | 666 | * @return null sends HTTP Status Line and Allow header. |
667 | 667 | */ |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | * Handles a OPTIONS request, inform of the allowed methods and |
682 | 682 | * calls custom OPTIONS handler (if any). |
683 | 683 | * |
684 | - * @param array $allowedMehods A list of allowed methods |
|
684 | + * @param array $allowedMethods A list of allowed methods |
|
685 | 685 | * @param \SplObjectStorage $matchedByPath A list of matched routes by path |
686 | 686 | * |
687 | 687 | * @return null sends Allow header. |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | * |
726 | 726 | * @see Respect\Rest\Request::$params |
727 | 727 | * |
728 | - * @return bool true if the route matches the request with that params |
|
728 | + * @return boolean|null true if the route matches the request with that params |
|
729 | 729 | */ |
730 | 730 | protected function matchRoute( |
731 | 731 | Request $request, |
@@ -742,9 +742,9 @@ discard block |
||
742 | 742 | /** |
743 | 743 | * Checks if a route matches its routines |
744 | 744 | * |
745 | - * @param SplObjectStorage $matchedByPath A list of routes matched by path |
|
745 | + * @param \SplObjectStorage $matchedByPath A list of routes matched by path |
|
746 | 746 | * |
747 | - * @return bool true if route matches its routines |
|
747 | + * @return Request|null true if route matches its routines |
|
748 | 748 | */ |
749 | 749 | protected function routineMatch(\SplObjectStorage $matchedByPath) |
750 | 750 | { |
@@ -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 | */ |