@@ -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 | */ |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | * @param callable $callback Any callback for this route |
| 323 | 323 | * @param array $arguments Additional arguments for the callback |
| 324 | 324 | * |
| 325 | - * @return Respect\Rest\Routes\Callback The route instance |
|
| 325 | + * @return Routes\Callback The route instance |
|
| 326 | 326 | */ |
| 327 | 327 | public function callbackRoute( |
| 328 | 328 | $method, |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | * @param string $class Some class name |
| 345 | 345 | * @param array $arguments The class constructor arguments |
| 346 | 346 | * |
| 347 | - * @return Respect\Rest\Routes\ClassName The route instance |
|
| 347 | + * @return Routes\ClassName The route instance |
|
| 348 | 348 | */ |
| 349 | 349 | public function classRoute($method, $path, $class, array $arguments = array()) |
| 350 | 350 | { |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | * catch. 'Exception' will catch them all. |
| 391 | 391 | * @param string $callback The function to run when an exception is cautght |
| 392 | 392 | * |
| 393 | - * @return Respect\Rest\Routes\Exception |
|
| 393 | + * @return Routes\Exception |
|
| 394 | 394 | */ |
| 395 | 395 | public function exceptionRoute($className, $callback = null) |
| 396 | 396 | { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | * |
| 406 | 406 | * @param string $callback The function to run when an error is cautght |
| 407 | 407 | * |
| 408 | - * @return Respect\Rest\Routes\Error |
|
| 408 | + * @return Routes\Error |
|
| 409 | 409 | */ |
| 410 | 410 | public function errorRoute($callback) |
| 411 | 411 | { |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | * @param string $className The class name of the factored instance |
| 424 | 424 | * @param string $factory Any callable |
| 425 | 425 | * |
| 426 | - * @return Respect\Rest\Routes\Factory The route created |
|
| 426 | + * @return Routes\Factory The route created |
|
| 427 | 427 | */ |
| 428 | 428 | public function factoryRoute($method, $path, $className, $factory) |
| 429 | 429 | { |
@@ -470,9 +470,9 @@ discard block |
||
| 470 | 470 | * |
| 471 | 471 | * @param string $method The HTTP metod (GET, POST, etc) |
| 472 | 472 | * @param string $path The URI Path (/foo/bar...) |
| 473 | - * @param string $intance An instance of Routinable |
|
| 473 | + * @param Routable $instance An instance of Routinable |
|
| 474 | 474 | * |
| 475 | - * @return Respect\Rest\Routes\Instance The route created |
|
| 475 | + * @return Routes\Instance The route created |
|
| 476 | 476 | */ |
| 477 | 477 | public function instanceRoute($method, $path, $instance) |
| 478 | 478 | { |
@@ -488,9 +488,9 @@ discard block |
||
| 488 | 488 | * |
| 489 | 489 | * @param string $method The HTTP metod (GET, POST, etc) |
| 490 | 490 | * @param string $path The URI Path (/foo/bar...) |
| 491 | - * @param string $intance An instance of Router |
|
| 491 | + * @param Router $instance An instance of Router |
|
| 492 | 492 | * |
| 493 | - * @return Respect\Rest\Routes\SubRouter The route created |
|
| 493 | + * @return Routes\SubRouter The route created |
|
| 494 | 494 | */ |
| 495 | 495 | public function instanceSubRouter($method, $path, $instance) |
| 496 | 496 | { |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | * |
| 517 | 517 | * @param Request $request A request |
| 518 | 518 | * |
| 519 | - * @return bool true if the request doesn't apply for routes |
|
| 519 | + * @return boolean|null true if the request doesn't apply for routes |
|
| 520 | 520 | */ |
| 521 | 521 | public function isRoutelessDispatch(Request $request = null) |
| 522 | 522 | { |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | * @param string $path The URI Path (/foo/bar...) |
| 605 | 605 | * @param string $staticValue Some static value to be printed |
| 606 | 606 | * |
| 607 | - * @return Respect\Rest\Routes\StaticValue The route created |
|
| 607 | + * @return Routes\StaticValue The route created |
|
| 608 | 608 | */ |
| 609 | 609 | public function staticRoute($method, $path, $staticValue) |
| 610 | 610 | { |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | * |
| 632 | 632 | * @param Request $request Some request |
| 633 | 633 | * @param AbstractRoute $route Some route |
| 634 | - * @param array $param A list of URI params |
|
| 634 | + * @param array $params A list of URI params |
|
| 635 | 635 | * |
| 636 | 636 | * @see Respect\Rest\Request::$params |
| 637 | 637 | * |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | /** |
| 652 | 652 | * Return routes matched by path |
| 653 | 653 | * |
| 654 | - * @return SplObjectStorage a list of routes matched by path |
|
| 654 | + * @return \SplObjectStorage a list of routes matched by path |
|
| 655 | 655 | */ |
| 656 | 656 | protected function getMatchedRoutesByPath() |
| 657 | 657 | { |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | /** |
| 670 | 670 | * Sends an Allow header with allowed methods from a list |
| 671 | 671 | * |
| 672 | - * @param array $allowedMehods A list of allowed methods |
|
| 672 | + * @param array $allowedMethods A list of allowed methods |
|
| 673 | 673 | * |
| 674 | 674 | * @return null sends an Allow header. |
| 675 | 675 | */ |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | * Informs the PHP environment of a not allowed method alongside |
| 683 | 683 | * its allowed methods for that path |
| 684 | 684 | * |
| 685 | - * @param array $allowedMehods A list of allowed methods |
|
| 685 | + * @param array $allowedMethods A list of allowed methods |
|
| 686 | 686 | * |
| 687 | 687 | * @return null sends HTTP Status Line and Allow header. |
| 688 | 688 | */ |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | * Handles a OPTIONS request, inform of the allowed methods and |
| 703 | 703 | * calls custom OPTIONS handler (if any). |
| 704 | 704 | * |
| 705 | - * @param array $allowedMehods A list of allowed methods |
|
| 705 | + * @param array $allowedMethods A list of allowed methods |
|
| 706 | 706 | * @param \SplObjectStorage $matchedByPath A list of matched routes by path |
| 707 | 707 | * |
| 708 | 708 | * @return null sends Allow header. |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | * |
| 747 | 747 | * @see Respect\Rest\Request::$params |
| 748 | 748 | * |
| 749 | - * @return bool true if the route matches the request with that params |
|
| 749 | + * @return boolean|null true if the route matches the request with that params |
|
| 750 | 750 | */ |
| 751 | 751 | protected function matchRoute( |
| 752 | 752 | Request $request, |
@@ -763,9 +763,9 @@ discard block |
||
| 763 | 763 | /** |
| 764 | 764 | * Checks if a route matches its routines |
| 765 | 765 | * |
| 766 | - * @param SplObjectStorage $matchedByPath A list of routes matched by path |
|
| 766 | + * @param \SplObjectStorage $matchedByPath A list of routes matched by path |
|
| 767 | 767 | * |
| 768 | - * @return bool true if route matches its routines |
|
| 768 | + * @return Request|null true if route matches its routines |
|
| 769 | 769 | */ |
| 770 | 770 | protected function routineMatch(\SplObjectStorage $matchedByPath) |
| 771 | 771 | { |