Completed
Push — master ( 178f73...c3bdfb )
by John
02:04
created
src/APIResponse/APIResponse.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@  discard block
 block discarded – undo
7 7
  * Class APIResponse
8 8
  * @package LunixREST\APIResponse
9 9
  */
10
-class APIResponse
11
-{
10
+class APIResponse {
12 11
     /**
13 12
      * @var string
14 13
      */
@@ -18,8 +17,7 @@  discard block
 block discarded – undo
18 17
      */
19 18
     protected $stream;
20 19
 
21
-    public function __construct(string $MIMEType, StreamInterface $stream)
22
-    {
20
+    public function __construct(string $MIMEType, StreamInterface $stream) {
23 21
         $this->MIMEType = $MIMEType;
24 22
         $this->stream = $stream;
25 23
     }
Please login to merge, or discard this patch.
src/APIResponse/APIResponseData.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
      * APIResponseData constructor.
9 9
      * @param null|object|array $data
10 10
      */
11
-    public function __construct($data)
12
-    {
11
+    public function __construct($data) {
13 12
         $this->data = $data;
14 13
     }
15 14
 
Please login to merge, or discard this patch.
src/APIResponse/RegisteredResponseFactory.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function __construct($responseTypes = [])
22 22
     {
23
-        foreach($responseTypes as $mimeType => $serializer) {
23
+        foreach ($responseTypes as $mimeType => $serializer) {
24 24
             $this->registerSerializer($mimeType, $serializer);
25 25
         }
26 26
     }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         }
44 44
 
45 45
         foreach ($acceptedMIMETypes as $acceptedMIMEType) {
46
-            if(isset($this->serializers[strtolower($acceptedMIMEType)])) {
46
+            if (isset($this->serializers[strtolower($acceptedMIMEType)])) {
47 47
                 return new APIResponse($acceptedMIMEType, $this->serializers[strtolower($acceptedMIMEType)]->serialize($data));
48 48
             }
49 49
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@  discard block
 block discarded – undo
10 10
  * Class RegisteredResponseFactory
11 11
  * @package LunixRESTBasics\APIResponse
12 12
  */
13
-class RegisteredResponseFactory implements ResponseFactory
14
-{
13
+class RegisteredResponseFactory implements ResponseFactory {
15 14
     /**
16 15
      * @var APIResponseDataSerializer[]
17 16
      */
@@ -21,8 +20,7 @@  discard block
 block discarded – undo
21 20
      * RegisteredResponseFactory constructor.
22 21
      * @param APIResponseDataSerializer[] $responseTypes
23 22
      */
24
-    public function __construct($responseTypes = [])
25
-    {
23
+    public function __construct($responseTypes = []) {
26 24
         foreach($responseTypes as $mimeType => $serializer) {
27 25
             $this->registerSerializer($mimeType, $serializer);
28 26
         }
@@ -32,8 +30,7 @@  discard block
 block discarded – undo
32 30
      * @param $mimeType
33 31
      * @param APIResponseDataSerializer $dataSerializer
34 32
      */
35
-    public function registerSerializer($mimeType, APIResponseDataSerializer $dataSerializer)
36
-    {
33
+    public function registerSerializer($mimeType, APIResponseDataSerializer $dataSerializer) {
37 34
         $this->serializers[strtolower($mimeType)] = $dataSerializer;
38 35
     }
39 36
 
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 LunixRESTBasics\AccessControl
11 11
  */
12
-class AllAccessConfigurationListAccessControl implements AccessControl
13
-{
12
+class AllAccessConfigurationListAccessControl implements AccessControl {
14 13
     /**
15 14
      * @var Configuration
16 15
      */
@@ -30,8 +29,7 @@  discard block
 block discarded – undo
30 29
      * @param $namespace
31 30
      * @param string $configKey key to use when accessing the list of valid keys from the $config
32 31
      */
33
-    public function __construct(Configuration $config, string $namespace, string $configKey = 'keys')
34
-    {
32
+    public function __construct(Configuration $config, string $namespace, string $configKey = 'keys') {
35 33
         $this->config = $config;
36 34
         $this->configKey = $configKey;
37 35
         $this->namespace = $namespace;
@@ -41,8 +39,7 @@  discard block
 block discarded – undo
41 39
      * @param \LunixREST\APIRequest\APIRequest $request
42 40
      * @return bool true if this key is valid
43 41
      */
44
-    public function validateAccess(APIRequest $request)
45
-    {
42
+    public function validateAccess(APIRequest $request) {
46 43
         return $this->validateKey($request->getApiKey());
47 44
     }
48 45
 
@@ -50,8 +47,7 @@  discard block
 block discarded – undo
50 47
      * @param $apiKey
51 48
      * @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
52 49
      */
53
-    public function validateKey($apiKey)
54
-    {
50
+    public function validateKey($apiKey) {
55 51
         return in_array($apiKey, $this->config->get($this->configKey, $this->namespace));
56 52
     }
57 53
 }
Please login to merge, or discard this patch.
src/Endpoint/RegisteredEndpointFactory.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@  discard block
 block discarded – undo
8 8
  * Class RegisteredEndpointFactory
9 9
  * @package LunixREST\Endpoint
10 10
  */
11
-class RegisteredEndpointFactory implements EndpointFactory
12
-{
11
+class RegisteredEndpointFactory implements EndpointFactory {
13 12
     /**
14 13
      * @var Endpoint[][]
15 14
      */
@@ -20,8 +19,7 @@  discard block
 block discarded – undo
20 19
      * @param string $version
21 20
      * @param Endpoint $endpoint
22 21
      */
23
-    public function register(string $name, string $version, Endpoint $endpoint)
24
-    {
22
+    public function register(string $name, string $version, Endpoint $endpoint) {
25 23
         if(!isset($this->endpoints[$version])) {
26 24
             $this->endpoints[$version] = [];
27 25
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public function register(string $name, string $version, Endpoint $endpoint)
24 24
     {
25
-        if(!isset($this->endpoints[$version])) {
25
+        if (!isset($this->endpoints[$version])) {
26 26
             $this->endpoints[$version] = [];
27 27
         }
28 28
         $this->endpoints[$version][strtolower($name)] = $endpoint;
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
     public function getEndpoint(string $name, string $version): Endpoint
38 38
     {
39 39
         $lowercaseName = strtolower($name);
40
-        if(!isset($this->endpoints[$version]) || !isset($this->endpoints[$version][$lowercaseName])) {
41
-            throw new UnknownEndpointException('Could not find endpoint: ' . $name . ' of version: ' . $version);
40
+        if (!isset($this->endpoints[$version]) || !isset($this->endpoints[$version][$lowercaseName])) {
41
+            throw new UnknownEndpointException('Could not find endpoint: '.$name.' of version: '.$version);
42 42
         }
43 43
 
44 44
         return $this->endpoints[$version][$lowercaseName];
Please login to merge, or discard this patch.
src/APIResponse/ResponseFactory.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 ResponseFactory
9 9
  * @package LunixREST\APIResponse
10 10
  */
11
-interface ResponseFactory
12
-{
11
+interface ResponseFactory {
13 12
     /**
14 13
      * @param APIResponseData $data
15 14
      * @param array $acceptedMIMETypes - acceptable MIME types in order of preference
Please login to merge, or discard this patch.
src/APIResponse/Exceptions/NotAcceptableResponseTypeException.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 NotAcceptableResponseTypeException
7 7
  * @package LunixREST\APIResponse\Exceptions
8 8
  */
9
-class NotAcceptableResponseTypeException extends \Exception
10
-{
9
+class NotAcceptableResponseTypeException extends \Exception {
11 10
 
12 11
 }
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
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
  * Class INIParseException
7 7
  * @package LunixREST\Configuration\Exceptions
8 8
  */
9
-class INIParseException extends \Exception
10
-{
9
+class INIParseException extends \Exception {
11 10
 
12 11
 }
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
@@ -8,8 +8,7 @@  discard block
 block discarded – undo
8 8
  * Class NoThrottle
9 9
  * @package LunixREST\Throttle
10 10
  */
11
-class NoThrottle implements Throttle
12
-{
11
+class NoThrottle implements Throttle {
13 12
     /**
14 13
      * Never throttle
15 14
      * @param \LunixREST\APIRequest\APIRequest $request
@@ -24,8 +23,7 @@  discard block
 block discarded – undo
24 23
      * Log that a request took place
25 24
      * @param \LunixREST\APIRequest\APIRequest $request
26 25
      */
27
-    public function logRequest(APIRequest $request)
28
-    {
26
+    public function logRequest(APIRequest $request) {
29 27
         //Do nothing
30 28
     }
31 29
 }
Please login to merge, or discard this patch.