@@ -8,8 +8,7 @@ |
||
| 8 | 8 | * Class AllAccessKeyRepositoryAccessControl |
| 9 | 9 | * @package LunixREST\Server\AccessControl |
| 10 | 10 | */ |
| 11 | -class AllAccessKeyRepositoryAccessControl extends KeyRepositoryAccessControl |
|
| 12 | -{ |
|
| 11 | +class AllAccessKeyRepositoryAccessControl extends KeyRepositoryAccessControl { |
|
| 13 | 12 | |
| 14 | 13 | /** |
| 15 | 14 | * Validates if a given request should be able to access what it's trying to |
@@ -15,8 +15,7 @@ |
||
| 15 | 15 | * KeyMeta constructor. |
| 16 | 16 | * @param string $key |
| 17 | 17 | */ |
| 18 | - public function __construct(string $key) |
|
| 19 | - { |
|
| 18 | + public function __construct(string $key) { |
|
| 20 | 19 | $this->key = $key; |
| 21 | 20 | } |
| 22 | 21 | |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | * Class UnableToFindKeyException |
| 7 | 7 | * @package LunixREST\Server\AccessControl\KeyRepository\Exceptions |
| 8 | 8 | */ |
| 9 | -class UnableToFindKeyException extends \Exception |
|
| 10 | -{ |
|
| 9 | +class UnableToFindKeyException extends \Exception { |
|
| 11 | 10 | |
| 12 | 11 | } |
@@ -18,9 +18,9 @@ |
||
| 18 | 18 | public function __construct(Configuration $config, string $namespace, string $configKey = 'keys') |
| 19 | 19 | { |
| 20 | 20 | $keys = []; |
| 21 | - if($config->has($configKey, $namespace)){ |
|
| 21 | + if ($config->has($configKey, $namespace)) { |
|
| 22 | 22 | $configKeys = $config->get($configKey, $namespace); |
| 23 | - if(is_array($configKeys)) { |
|
| 23 | + if (is_array($configKeys)) { |
|
| 24 | 24 | $keys = $configKeys; |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -8,17 +8,15 @@ |
||
| 8 | 8 | * Class ConfigurationKeyRepository |
| 9 | 9 | * @package LunixREST\Server\AccessControl\KeyRepository |
| 10 | 10 | */ |
| 11 | -class ConfigurationKeyRepository extends ArrayKeyRepository |
|
| 12 | -{ |
|
| 11 | +class ConfigurationKeyRepository extends ArrayKeyRepository { |
|
| 13 | 12 | /** |
| 14 | 13 | * @param Configuration $config a config that has a list of valid keys in the stored $configKey |
| 15 | 14 | * @param $namespace |
| 16 | 15 | * @param string $configKey key to use when accessing the list of valid keys from the $config |
| 17 | 16 | */ |
| 18 | - public function __construct(Configuration $config, string $namespace, string $configKey = 'keys') |
|
| 19 | - { |
|
| 17 | + public function __construct(Configuration $config, string $namespace, string $configKey = 'keys') { |
|
| 20 | 18 | $keys = []; |
| 21 | - if($config->has($configKey, $namespace)){ |
|
| 19 | + if($config->has($configKey, $namespace)) { |
|
| 22 | 20 | $configKeys = $config->get($configKey, $namespace); |
| 23 | 21 | if(is_array($configKeys)) { |
| 24 | 22 | $keys = $configKeys; |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function findKey(string $key): KeyMeta |
| 33 | 33 | { |
| 34 | - if($this->hasKey($key)) { |
|
| 34 | + if ($this->hasKey($key)) { |
|
| 35 | 35 | return new KeyMeta($key); |
| 36 | 36 | } else { |
| 37 | 37 | throw new UnableToFindKeyException("Unable to find API key in array."); |
@@ -8,8 +8,7 @@ discard block |
||
| 8 | 8 | * Class ArrayKeyRepository |
| 9 | 9 | * @package LunixREST\Server\AccessControl\KeyRepository |
| 10 | 10 | */ |
| 11 | -class ArrayKeyRepository implements KeyRepository |
|
| 12 | -{ |
|
| 11 | +class ArrayKeyRepository implements KeyRepository { |
|
| 13 | 12 | /** |
| 14 | 13 | * @var |
| 15 | 14 | */ |
@@ -19,8 +18,7 @@ discard block |
||
| 19 | 18 | * ArrayKeyRepository constructor. |
| 20 | 19 | * @param $arrayOfKeys |
| 21 | 20 | */ |
| 22 | - public function __construct($arrayOfKeys) |
|
| 23 | - { |
|
| 21 | + public function __construct($arrayOfKeys) { |
|
| 24 | 22 | $this->arrayOfKeys = $arrayOfKeys; |
| 25 | 23 | } |
| 26 | 24 | |
@@ -8,8 +8,7 @@ discard block |
||
| 8 | 8 | * Class KeyRepositoryAccessControl |
| 9 | 9 | * @package LunixREST\Server\AccessControl |
| 10 | 10 | */ |
| 11 | -abstract class KeyRepositoryAccessControl implements AccessControl |
|
| 12 | -{ |
|
| 11 | +abstract class KeyRepositoryAccessControl implements AccessControl { |
|
| 13 | 12 | /** |
| 14 | 13 | * @var KeyRepository |
| 15 | 14 | */ |
@@ -19,8 +18,7 @@ discard block |
||
| 19 | 18 | * KeyRepositoryAccessControl constructor. |
| 20 | 19 | * @param KeyRepository $keyRepository |
| 21 | 20 | */ |
| 22 | - public function __construct(KeyRepository $keyRepository) |
|
| 23 | - { |
|
| 21 | + public function __construct(KeyRepository $keyRepository) { |
|
| 24 | 22 | $this->keyRepository = $keyRepository; |
| 25 | 23 | } |
| 26 | 24 | |