Completed
Push — master ( d8f29d...158cdb )
by John
02:28
created
src/Response/DefaultResponseFactory.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
  * Class DefaultResponseFactory
8 8
  * @package LunixREST\Response
9 9
  */
10
-class DefaultResponseFactory implements ResponseFactory
11
-{
10
+class DefaultResponseFactory implements ResponseFactory {
12 11
     /**
13 12
      * @param ResponseData $data
14 13
      * @param array $acceptedMIMETypes
Please login to merge, or discard this patch.
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/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\Request\Request;
5 5
 
6
-class NoThrottle implements Throttle
7
-{
6
+class NoThrottle implements Throttle {
8 7
     /**
9 8
      * Never throttle
10 9
      * @param \LunixREST\Request\Request $request
@@ -19,8 +18,7 @@  discard block
 block discarded – undo
19 18
      * Log that a request took place
20 19
      * @param \LunixREST\Request\Request $request
21 20
      */
22
-    public function logRequest(Request $request)
23
-    {
21
+    public function logRequest(Request $request) {
24 22
         //Do nothing
25 23
     }
26 24
 }
Please login to merge, or discard this patch.
src/AccessControl/MultiAccessControl.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
  * Class MultiAccessControl
7 7
  * @package LunixREST\AccessControl
8 8
  */
9
-abstract class MultiAccessControl implements AccessControl
10
-{
9
+abstract class MultiAccessControl implements AccessControl {
11 10
     /**
12 11
      * @var AccessControl[]
13 12
      */
@@ -16,8 +15,7 @@  discard block
 block discarded – undo
16 15
     /**
17 16
      * @param AccessControl[] $accessControls array of access controls
18 17
      */
19
-    public function __construct(array $accessControls)
20
-    {
18
+    public function __construct(array $accessControls) {
21 19
         $this->accessControls = $accessControls;
22 20
     }
23 21
 }
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\Request\Request $request
15 14
      * @return bool
16 15
      */
17
-    public function validateAccess(Request $request)
18
-    {
16
+    public function validateAccess(Request $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/AllAccessListAccessControl.php 2 patches
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@  discard block
 block discarded – undo
9 9
  * Class AllAccessListAccessControl
10 10
  * @package LunixREST\AccessControl
11 11
  */
12
-class AllAccessListAccessControl implements AccessControl
13
-{
12
+class AllAccessListAccessControl implements AccessControl {
14 13
     /**
15 14
      * @var array
16 15
      */
@@ -19,8 +18,7 @@  discard block
 block discarded – undo
19 18
     /**
20 19
      * @param array $keys
21 20
      */
22
-    public function __construct(Array $keys)
23
-    {
21
+    public function __construct(Array $keys) {
24 22
         $this->keys = $keys;
25 23
     }
26 24
 
@@ -28,8 +26,7 @@  discard block
 block discarded – undo
28 26
      * @param \LunixREST\Request\Request $request
29 27
      * @return bool true if key is valid
30 28
      */
31
-    public function validateAccess(Request $request)
32
-    {
29
+    public function validateAccess(Request $request) {
33 30
         return $this->validateKey($request->getApiKey());
34 31
     }
35 32
 
@@ -37,8 +34,7 @@  discard block
 block discarded – undo
37 34
      * @param $apiKey
38 35
      * @return bool true if key is in the array passed to this object in it's construction
39 36
      */
40
-    public function validateKey($apiKey)
41
-    {
37
+    public function validateKey($apiKey) {
42 38
         return in_array($apiKey, $this->keys);
43 39
     }
44 40
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     /**
20 20
      * @param array $keys
21 21
      */
22
-    public function __construct(Array $keys)
22
+    public function __construct(array $keys)
23 23
     {
24 24
         $this->keys = $keys;
25 25
     }
Please login to merge, or discard this patch.
src/AccessControl/AllAccessConfigurationListAccessControl.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@  discard block
 block discarded – undo
9 9
  * Class AllAccessListAccessControl
10 10
  * @package LunixREST\AccessControl
11 11
  */
12
-class AllAccessConfigurationListAccessControl implements AccessControl
13
-{
12
+class AllAccessConfigurationListAccessControl implements AccessControl {
14 13
     /**
15 14
      * @var Configuration
16 15
      */
@@ -25,8 +24,7 @@  discard block
 block discarded – undo
25 24
      * @param Configuration $config a config that has a list of valid keys in the stored $configKey
26 25
      * @param string $configKey key to use when accessing the list of valid keys from the $config
27 26
      */
28
-    public function __construct(Configuration $config, $configKey = 'keys')
29
-    {
27
+    public function __construct(Configuration $config, $configKey = 'keys') {
30 28
         $this->config = $config;
31 29
         $this->configKey = $configKey;
32 30
     }
@@ -35,8 +33,7 @@  discard block
 block discarded – undo
35 33
      * @param \LunixREST\Request\Request $request
36 34
      * @return bool true if this key is valid
37 35
      */
38
-    public function validateAccess(Request $request)
39
-    {
36
+    public function validateAccess(Request $request) {
40 37
         return $this->validateKey($request->getApiKey());
41 38
     }
42 39
 
@@ -44,8 +41,7 @@  discard block
 block discarded – undo
44 41
      * @param $apiKey
45 42
      * @return bool true if the key is found inside of the array returned by the config when $config->get is called with the key from the constructor
46 43
      */
47
-    public function validateKey($apiKey)
48
-    {
44
+    public function validateKey($apiKey) {
49 45
         return in_array($apiKey, $this->config->get($this->configKey));
50 46
     }
51 47
 }
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/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\Request\Request $request
28 26
      * @return bool true if key is valid
29 27
      */
30
-    public function validateAccess(Request $request)
31
-    {
28
+    public function validateAccess(Request $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.