Completed
Push — master ( b13d5b...6ee7c4 )
by John
01:54
created
src/Throttle/Throttle.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
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\Request\Request $request
Please login to merge, or discard this patch.
src/AccessControl/AccessControl.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
  * Interface AccessControl
8 8
  * @package LunixREST\AccessControl
9 9
  */
10
-interface AccessControl
11
-{
10
+interface AccessControl {
12 11
     /**
13 12
      * Validates if a given request should be able to access what it's trying to
14 13
      * @param $request
Please login to merge, or discard this patch.
src/APIRequest/RequestData/JSONRequestData.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
     /**
14 14
      * JSONRequestData constructor.
15
-     * @param $body
15
+     * @param string $body
16 16
      * @throws InvalidRequestDataException
17 17
      */
18 18
     public function __construct($body)
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     /**
49 49
      * Attempts to find a specific key in the parsed data. Returns true if found else false
50 50
      * @param string $key
51
-     * @return mixed
51
+     * @return boolean
52 52
      */
53 53
     public function has(string $key): bool
54 54
     {
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 use LunixREST\Request\BodyParser\Exceptions\InvalidRequestDataException;
5 5
 
6
-class JSONRequestData implements RequestData
7
-{
6
+class JSONRequestData implements RequestData {
8 7
 
9 8
     protected $jsonString;
10 9
 
@@ -15,8 +14,7 @@  discard block
 block discarded – undo
15 14
      * @param $body
16 15
      * @throws InvalidRequestDataException
17 16
      */
18
-    public function __construct($body)
19
-    {
17
+    public function __construct($body) {
20 18
         $this->jsonString = $body;
21 19
         $this->parsedData = json_decode($body, true);
22 20
         if ($this->parsedData === null) {
@@ -40,8 +38,7 @@  discard block
 block discarded – undo
40 38
      * @param string $key
41 39
      * @return mixed
42 40
      */
43
-    public function get(string $key)
44
-    {
41
+    public function get(string $key) {
45 42
         return $this->parsedData[$key] ?? null;
46 43
     }
47 44
 
Please login to merge, or discard this patch.
src/APIRequest/APIRequest.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@
 block discarded – undo
55 55
     public function __construct(
56 56
         string $method,
57 57
         string $endpoint,
58
-        ?string $element,
58
+        ? string $element,
59 59
         array $acceptableMIMETypes,
60
-        ?string $version,
61
-        ?string $apiKey,
60
+        ? string $version,
61
+        ? string $apiKey,
62 62
         array $queryData,
63 63
         $data
64 64
     ) {
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
  * Class APIRequest
7 7
  * @package LunixREST\Request
8 8
  */
9
-class APIRequest
10
-{
9
+class APIRequest {
11 10
     /**
12 11
      * @var string
13 12
      */
@@ -91,8 +90,7 @@  discard block
 block discarded – undo
91 90
     /**
92 91
      * @return null|string
93 92
      */
94
-    public function getElement()
95
-    {
93
+    public function getElement() {
96 94
         return $this->element;
97 95
     }
98 96
 
@@ -107,16 +105,14 @@  discard block
 block discarded – undo
107 105
     /**
108 106
      * @return null|string
109 107
      */
110
-    public function getVersion()
111
-    {
108
+    public function getVersion() {
112 109
         return $this->version;
113 110
     }
114 111
 
115 112
     /**
116 113
      * @return null|string
117 114
      */
118
-    public function getApiKey()
119
-    {
115
+    public function getApiKey() {
120 116
         return $this->apiKey;
121 117
     }
122 118
 
@@ -131,8 +127,7 @@  discard block
 block discarded – undo
131 127
     /**
132 128
      * @return array|null|object
133 129
      */
134
-    public function getData()
135
-    {
130
+    public function getData() {
136 131
         return $this->data;
137 132
     }
138 133
 }
Please login to merge, or discard this patch.
src/APIRequest/RequestData/URLEncodedQueryStringRequestData.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,15 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace LunixREST\Request\RequestData;
3 3
 
4
-class URLEncodedQueryStringRequestData implements RequestData
5
-{
4
+class URLEncodedQueryStringRequestData implements RequestData {
6 5
 
7 6
     protected $queryString;
8 7
 
9 8
     protected $parsedData = [];
10 9
 
11
-    public function __construct($queryString)
12
-    {
10
+    public function __construct($queryString) {
13 11
         $this->queryString = $queryString;
14 12
         parse_str($queryString, $this->parsedData);
15 13
     }
@@ -30,8 +28,7 @@  discard block
 block discarded – undo
30 28
      * @param string $key
31 29
      * @return mixed
32 30
      */
33
-    public function get(string $key)
34
-    {
31
+    public function get(string $key) {
35 32
         return $this->parsedData[$key] ?? null;
36 33
     }
37 34
 
Please login to merge, or discard this patch.
src/APIRequest/RequestData/RequestData.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace LunixREST\Request\RequestData;
3 3
 
4
-interface RequestData
5
-{
4
+interface RequestData {
6 5
     /**
7 6
      * Returns the raw data that the requestData tried to parse
8 7
      * @return string
Please login to merge, or discard this patch.
src/APIRequest/RequestFactory/GenericRequestFactory.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@
 block discarded – undo
47 47
         $parsedHeaders = $this->headerParser->parse($serverRequest->getHeaders());
48 48
 
49 49
         $urlQueryData = [];
50
-        if($urlQueryString = $parsedURL->getQueryString())
50
+        if ($urlQueryString = $parsedURL->getQueryString())
51 51
         {
52 52
             parse_str($parsedURL->getQueryString(), $urlQueryData);
53 53
         }
54 54
 
55 55
         $apiKey = $parsedURL->getAPIKey();
56
-        if($apiKey === null)
56
+        if ($apiKey === null)
57 57
         {
58 58
             $apiKey = $parsedHeaders->getAPIKey();
59 59
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
      * @param URLParser $URLParser
29 29
      * @param HeaderParser $headerParser
30 30
      */
31
-    public function __construct(URLParser $URLParser, HeaderParser $headerParser)
32
-    {
31
+    public function __construct(URLParser $URLParser, HeaderParser $headerParser) {
33 32
         $this->URLParser = $URLParser;
34 33
         $this->headerParser = $headerParser;
35 34
     }
@@ -47,14 +46,12 @@  discard block
 block discarded – undo
47 46
         $parsedHeaders = $this->headerParser->parse($serverRequest->getHeaders());
48 47
 
49 48
         $urlQueryData = [];
50
-        if($urlQueryString = $parsedURL->getQueryString())
51
-        {
49
+        if($urlQueryString = $parsedURL->getQueryString()) {
52 50
             parse_str($parsedURL->getQueryString(), $urlQueryData);
53 51
         }
54 52
 
55 53
         $apiKey = $parsedURL->getAPIKey();
56
-        if($apiKey === null)
57
-        {
54
+        if($apiKey === null) {
58 55
             $apiKey = $parsedHeaders->getAPIKey();
59 56
         }
60 57
 
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
@@ -10,10 +10,8 @@
 block discarded – undo
10 10
  * Class BasicRequestFactory
11 11
  * @package LunixREST\Request\RequestFactory
12 12
  */
13
-class DefaultRequestFactory extends GenericRequestFactory
14
-{
15
-    public function __construct(URLParser $URLParser)
16
-    {
13
+class DefaultRequestFactory extends GenericRequestFactory {
14
+    public function __construct(URLParser $URLParser) {
17 15
         parent::__construct($URLParser, new DefaultBodyParserFactory(), new DefaultHeaderParser());
18 16
     }
19 17
 }
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
@@ -3,8 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use LunixREST\Request\URLParser\Exceptions\InvalidRequestURLException;
5 5
 
6
-interface URLParser
7
-{
6
+interface URLParser {
8 7
     /**
9 8
      * Parses API request data out of a url
10 9
      * @param $url
Please login to merge, or discard this patch.