@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class UnknownEndpointException |
7 | 7 | * @package LunixREST\Endpoint\Exceptions |
8 | 8 | */ |
9 | -class UnknownEndpointException extends \Exception |
|
10 | -{ |
|
9 | +class UnknownEndpointException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class MethodNotFoundException |
7 | 7 | * @package LunixREST\Server\Exceptions |
8 | 8 | */ |
9 | -class MethodNotFoundException extends \Exception |
|
10 | -{ |
|
9 | +class MethodNotFoundException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class InvalidAPIKeyException |
7 | 7 | * @package LunixREST\Server\Exceptions |
8 | 8 | */ |
9 | -class InvalidAPIKeyException extends \Exception |
|
10 | -{ |
|
9 | +class InvalidAPIKeyException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class ThrottleLimitExceededException |
7 | 7 | * @package LunixREST\Server\Exceptions |
8 | 8 | */ |
9 | -class ThrottleLimitExceededException extends \Exception |
|
10 | -{ |
|
9 | +class ThrottleLimitExceededException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |
@@ -6,7 +6,6 @@ |
||
6 | 6 | * Class AccessDeniedException |
7 | 7 | * @package LunixREST\Server\Exceptions |
8 | 8 | */ |
9 | -class AccessDeniedException extends \Exception |
|
10 | -{ |
|
9 | +class AccessDeniedException extends \Exception { |
|
11 | 10 | |
12 | 11 | } |
@@ -20,8 +20,7 @@ discard block |
||
20 | 20 | * Class HTTPServer |
21 | 21 | * @package LunixREST\Server |
22 | 22 | */ |
23 | -class HTTPServer |
|
24 | -{ |
|
23 | +class HTTPServer { |
|
25 | 24 | use LoggerAwareTrait; |
26 | 25 | |
27 | 26 | /** |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | * @param RequestFactory $requestFactory |
40 | 39 | * @param LoggerInterface $logger |
41 | 40 | */ |
42 | - public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger) |
|
43 | - { |
|
41 | + public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger) { |
|
44 | 42 | $this->server = $server; |
45 | 43 | $this->requestFactory = $requestFactory; |
46 | 44 | $this->logger = $logger; |
@@ -76,8 +74,7 @@ discard block |
||
76 | 74 | * @param ResponseInterface $response |
77 | 75 | * @return ResponseInterface |
78 | 76 | */ |
79 | - protected function handleAPIRequest(APIRequest $APIRequest, ResponseInterface $response) |
|
80 | - { |
|
77 | + protected function handleAPIRequest(APIRequest $APIRequest, ResponseInterface $response) { |
|
81 | 78 | try { |
82 | 79 | $APIResponse = $this->server->handleRequest($APIRequest); |
83 | 80 |
@@ -18,8 +18,7 @@ discard block |
||
18 | 18 | * Class GenericServer |
19 | 19 | * @package LunixREST\Server |
20 | 20 | */ |
21 | -class GenericServer implements Server |
|
22 | -{ |
|
21 | +class GenericServer implements Server { |
|
23 | 22 | /** |
24 | 23 | * @var AccessControl |
25 | 24 | */ |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | * @param APIRequest $request |
91 | 90 | * @throws InvalidAPIKeyException |
92 | 91 | */ |
93 | - protected function validateKey(APIRequest $request) |
|
94 | - { |
|
92 | + protected function validateKey(APIRequest $request) { |
|
95 | 93 | if (!$this->accessControl->validateKey($request->getApiKey())) { |
96 | 94 | throw new InvalidAPIKeyException('Invalid API key'); |
97 | 95 | } |
@@ -101,8 +99,7 @@ discard block |
||
101 | 99 | * @param APIRequest $request |
102 | 100 | * @throws NotAcceptableResponseTypeException |
103 | 101 | */ |
104 | - protected function validateAcceptableMIMETypes(APIRequest $request) |
|
105 | - { |
|
102 | + protected function validateAcceptableMIMETypes(APIRequest $request) { |
|
106 | 103 | //TODO: Handle wildcards in request MIME types (*/*) |
107 | 104 | $formats = $this->responseFactory->getSupportedMIMETypes(); |
108 | 105 | if (empty($formats) || ( |
@@ -9,8 +9,7 @@ |
||
9 | 9 | * Interface URLParser |
10 | 10 | * @package LunixREST\APIRequest\URLParser |
11 | 11 | */ |
12 | -interface URLParser |
|
13 | -{ |
|
12 | +interface URLParser { |
|
14 | 13 | /** |
15 | 14 | * Parses API request data out of a url |
16 | 15 | * @param UriInterface $uri |
@@ -6,8 +6,7 @@ discard block |
||
6 | 6 | * Class ParsedURL |
7 | 7 | * @package LunixREST\APIRequest\URLParser |
8 | 8 | */ |
9 | -class ParsedURL |
|
10 | -{ |
|
9 | +class ParsedURL { |
|
11 | 10 | /** |
12 | 11 | * @var string |
13 | 12 | */ |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | * @param array $acceptableMIMETypes |
43 | 42 | * @param null|string $queryString |
44 | 43 | */ |
45 | - public function __construct(string $endpoint, ?string $element, ?string $version, ?string $apiKey, array $acceptableMIMETypes, ?string $queryString) |
|
46 | - { |
|
44 | + public function __construct(string $endpoint, ?string $element, ?string $version, ?string $apiKey, array $acceptableMIMETypes, ?string $queryString) { |
|
47 | 45 | $this->endpoint = $endpoint; |
48 | 46 | $this->element = $element; |
49 | 47 | $this->version = $version; |
@@ -63,24 +61,21 @@ discard block |
||
63 | 61 | /** |
64 | 62 | * @return null|string |
65 | 63 | */ |
66 | - public function getElement() |
|
67 | - { |
|
64 | + public function getElement() { |
|
68 | 65 | return $this->element; |
69 | 66 | } |
70 | 67 | |
71 | 68 | /** |
72 | 69 | * @return null|string |
73 | 70 | */ |
74 | - public function getVersion() |
|
75 | - { |
|
71 | + public function getVersion() { |
|
76 | 72 | return $this->version; |
77 | 73 | } |
78 | 74 | |
79 | 75 | /** |
80 | 76 | * @return null|string |
81 | 77 | */ |
82 | - public function getApiKey() |
|
83 | - { |
|
78 | + public function getApiKey() { |
|
84 | 79 | return $this->apiKey; |
85 | 80 | } |
86 | 81 | |
@@ -95,8 +90,7 @@ discard block |
||
95 | 90 | /** |
96 | 91 | * @return null|string |
97 | 92 | */ |
98 | - public function getQueryString() |
|
99 | - { |
|
93 | + public function getQueryString() { |
|
100 | 94 | return $this->queryString; |
101 | 95 | } |
102 | 96 | } |