@@ -8,14 +8,12 @@ discard block |
||
| 8 | 8 | * Class PublicAccessControl |
| 9 | 9 | * @package LunixREST\AccessControl |
| 10 | 10 | */ |
| 11 | -class PublicAccessControl implements AccessControl |
|
| 12 | -{ |
|
| 11 | +class PublicAccessControl implements AccessControl { |
|
| 13 | 12 | /** |
| 14 | 13 | * @param \LunixREST\APIRequest\APIRequest $request |
| 15 | 14 | * @return bool |
| 16 | 15 | */ |
| 17 | - public function validateAccess(APIRequest $request) |
|
| 18 | - { |
|
| 16 | + public function validateAccess(APIRequest $request) { |
|
| 19 | 17 | return true; |
| 20 | 18 | } |
| 21 | 19 | |
@@ -23,8 +21,7 @@ discard block |
||
| 23 | 21 | * @param $apiKey |
| 24 | 22 | * @return bool |
| 25 | 23 | */ |
| 26 | - public function validateKey($apiKey) |
|
| 27 | - { |
|
| 24 | + public function validateKey($apiKey) { |
|
| 28 | 25 | return true; |
| 29 | 26 | } |
| 30 | 27 | } |
@@ -8,8 +8,7 @@ discard block |
||
| 8 | 8 | * Class OneKeyAccessControl |
| 9 | 9 | * @package LunixREST\AccessControl |
| 10 | 10 | */ |
| 11 | -class OneKeyAccessControl implements AccessControl |
|
| 12 | -{ |
|
| 11 | +class OneKeyAccessControl implements AccessControl { |
|
| 13 | 12 | /** |
| 14 | 13 | * @var string |
| 15 | 14 | */ |
@@ -18,8 +17,7 @@ discard block |
||
| 18 | 17 | /** |
| 19 | 18 | * @param string $key |
| 20 | 19 | */ |
| 21 | - public function __construct($key) |
|
| 22 | - { |
|
| 20 | + public function __construct($key) { |
|
| 23 | 21 | $this->key = $key; |
| 24 | 22 | } |
| 25 | 23 | |
@@ -27,8 +25,7 @@ discard block |
||
| 27 | 25 | * @param \LunixREST\APIRequest\APIRequest $request |
| 28 | 26 | * @return bool true if key is valid |
| 29 | 27 | */ |
| 30 | - public function validateAccess(APIRequest $request) |
|
| 31 | - { |
|
| 28 | + public function validateAccess(APIRequest $request) { |
|
| 32 | 29 | return $this->validateKey($request->getApiKey()); |
| 33 | 30 | } |
| 34 | 31 | |
@@ -36,8 +33,7 @@ discard block |
||
| 36 | 33 | * @param $apiKey |
| 37 | 34 | * @return bool true if key is the key specified in the constructor |
| 38 | 35 | */ |
| 39 | - public function validateKey($apiKey) |
|
| 40 | - { |
|
| 36 | + public function validateKey($apiKey) { |
|
| 41 | 37 | return $apiKey === $this->key; |
| 42 | 38 | } |
| 43 | 39 | } |
@@ -3,8 +3,7 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | use LunixREST\APIRequest\APIRequest; |
| 5 | 5 | |
| 6 | -class NoThrottle implements Throttle |
|
| 7 | -{ |
|
| 6 | +class NoThrottle implements Throttle { |
|
| 8 | 7 | /** |
| 9 | 8 | * Never throttle |
| 10 | 9 | * @param \LunixREST\APIRequest\APIRequest $request |
@@ -19,8 +18,7 @@ discard block |
||
| 19 | 18 | * Log that a request took place |
| 20 | 19 | * @param \LunixREST\APIRequest\APIRequest $request |
| 21 | 20 | */ |
| 22 | - public function logRequest(APIRequest $request) |
|
| 23 | - { |
|
| 21 | + public function logRequest(APIRequest $request) { |
|
| 24 | 22 | //Do nothing |
| 25 | 23 | } |
| 26 | 24 | } |
@@ -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 | |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace LunixREST\Exceptions; |
| 3 | 3 | |
| 4 | -class INIParseException extends \Exception |
|
| 5 | -{ |
|
| 4 | +class INIParseException extends \Exception { |
|
| 6 | 5 | |
| 7 | 6 | } |