@@ -15,8 +15,7 @@ |
||
| 15 | 15 | * Interface Server |
| 16 | 16 | * @package LunixREST\Server |
| 17 | 17 | */ |
| 18 | -interface Server |
|
| 19 | -{ |
|
| 18 | +interface Server { |
|
| 20 | 19 | /** |
| 21 | 20 | * @param APIRequest $request |
| 22 | 21 | * @return APIResponse |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $this->config = parse_ini_file($filename, true); |
| 25 | 25 | |
| 26 | 26 | if ($this->config === false) { |
| 27 | - throw new INIParseException('Could not parse: ' . $filename, true); |
|
| 27 | + throw new INIParseException('Could not parse: '.$filename, true); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
@@ -8,8 +8,7 @@ discard block |
||
| 8 | 8 | * Class INIConfiguration |
| 9 | 9 | * @package LunixREST\Configuration |
| 10 | 10 | */ |
| 11 | -class INIConfiguration implements Configuration |
|
| 12 | -{ |
|
| 11 | +class INIConfiguration implements Configuration { |
|
| 13 | 12 | /** |
| 14 | 13 | * @var |
| 15 | 14 | */ |
@@ -19,8 +18,7 @@ discard block |
||
| 19 | 18 | * @param string $filename |
| 20 | 19 | * @throws INIParseException |
| 21 | 20 | */ |
| 22 | - public function __construct($filename) |
|
| 23 | - { |
|
| 21 | + public function __construct($filename) { |
|
| 24 | 22 | $this->config = parse_ini_file($filename, true); |
| 25 | 23 | |
| 26 | 24 | if ($this->config === false) { |
@@ -33,8 +31,7 @@ discard block |
||
| 33 | 31 | * @param $namespace |
| 34 | 32 | * @return mixed |
| 35 | 33 | */ |
| 36 | - public function get($key, $namespace) |
|
| 37 | - { |
|
| 34 | + public function get($key, $namespace) { |
|
| 38 | 35 | return $this->config[$namespace][$key] ?? null; |
| 39 | 36 | } |
| 40 | 37 | |
@@ -5,8 +5,7 @@ |
||
| 5 | 5 | * Interface Configuration |
| 6 | 6 | * @package LunixREST\Configuration |
| 7 | 7 | */ |
| 8 | -interface Configuration |
|
| 9 | -{ |
|
| 8 | +interface Configuration { |
|
| 10 | 9 | /** |
| 11 | 10 | * @param $key |
| 12 | 11 | * @param null|string $namespace |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | * Class INIParseException |
| 7 | 7 | * @package LunixREST\Configuration\Exceptions |
| 8 | 8 | */ |
| 9 | -class INIParseException extends \Exception |
|
| 10 | -{ |
|
| 9 | +class INIParseException 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 | } |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | * Class GenericServer |
| 22 | 22 | * @package LunixREST\Server |
| 23 | 23 | */ |
| 24 | -class GenericServer implements Server |
|
| 25 | -{ |
|
| 24 | +class GenericServer implements Server { |
|
| 26 | 25 | /** |
| 27 | 26 | * @var AccessControl |
| 28 | 27 | */ |
@@ -96,8 +95,7 @@ discard block |
||
| 96 | 95 | * @param APIRequest $request |
| 97 | 96 | * @throws InvalidAPIKeyException |
| 98 | 97 | */ |
| 99 | - protected function validateKey(APIRequest $request) |
|
| 100 | - { |
|
| 98 | + protected function validateKey(APIRequest $request) { |
|
| 101 | 99 | if (!$this->accessControl->validateKey($request->getApiKey())) { |
| 102 | 100 | throw new InvalidAPIKeyException('Invalid API key'); |
| 103 | 101 | } |
@@ -107,8 +105,7 @@ discard block |
||
| 107 | 105 | * @param APIRequest $request |
| 108 | 106 | * @throws NotAcceptableResponseTypeException |
| 109 | 107 | */ |
| 110 | - protected function validateAcceptableMIMETypes(APIRequest $request) |
|
| 111 | - { |
|
| 108 | + protected function validateAcceptableMIMETypes(APIRequest $request) { |
|
| 112 | 109 | $supportedFormats = $this->responseFactory->getSupportedMIMETypes(); |
| 113 | 110 | $requestedFormats = $request->getAcceptableMIMETypes(); |
| 114 | 111 | |
@@ -8,8 +8,7 @@ discard block |
||
| 8 | 8 | * Class APIResponse |
| 9 | 9 | * @package LunixREST\Server\APIResponse |
| 10 | 10 | */ |
| 11 | -class APIResponse |
|
| 12 | -{ |
|
| 11 | +class APIResponse { |
|
| 13 | 12 | /** |
| 14 | 13 | * @var string |
| 15 | 14 | */ |
@@ -19,8 +18,7 @@ discard block |
||
| 19 | 18 | */ |
| 20 | 19 | protected $stream; |
| 21 | 20 | |
| 22 | - public function __construct(string $MIMEType, StreamInterface $stream) |
|
| 23 | - { |
|
| 21 | + public function __construct(string $MIMEType, StreamInterface $stream) { |
|
| 24 | 22 | $this->MIMEType = $MIMEType; |
| 25 | 23 | $this->stream = $stream; |
| 26 | 24 | } |