@@ -19,7 +19,7 @@ |
||
| 19 | 19 | /** |
| 20 | 20 | * @param array $keys |
| 21 | 21 | */ |
| 22 | - public function __construct(Array $keys) |
|
| 22 | + public function __construct(array $keys) |
|
| 23 | 23 | { |
| 24 | 24 | $this->keys = $keys; |
| 25 | 25 | } |
@@ -9,8 +9,7 @@ discard block |
||
| 9 | 9 | * Class AllAccessListAccessControl |
| 10 | 10 | * @package LunixRESTBasics\AccessControl |
| 11 | 11 | */ |
| 12 | -class AllAccessListAccessControl implements AccessControl |
|
| 13 | -{ |
|
| 12 | +class AllAccessListAccessControl implements AccessControl { |
|
| 14 | 13 | /** |
| 15 | 14 | * @var array |
| 16 | 15 | */ |
@@ -19,8 +18,7 @@ discard block |
||
| 19 | 18 | /** |
| 20 | 19 | * @param array $keys |
| 21 | 20 | */ |
| 22 | - public function __construct(Array $keys) |
|
| 23 | - { |
|
| 21 | + public function __construct(Array $keys) { |
|
| 24 | 22 | $this->keys = $keys; |
| 25 | 23 | } |
| 26 | 24 | |
@@ -28,8 +26,7 @@ discard block |
||
| 28 | 26 | * @param \LunixREST\APIRequest\APIRequest $request |
| 29 | 27 | * @return bool true if key is valid |
| 30 | 28 | */ |
| 31 | - public function validateAccess(APIRequest $request) |
|
| 32 | - { |
|
| 29 | + public function validateAccess(APIRequest $request) { |
|
| 33 | 30 | return $this->validateKey($request->getApiKey()); |
| 34 | 31 | } |
| 35 | 32 | |
@@ -37,8 +34,7 @@ discard block |
||
| 37 | 34 | * @param $apiKey |
| 38 | 35 | * @return bool true if key is in the array passed to this object in it's construction |
| 39 | 36 | */ |
| 40 | - public function validateKey($apiKey) |
|
| 41 | - { |
|
| 37 | + public function validateKey($apiKey) { |
|
| 42 | 38 | return in_array($apiKey, $this->keys); |
| 43 | 39 | } |
| 44 | 40 | } |
@@ -9,8 +9,7 @@ discard block |
||
| 9 | 9 | * Class AllAccessListAccessControl |
| 10 | 10 | * @package LunixRESTBasics\AccessControl |
| 11 | 11 | */ |
| 12 | -class AllAccessConfigurationListAccessControl implements AccessControl |
|
| 13 | -{ |
|
| 12 | +class AllAccessConfigurationListAccessControl implements AccessControl { |
|
| 14 | 13 | /** |
| 15 | 14 | * @var Configuration |
| 16 | 15 | */ |
@@ -30,8 +29,7 @@ discard block |
||
| 30 | 29 | * @param $namespace |
| 31 | 30 | * @param string $configKey key to use when accessing the list of valid keys from the $config |
| 32 | 31 | */ |
| 33 | - public function __construct(Configuration $config, string $namespace, string $configKey = 'keys') |
|
| 34 | - { |
|
| 32 | + public function __construct(Configuration $config, string $namespace, string $configKey = 'keys') { |
|
| 35 | 33 | $this->config = $config; |
| 36 | 34 | $this->configKey = $configKey; |
| 37 | 35 | $this->namespace = $namespace; |
@@ -41,8 +39,7 @@ discard block |
||
| 41 | 39 | * @param \LunixREST\APIRequest\APIRequest $request |
| 42 | 40 | * @return bool true if this key is valid |
| 43 | 41 | */ |
| 44 | - public function validateAccess(APIRequest $request) |
|
| 45 | - { |
|
| 42 | + public function validateAccess(APIRequest $request) { |
|
| 46 | 43 | return $this->validateKey($request->getApiKey()); |
| 47 | 44 | } |
| 48 | 45 | |
@@ -50,8 +47,7 @@ discard block |
||
| 50 | 47 | * @param $apiKey |
| 51 | 48 | * @return bool true if the key is found inside of the array returned by the config when $config->get is called with the key from the constructor |
| 52 | 49 | */ |
| 53 | - public function validateKey($apiKey) |
|
| 54 | - { |
|
| 50 | + public function validateKey($apiKey) { |
|
| 55 | 51 | return in_array($apiKey, $this->config->get($this->configKey, $this->namespace)); |
| 56 | 52 | } |
| 57 | 53 | } |