@@ -10,8 +10,7 @@ discard block |
||
| 10 | 10 | * Class GenericRouter |
| 11 | 11 | * @package LunixREST\Server |
| 12 | 12 | */ |
| 13 | -class GenericRouter implements Router |
|
| 14 | -{ |
|
| 13 | +class GenericRouter implements Router { |
|
| 15 | 14 | /** |
| 16 | 15 | * @var EndpointFactory |
| 17 | 16 | */ |
@@ -21,8 +20,7 @@ discard block |
||
| 21 | 20 | * DefaultRouter constructor. |
| 22 | 21 | * @param EndpointFactory $endpointFactory |
| 23 | 22 | */ |
| 24 | - public function __construct(EndpointFactory $endpointFactory) |
|
| 25 | - { |
|
| 23 | + public function __construct(EndpointFactory $endpointFactory) { |
|
| 26 | 24 | $this->endpointFactory = $endpointFactory; |
| 27 | 25 | } |
| 28 | 26 | |
@@ -31,8 +29,7 @@ discard block |
||
| 31 | 29 | * @return null|object|array |
| 32 | 30 | * @throws MethodNotFoundException |
| 33 | 31 | */ |
| 34 | - public function route(APIRequest $request) |
|
| 35 | - { |
|
| 32 | + public function route(APIRequest $request) { |
|
| 36 | 33 | $endpoint = $this->endpointFactory->getEndpoint($request->getEndpoint(), $request->getVersion()); |
| 37 | 34 | return $this->executeEndpoint($endpoint, $request); |
| 38 | 35 | } |
@@ -43,8 +40,7 @@ discard block |
||
| 43 | 40 | * @return null|object|array |
| 44 | 41 | * @throws MethodNotFoundException |
| 45 | 42 | */ |
| 46 | - protected function executeEndpoint(Endpoint $endpoint, APIRequest $request) |
|
| 47 | - { |
|
| 43 | + protected function executeEndpoint(Endpoint $endpoint, APIRequest $request) { |
|
| 48 | 44 | $method = $this->mapEndpointMethod($request); |
| 49 | 45 | if (!method_exists($endpoint, $method)) { |
| 50 | 46 | throw new MethodNotFoundException("The endpoint method " . $method . " was not found"); |