Completed
Push — master ( 4a47c7...5ddc50 )
by John
02:05
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/AccessControl/PublicAccessControl.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,14 +8,12 @@  discard block
 block discarded – undo
8 8
  * Class PublicAccessControl
9 9
  * @package LunixREST\AccessControl
10 10
  */
11
-class PublicAccessControl implements AccessControl
12
-{
11
+class PublicAccessControl implements AccessControl {
13 12
     /**
14 13
      * @param \LunixREST\APIRequest\APIRequest $request
15 14
      * @return bool
16 15
      */
17
-    public function validateAccess(APIRequest $request)
18
-    {
16
+    public function validateAccess(APIRequest $request) {
19 17
         return true;
20 18
     }
21 19
 
@@ -23,8 +21,7 @@  discard block
 block discarded – undo
23 21
      * @param $apiKey
24 22
      * @return bool
25 23
      */
26
-    public function validateKey($apiKey)
27
-    {
24
+    public function validateKey($apiKey) {
28 25
         return true;
29 26
     }
30 27
 }
Please login to merge, or discard this patch.
src/AccessControl/OneKeyAccessControl.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@  discard block
 block discarded – undo
8 8
  * Class OneKeyAccessControl
9 9
  * @package LunixREST\AccessControl
10 10
  */
11
-class OneKeyAccessControl implements AccessControl
12
-{
11
+class OneKeyAccessControl implements AccessControl {
13 12
     /**
14 13
      * @var string
15 14
      */
@@ -18,8 +17,7 @@  discard block
 block discarded – undo
18 17
     /**
19 18
      * @param string $key
20 19
      */
21
-    public function __construct($key)
22
-    {
20
+    public function __construct($key) {
23 21
         $this->key = $key;
24 22
     }
25 23
 
@@ -27,8 +25,7 @@  discard block
 block discarded – undo
27 25
      * @param \LunixREST\APIRequest\APIRequest $request
28 26
      * @return bool true if key is valid
29 27
      */
30
-    public function validateAccess(APIRequest $request)
31
-    {
28
+    public function validateAccess(APIRequest $request) {
32 29
         return $this->validateKey($request->getApiKey());
33 30
     }
34 31
 
@@ -36,8 +33,7 @@  discard block
 block discarded – undo
36 33
      * @param $apiKey
37 34
      * @return bool true if key is the key specified in the constructor
38 35
      */
39
-    public function validateKey($apiKey)
40
-    {
36
+    public function validateKey($apiKey) {
41 37
         return $apiKey === $this->key;
42 38
     }
43 39
 }
Please login to merge, or discard this patch.
src/Throttle/NoThrottle.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 use LunixREST\APIRequest\APIRequest;
5 5
 
6
-class NoThrottle implements Throttle
7
-{
6
+class NoThrottle implements Throttle {
8 7
     /**
9 8
      * Never throttle
10 9
      * @param \LunixREST\APIRequest\APIRequest $request
@@ -19,8 +18,7 @@  discard block
 block discarded – undo
19 18
      * Log that a request took place
20 19
      * @param \LunixREST\APIRequest\APIRequest $request
21 20
      */
22
-    public function logRequest(APIRequest $request)
23
-    {
21
+    public function logRequest(APIRequest $request) {
24 22
         //Do nothing
25 23
     }
26 24
 }
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/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.
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\Request\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.