@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | * Class CachingEndpointFactory |
12 | 12 | * @package LunixREST\Server\Router\EndpointFactory |
13 | 13 | */ |
14 | -abstract class CachingEndpointFactory extends LoggingEndpointFactory |
|
15 | -{ |
|
14 | +abstract class CachingEndpointFactory extends LoggingEndpointFactory { |
|
16 | 15 | /** |
17 | 16 | * @var CacheItemPoolInterface |
18 | 17 | */ |
@@ -23,8 +22,7 @@ discard block |
||
23 | 22 | * @param CacheItemPoolInterface $cachePool |
24 | 23 | * @param LoggerInterface $logger |
25 | 24 | */ |
26 | - public function __construct(CacheItemPoolInterface $cachePool, LoggerInterface $logger) |
|
27 | - { |
|
25 | + public function __construct(CacheItemPoolInterface $cachePool, LoggerInterface $logger) { |
|
28 | 26 | $this->cachePool = $cachePool; |
29 | 27 | parent::__construct($logger); |
30 | 28 | } |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class UnknownEndpointException |
7 | 7 | * @package LunixREST\Server\Router\EndpointFactory\Exceptions |
8 | 8 | */ |
9 | -class UnknownEndpointException extends \Exception |
|
10 | -{ |
|
9 | +class UnknownEndpointException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | * Class GenericRouter |
16 | 16 | * @package LunixREST\Server\Router |
17 | 17 | */ |
18 | -class GenericRouter implements Router |
|
19 | -{ |
|
18 | +class GenericRouter implements Router { |
|
20 | 19 | /** |
21 | 20 | * @var EndpointFactory |
22 | 21 | */ |
@@ -26,8 +25,7 @@ discard block |
||
26 | 25 | * DefaultRouter constructor. |
27 | 26 | * @param EndpointFactory $endpointFactory |
28 | 27 | */ |
29 | - public function __construct(EndpointFactory $endpointFactory) |
|
30 | - { |
|
28 | + public function __construct(EndpointFactory $endpointFactory) { |
|
31 | 29 | $this->endpointFactory = $endpointFactory; |
32 | 30 | } |
33 | 31 |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class MethodNotFoundException |
7 | 7 | * @package LunixREST\Server\Router\Exceptions |
8 | 8 | */ |
9 | -class MethodNotFoundException extends \Exception |
|
10 | -{ |
|
9 | +class MethodNotFoundException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |
@@ -14,8 +14,7 @@ |
||
14 | 14 | * Interface Router |
15 | 15 | * @package LunixREST\Server\Router |
16 | 16 | */ |
17 | -interface Router |
|
18 | -{ |
|
17 | +interface Router { |
|
19 | 18 | /** |
20 | 19 | * @param APIRequest $request |
21 | 20 | * @return APIResponseData |
@@ -6,8 +6,7 @@ discard block |
||
6 | 6 | * Class APIRequest |
7 | 7 | * @package LunixREST\Server\Request |
8 | 8 | */ |
9 | -class APIRequest |
|
10 | -{ |
|
9 | +class APIRequest { |
|
11 | 10 | /** |
12 | 11 | * @var string |
13 | 12 | */ |
@@ -131,8 +130,7 @@ discard block |
||
131 | 130 | /** |
132 | 131 | * @return array|null|object |
133 | 132 | */ |
134 | - public function getData() |
|
135 | - { |
|
133 | + public function getData() { |
|
136 | 134 | return $this->data; |
137 | 135 | } |
138 | 136 | } |
@@ -10,8 +10,7 @@ |
||
10 | 10 | * Interface ResponseFactory |
11 | 11 | * @package LunixREST\Server\ResponseFactory |
12 | 12 | */ |
13 | -interface ResponseFactory |
|
14 | -{ |
|
13 | +interface ResponseFactory { |
|
15 | 14 | /** |
16 | 15 | * @param APIResponseData $data |
17 | 16 | * @param array $acceptedMIMETypes - acceptable MIME types in order of preference |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class NotAcceptableResponseTypeException |
7 | 7 | * @package LunixREST\Server\ResponseFactory\Exceptions |
8 | 8 | */ |
9 | -class NotAcceptableResponseTypeException extends \Exception |
|
10 | -{ |
|
9 | +class NotAcceptableResponseTypeException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |
@@ -13,8 +13,7 @@ discard block |
||
13 | 13 | * Class RegisteredResponseFactory |
14 | 14 | * @package LunixREST\Server\ResponseFactory |
15 | 15 | */ |
16 | -class RegisteredResponseFactory implements ResponseFactory |
|
17 | -{ |
|
16 | +class RegisteredResponseFactory implements ResponseFactory { |
|
18 | 17 | /** |
19 | 18 | * @var APIResponseDataSerializer[] |
20 | 19 | */ |
@@ -24,8 +23,7 @@ discard block |
||
24 | 23 | * RegisteredResponseFactory constructor. |
25 | 24 | * @param APIResponseDataSerializer[] $responseTypes |
26 | 25 | */ |
27 | - public function __construct($responseTypes = []) |
|
28 | - { |
|
26 | + public function __construct($responseTypes = []) { |
|
29 | 27 | foreach($responseTypes as $mimeType => $serializer) { |
30 | 28 | $this->registerSerializer($mimeType, $serializer); |
31 | 29 | } |
@@ -35,8 +33,7 @@ discard block |
||
35 | 33 | * @param $mimeType |
36 | 34 | * @param APIResponseDataSerializer $dataSerializer |
37 | 35 | */ |
38 | - public function registerSerializer($mimeType, APIResponseDataSerializer $dataSerializer) |
|
39 | - { |
|
36 | + public function registerSerializer($mimeType, APIResponseDataSerializer $dataSerializer) { |
|
40 | 37 | $this->serializers[strtolower($mimeType)] = $dataSerializer; |
41 | 38 | } |
42 | 39 |