@@ -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\APIResponse\Exceptions; |
3 | 3 | |
4 | -class NotAcceptableResponseTypeException extends \Exception |
|
5 | -{ |
|
4 | +class NotAcceptableResponseTypeException extends \Exception { |
|
6 | 5 | |
7 | 6 | } |
@@ -7,8 +7,7 @@ |
||
7 | 7 | * Interface Throttle |
8 | 8 | * @package LunixREST\Throttle |
9 | 9 | */ |
10 | -interface Throttle |
|
11 | -{ |
|
10 | +interface Throttle { |
|
12 | 11 | /** |
13 | 12 | * Returns true if the given request should be throttled in our implementation |
14 | 13 | * @param \LunixREST\APIRequest\APIRequest $request |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace LunixREST\APIRequest\HeaderParser; |
3 | 3 | |
4 | -interface HeaderParser |
|
5 | -{ |
|
4 | +interface HeaderParser { |
|
6 | 5 | public function parse(array $headers): ParsedHeaders; |
7 | 6 | } |
@@ -1,8 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace LunixREST\APIRequest\HeaderParser; |
3 | 3 | |
4 | -class ParsedHeaders |
|
5 | -{ |
|
4 | +class ParsedHeaders { |
|
6 | 5 | /** |
7 | 6 | * @var array |
8 | 7 | */ |
@@ -16,15 +15,13 @@ discard block |
||
16 | 15 | * @param array $acceptableMIMETypes |
17 | 16 | * @param $APIKey |
18 | 17 | */ |
19 | - public function __construct($contentType, array $acceptableMIMETypes, $APIKey) |
|
20 | - { |
|
18 | + public function __construct($contentType, array $acceptableMIMETypes, $APIKey) { |
|
21 | 19 | $this->contentType = $contentType; |
22 | 20 | $this->acceptableMIMETypes = $acceptableMIMETypes; |
23 | 21 | $this->APIKey = $APIKey; |
24 | 22 | } |
25 | 23 | |
26 | - public function getContentType() |
|
27 | - { |
|
24 | + public function getContentType() { |
|
28 | 25 | return $this->contentType; |
29 | 26 | } |
30 | 27 | |
@@ -33,8 +30,7 @@ discard block |
||
33 | 30 | return $this->acceptableMIMETypes; |
34 | 31 | } |
35 | 32 | |
36 | - public function getAPIKey() |
|
37 | - { |
|
33 | + public function getAPIKey() { |
|
38 | 34 | return $this->APIKey; |
39 | 35 | } |
40 | 36 | } |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace LunixREST\APIRequest\URLParser\Exceptions; |
3 | 3 | |
4 | -class InvalidRequestURLException extends \Exception |
|
5 | -{ |
|
4 | +class InvalidRequestURLException extends \Exception { |
|
6 | 5 | |
7 | 6 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | use LunixREST\APIRequest\URLParser\Exceptions\InvalidRequestURLException; |
5 | 5 | use Psr\Http\Message\UriInterface; |
6 | 6 | |
7 | -interface URLParser |
|
8 | -{ |
|
7 | +interface URLParser { |
|
9 | 8 | /** |
10 | 9 | * Parses API request data out of a url |
11 | 10 | * @param UriInterface $uri |
@@ -9,10 +9,8 @@ |
||
9 | 9 | * Class BasicRequestFactory |
10 | 10 | * @package LunixREST\Request\RequestFactory |
11 | 11 | */ |
12 | -class DefaultRequestFactory extends GenericRequestFactory |
|
13 | -{ |
|
14 | - public function __construct(URLParser $URLParser) |
|
15 | - { |
|
12 | +class DefaultRequestFactory extends GenericRequestFactory { |
|
13 | + public function __construct(URLParser $URLParser) { |
|
16 | 14 | parent::__construct($URLParser, new DefaultHeaderParser()); |
17 | 15 | } |
18 | 16 | } |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace LunixREST\Configuration\Exceptions; |
3 | 3 | |
4 | -class INIParseException extends \Exception |
|
5 | -{ |
|
4 | +class INIParseException extends \Exception { |
|
6 | 5 | |
7 | 6 | } |