@@ -90,7 +90,7 @@ |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $body = $response->getBody(); |
| 93 | - while(!$body->eof()) { |
|
| 93 | + while (!$body->eof()) { |
|
| 94 | 94 | echo $body->read(1024); |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | * Class HTTPServer |
| 27 | 27 | * @package LunixREST |
| 28 | 28 | */ |
| 29 | -class HTTPServer |
|
| 30 | -{ |
|
| 29 | +class HTTPServer { |
|
| 31 | 30 | use LoggerAwareTrait; |
| 32 | 31 | |
| 33 | 32 | /** |
@@ -45,8 +44,7 @@ discard block |
||
| 45 | 44 | * @param RequestFactory $requestFactory |
| 46 | 45 | * @param LoggerInterface $logger |
| 47 | 46 | */ |
| 48 | - public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger) |
|
| 49 | - { |
|
| 47 | + public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger) { |
|
| 50 | 48 | $this->server = $server; |
| 51 | 49 | $this->requestFactory = $requestFactory; |
| 52 | 50 | $this->logger = $logger; |
@@ -82,8 +80,7 @@ discard block |
||
| 82 | 80 | * @param ResponseInterface $response |
| 83 | 81 | * @return ResponseInterface |
| 84 | 82 | */ |
| 85 | - protected function handleAPIRequest(APIRequest $APIRequest, ResponseInterface $response) |
|
| 86 | - { |
|
| 83 | + protected function handleAPIRequest(APIRequest $APIRequest, ResponseInterface $response) { |
|
| 87 | 84 | try { |
| 88 | 85 | $APIResponse = $this->server->handleRequest($APIRequest); |
| 89 | 86 | |
@@ -120,8 +117,7 @@ discard block |
||
| 120 | 117 | * Dumps a PSR-7 ResponseInterface to the SAPI. |
| 121 | 118 | * @param ResponseInterface $response |
| 122 | 119 | */ |
| 123 | - public static function dumpResponse(ResponseInterface $response) |
|
| 124 | - { |
|
| 120 | + public static function dumpResponse(ResponseInterface $response) { |
|
| 125 | 121 | $statusLine = sprintf( |
| 126 | 122 | "HTTP/%s %d %s", |
| 127 | 123 | $response->getProtocolVersion(), |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * Class NotAcceptableResponseTypeException |
| 9 | 9 | * @package LunixREST\Server\ResponseFactory\Exceptions |
| 10 | 10 | */ |
| 11 | -class UnableToCreateAPIResponseException extends UnableToHandleRequestException |
|
| 12 | -{ |
|
| 11 | +class UnableToCreateAPIResponseException extends UnableToHandleRequestException { |
|
| 13 | 12 | |
| 14 | 13 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | * Class NotAcceptableResponseTypeException |
| 7 | 7 | * @package LunixREST\Server\ResponseFactory\Exceptions |
| 8 | 8 | */ |
| 9 | -class NotAcceptableResponseTypeException extends UnableToCreateAPIResponseException |
|
| 10 | -{ |
|
| 9 | +class NotAcceptableResponseTypeException extends UnableToCreateAPIResponseException { |
|
| 11 | 10 | |
| 12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | * Class NotAcceptableResponseTypeException |
| 7 | 7 | * @package LunixREST\Server\ResponseFactory\Exceptions |
| 8 | 8 | */ |
| 9 | -class UnableToSerializeResponseDataException extends UnableToCreateAPIResponseException |
|
| 10 | -{ |
|
| 9 | +class UnableToSerializeResponseDataException extends UnableToCreateAPIResponseException { |
|
| 11 | 10 | |
| 12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | * Class InvalidRequestException |
| 7 | 7 | * @package LunixREST\Server\Router\Endpoint\Exceptions |
| 8 | 8 | */ |
| 9 | -class InvalidRequestException extends EndpointExecutionException |
|
| 10 | -{ |
|
| 9 | +class InvalidRequestException extends EndpointExecutionException { |
|
| 11 | 10 | |
| 12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | * Class UnsupportedMethodException |
| 7 | 7 | * @package LunixREST\Server\Router\Endpoint\Exceptions |
| 8 | 8 | */ |
| 9 | -class UnsupportedMethodException extends EndpointExecutionException |
|
| 10 | -{ |
|
| 9 | +class UnsupportedMethodException extends EndpointExecutionException { |
|
| 11 | 10 | |
| 12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | * Class ElementNotFoundException |
| 7 | 7 | * @package LunixREST\Server\Router\Endpoint\Exceptions |
| 8 | 8 | */ |
| 9 | -class ElementNotFoundException extends EndpointExecutionException |
|
| 10 | -{ |
|
| 9 | +class ElementNotFoundException extends EndpointExecutionException { |
|
| 11 | 10 | |
| 12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | * Class ElementConflictException |
| 7 | 7 | * @package LunixREST\Server\Router\Endpoint\Exceptions |
| 8 | 8 | */ |
| 9 | -class ElementConflictException extends EndpointExecutionException |
|
| 10 | -{ |
|
| 9 | +class ElementConflictException extends EndpointExecutionException { |
|
| 11 | 10 | |
| 12 | 11 | } |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * Class EndpointExecutionException |
| 9 | 9 | * @package LunixREST\Server\Router\Endpoint\Exceptions |
| 10 | 10 | */ |
| 11 | -class EndpointExecutionException extends UnableToRouteRequestException |
|
| 12 | -{ |
|
| 11 | +class EndpointExecutionException extends UnableToRouteRequestException { |
|
| 13 | 12 | |
| 14 | 13 | } |