Completed
Push — master ( beb3fd...91a3d1 )
by John
02:45
created
src/Server/ResponseFactory/ResponseFactory.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
10 10
  * Interface ResponseFactory
11 11
  * @package LunixREST\Server\ResponseFactory
12 12
  */
13
-interface ResponseFactory
14
-{
13
+interface ResponseFactory {
15 14
     /**
16 15
      * @param APIResponseData $data
17 16
      * @param array $acceptedMIMETypes - acceptable MIME types in order of preference
Please login to merge, or discard this patch.
src/Server/ResponseFactory/RegisteredResponseFactory.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@  discard block
 block discarded – undo
13 13
  * Class RegisteredResponseFactory
14 14
  * @package LunixREST\Server\ResponseFactory
15 15
  */
16
-class RegisteredResponseFactory implements ResponseFactory
17
-{
16
+class RegisteredResponseFactory implements ResponseFactory {
18 17
     /**
19 18
      * @var APIResponseDataSerializer[]
20 19
      */
@@ -24,8 +23,7 @@  discard block
 block discarded – undo
24 23
      * RegisteredResponseFactory constructor.
25 24
      * @param APIResponseDataSerializer[] $responseTypes
26 25
      */
27
-    public function __construct($responseTypes = [])
28
-    {
26
+    public function __construct($responseTypes = []) {
29 27
         foreach($responseTypes as $mimeType => $serializer) {
30 28
             $this->registerSerializer($mimeType, $serializer);
31 29
         }
@@ -35,8 +33,7 @@  discard block
 block discarded – undo
35 33
      * @param $mimeType
36 34
      * @param APIResponseDataSerializer $dataSerializer
37 35
      */
38
-    public function registerSerializer($mimeType, APIResponseDataSerializer $dataSerializer)
39
-    {
36
+    public function registerSerializer($mimeType, APIResponseDataSerializer $dataSerializer) {
40 37
         $this->serializers[strtolower($mimeType)] = $dataSerializer;
41 38
     }
42 39
 
Please login to merge, or discard this patch.
src/RequestFactory/URLParser/MIMEProvider.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
  * Interface MIMEProvider
9 9
  * @package LunixREST\RequestFactory\URLParser
10 10
  */
11
-interface MIMEProvider
12
-{
11
+interface MIMEProvider {
13 12
     /**
14 13
      * @param string $fileExtension
15 14
      * @return string
Please login to merge, or discard this patch.
src/RequestFactory/URLParser/ParsedURL.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
  * Class ParsedURL
7 7
  * @package LunixREST\RequestFactory\URLParser
8 8
  */
9
-class ParsedURL
10
-{
9
+class ParsedURL {
11 10
     /**
12 11
      * @var string
13 12
      */
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
      * @param array $acceptableMIMETypes
43 42
      * @param null|string $queryString
44 43
      */
45
-    public function __construct(string $endpoint, ?string $element, ?string $version, ?string $apiKey, array $acceptableMIMETypes, ?string $queryString)
46
-    {
44
+    public function __construct(string $endpoint, ?string $element, ?string $version, ?string $apiKey, array $acceptableMIMETypes, ?string $queryString) {
47 45
         $this->endpoint = $endpoint;
48 46
         $this->element = $element;
49 47
         $this->version = $version;
@@ -95,8 +93,7 @@  discard block
 block discarded – undo
95 93
     /**
96 94
      * @return null|string
97 95
      */
98
-    public function getQueryString()
99
-    {
96
+    public function getQueryString() {
100 97
         return $this->queryString;
101 98
     }
102 99
 }
Please login to merge, or discard this patch.
src/RequestFactory/URLParser/Exceptions/UnableToProvideMIMEException.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\RequestFactory\URLParser\Exceptions;
3 3
 
4
-class UnableToProvideMIMEException extends \Exception
5
-{
4
+class UnableToProvideMIMEException extends \Exception {
6 5
 
7 6
 }
Please login to merge, or discard this patch.
src/RequestFactory/URLParser/RegexURLParser/RegexURLParser.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
  * Class RegexURLParser
16 16
  * @package LunixREST\RequestFactory\URLParser\RegexURLParser
17 17
  */
18
-class RegexURLParser implements URLParser
19
-{
18
+class RegexURLParser implements URLParser {
20 19
     /**
21 20
      * @var string
22 21
      */
@@ -32,8 +31,7 @@  discard block
 block discarded – undo
32 31
      * @param MIMEProvider|null $MIMEProvider
33 32
      * @throws InvalidRegexPatternException
34 33
      */
35
-    public function __construct(string $pattern, ?MIMEProvider $MIMEProvider = null)
36
-    {
34
+    public function __construct(string $pattern, ?MIMEProvider $MIMEProvider = null) {
37 35
         $this->pattern = $pattern;
38 36
 
39 37
         if(@preg_match($pattern, null) === false) {
Please login to merge, or discard this patch.
URLParser/RegexURLParser/Exceptions/InvalidRegexPatternException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
  * Class InvalidRequestURLException
7 7
  * @package LunixREST\RequestFactory\URLParser\RegexURLParser\Exceptions
8 8
  */
9
-class InvalidRegexPatternException extends \Exception
10
-{
9
+class InvalidRegexPatternException extends \Exception {
11 10
 
12 11
 }
Please login to merge, or discard this patch.
src/RequestFactory/URLParser/URLParser.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@
 block discarded – undo
9 9
  * Interface URLParser
10 10
  * @package LunixREST\RequestFactory\URLParser
11 11
  */
12
-interface URLParser
13
-{
12
+interface URLParser {
14 13
     /**
15 14
      * Parses API request data out of a url
16 15
      * @param UriInterface $uri
Please login to merge, or discard this patch.
src/RequestFactory/HeaderParser/DefaultHeaderParser.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
  * Class DefaultHeaderParser
7 7
  * @package LunixREST\RequestFactory\HeaderParser
8 8
  */
9
-class DefaultHeaderParser implements HeaderParser
10
-{
9
+class DefaultHeaderParser implements HeaderParser {
11 10
 
12 11
     /**
13 12
      * @var string
@@ -18,8 +17,7 @@  discard block
 block discarded – undo
18 17
      * DefaultHeaderParser constructor.
19 18
      * @param string $apiKeyHeaderKey
20 19
      */
21
-    public function __construct($apiKeyHeaderKey = 'x-api-key')
22
-    {
20
+    public function __construct($apiKeyHeaderKey = 'x-api-key') {
23 21
         $this->apiKeyHeaderKey = $apiKeyHeaderKey;
24 22
     }
25 23
 
@@ -63,8 +61,7 @@  discard block
 block discarded – undo
63 61
      * @param array $headers
64 62
      * @return null
65 63
      */
66
-    protected function findAPIKey(array $headers)
67
-    {
64
+    protected function findAPIKey(array $headers) {
68 65
         foreach ($headers as $key => $values) {
69 66
             if (strtolower($key) == strtolower($this->apiKeyHeaderKey)) {
70 67
                 foreach($values as $value) {
@@ -79,8 +76,7 @@  discard block
 block discarded – undo
79 76
      * @param array $headers
80 77
      * @return null
81 78
      */
82
-    protected function getContentType(array $headers)
83
-    {
79
+    protected function getContentType(array $headers) {
84 80
         foreach ($headers as $key => $values) {
85 81
             if (strtolower($key) == 'content-type') {
86 82
                 foreach ($values as $value) {
Please login to merge, or discard this patch.