@@ -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 | } |
@@ -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; |
@@ -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 |
@@ -28,8 +28,7 @@ |
||
28 | 28 | * Class GenericRouterGenericServer |
29 | 29 | * @package LunixREST\Server |
30 | 30 | */ |
31 | -class GenericRouterGenericServer extends GenericServer |
|
32 | -{ |
|
31 | +class GenericRouterGenericServer extends GenericServer { |
|
33 | 32 | /** |
34 | 33 | * GenericRouterGenericServer constructor. |
35 | 34 | * @param AccessControl $accessControl |
@@ -19,10 +19,8 @@ |
||
19 | 19 | * Class GenericRouterGenericServerHTTPServer |
20 | 20 | * @package LunixREST |
21 | 21 | */ |
22 | -class GenericRouterGenericServerHTTPServer extends GenericServerHTTPServer |
|
23 | -{ |
|
24 | - public function __construct(GenericRouterGenericServer $server, RequestFactory $requestFactory, LoggerInterface $logger) |
|
25 | - { |
|
22 | +class GenericRouterGenericServerHTTPServer extends GenericServerHTTPServer { |
|
23 | + public function __construct(GenericRouterGenericServer $server, RequestFactory $requestFactory, LoggerInterface $logger) { |
|
26 | 24 | parent::__construct($server, $requestFactory, $logger); |
27 | 25 | } |
28 | 26 |
@@ -19,16 +19,14 @@ |
||
19 | 19 | * Class GenericServerHTTPServer |
20 | 20 | * @package LunixREST |
21 | 21 | */ |
22 | -class GenericServerHTTPServer extends HTTPServer |
|
23 | -{ |
|
22 | +class GenericServerHTTPServer extends HTTPServer { |
|
24 | 23 | /** |
25 | 24 | * GenericServerHTTPServer constructor. |
26 | 25 | * @param GenericServer $server |
27 | 26 | * @param RequestFactory $requestFactory |
28 | 27 | * @param LoggerInterface $logger |
29 | 28 | */ |
30 | - public function __construct(GenericServer $server, RequestFactory $requestFactory, LoggerInterface $logger) |
|
31 | - { |
|
29 | + public function __construct(GenericServer $server, RequestFactory $requestFactory, LoggerInterface $logger) { |
|
32 | 30 | parent::__construct($server, $requestFactory, $logger); |
33 | 31 | } |
34 | 32 |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | * Class HTTPServer |
18 | 18 | * @package LunixREST |
19 | 19 | */ |
20 | -class HTTPServer |
|
21 | -{ |
|
20 | +class HTTPServer { |
|
22 | 21 | use LoggerAwareTrait; |
23 | 22 | |
24 | 23 | /** |
@@ -36,8 +35,7 @@ discard block |
||
36 | 35 | * @param RequestFactory $requestFactory |
37 | 36 | * @param LoggerInterface $logger |
38 | 37 | */ |
39 | - public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger) |
|
40 | - { |
|
38 | + public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger) { |
|
41 | 39 | $this->server = $server; |
42 | 40 | $this->requestFactory = $requestFactory; |
43 | 41 | $this->logger = $logger; |
@@ -115,8 +113,7 @@ discard block |
||
115 | 113 | * Dumps a PSR-7 ResponseInterface to the SAPI. |
116 | 114 | * @param ResponseInterface $response |
117 | 115 | */ |
118 | - public static function dumpResponse(ResponseInterface $response) |
|
119 | - { |
|
116 | + public static function dumpResponse(ResponseInterface $response) { |
|
120 | 117 | $statusLine = sprintf( |
121 | 118 | "HTTP/%s %d %s", |
122 | 119 | $response->getProtocolVersion(), |