Completed
Push — master ( 38b77e...2fde8c )
by John
03:17 queued 01:09
created
src/APIRequest/HeaderParser/DefaultHeaderParser.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,8 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace LunixREST\APIRequest\HeaderParser;
3 3
 
4
-class DefaultHeaderParser implements HeaderParser
5
-{
4
+class DefaultHeaderParser implements HeaderParser {
6 5
 
7 6
     private $apiKeyHeaderKey;
8 7
 
@@ -10,8 +9,7 @@  discard block
 block discarded – undo
10 9
      * DefaultHeaderParser constructor.
11 10
      * @param string $apiKeyHeaderKey
12 11
      */
13
-    public function __construct($apiKeyHeaderKey = 'x-api-key')
14
-    {
12
+    public function __construct($apiKeyHeaderKey = 'x-api-key') {
15 13
         $this->apiKeyHeaderKey = $apiKeyHeaderKey;
16 14
     }
17 15
 
@@ -43,8 +41,7 @@  discard block
 block discarded – undo
43 41
         return $acceptedMIMETypes;
44 42
     }
45 43
 
46
-    protected function findAPIKey(array $headers)
47
-    {
44
+    protected function findAPIKey(array $headers) {
48 45
         foreach ($headers as $key => $values) {
49 46
             if (strtolower($key) == strtolower($this->apiKeyHeaderKey)) {
50 47
                 foreach($values as $value) {
@@ -55,8 +52,7 @@  discard block
 block discarded – undo
55 52
         return null;
56 53
     }
57 54
 
58
-    protected function getContentType(array $headers)
59
-    {
55
+    protected function getContentType(array $headers) {
60 56
         foreach ($headers as $key => $values) {
61 57
             if (strtolower($key) == 'content-type') {
62 58
                 foreach ($values as $value) {
Please login to merge, or discard this patch.
src/APIRequest/HeaderParser/HeaderParser.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/APIRequest/HeaderParser/ParsedHeaders.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,8 +1,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/APIRequest/URLParser/Exceptions/InvalidRequestURLException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/APIRequest/URLParser/URLParser.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/APIRequest/RequestFactory/DefaultRequestFactory.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Configuration/Exceptions/INIParseException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Configuration/Configuration.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
  * Interface Configuration
6 6
  * @package LunixREST\Configuration
7 7
  */
8
-interface Configuration
9
-{
8
+interface Configuration {
10 9
     /**
11 10
      * @param $key
12 11
      * @param null|string $namespace
Please login to merge, or discard this patch.
src/Server/GenericRouter.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@  discard block
 block discarded – undo
11 11
  * Class GenericRouter
12 12
  * @package LunixREST\Server
13 13
  */
14
-class GenericRouter implements Router
15
-{
14
+class GenericRouter implements Router {
16 15
     /**
17 16
      * @var EndpointFactory
18 17
      */
@@ -22,8 +21,7 @@  discard block
 block discarded – undo
22 21
      * DefaultRouter constructor.
23 22
      * @param EndpointFactory $endpointFactory
24 23
      */
25
-    public function __construct(EndpointFactory $endpointFactory)
26
-    {
24
+    public function __construct(EndpointFactory $endpointFactory) {
27 25
         $this->endpointFactory = $endpointFactory;
28 26
     }
29 27
 
Please login to merge, or discard this patch.