Completed
Push — master ( beb3fd...91a3d1 )
by John
02:45
created
src/Server/Server.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@
 block discarded – undo
15 15
  * Interface Server
16 16
  * @package LunixREST\Server
17 17
  */
18
-interface Server
19
-{
18
+interface Server {
20 19
     /**
21 20
      * @param APIRequest $request
22 21
      * @return APIResponse
Please login to merge, or discard this patch.
src/Configuration/INIConfiguration.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $this->config = parse_ini_file($filename, true);
25 25
 
26 26
         if ($this->config === false) {
27
-            throw new INIParseException('Could not parse: ' . $filename, true);
27
+            throw new INIParseException('Could not parse: '.$filename, true);
28 28
         }
29 29
     }
30 30
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@  discard block
 block discarded – undo
8 8
  * Class INIConfiguration
9 9
  * @package LunixREST\Configuration
10 10
  */
11
-class INIConfiguration implements Configuration
12
-{
11
+class INIConfiguration implements Configuration {
13 12
     /**
14 13
      * @var
15 14
      */
@@ -19,8 +18,7 @@  discard block
 block discarded – undo
19 18
      * @param string $filename
20 19
      * @throws INIParseException
21 20
      */
22
-    public function __construct($filename)
23
-    {
21
+    public function __construct($filename) {
24 22
         $this->config = parse_ini_file($filename, true);
25 23
 
26 24
         if ($this->config === false) {
@@ -33,8 +31,7 @@  discard block
 block discarded – undo
33 31
      * @param $namespace
34 32
      * @return mixed
35 33
      */
36
-    public function get($key, $namespace)
37
-    {
34
+    public function get($key, $namespace) {
38 35
         return $this->config[$namespace][$key] ?? null;
39 36
     }
40 37
 
Please login to merge, or discard this patch.
src/Configuration/Configuration.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
  * Interface Configuration
6 6
  * @package LunixREST\Configuration
7 7
  */
8
-interface Configuration
9
-{
8
+interface Configuration {
10 9
     /**
11 10
      * @param $key
12 11
      * @param null|string $namespace
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/Server/GenericServer.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
  * Class GenericServer
22 22
  * @package LunixREST\Server
23 23
  */
24
-class GenericServer implements Server
25
-{
24
+class GenericServer implements Server {
26 25
     /**
27 26
      * @var AccessControl
28 27
      */
@@ -96,8 +95,7 @@  discard block
 block discarded – undo
96 95
      * @param APIRequest $request
97 96
      * @throws InvalidAPIKeyException
98 97
      */
99
-    protected function validateKey(APIRequest $request)
100
-    {
98
+    protected function validateKey(APIRequest $request) {
101 99
         if (!$this->accessControl->validateKey($request->getApiKey())) {
102 100
             throw new InvalidAPIKeyException('Invalid API key');
103 101
         }
@@ -107,8 +105,7 @@  discard block
 block discarded – undo
107 105
      * @param APIRequest $request
108 106
      * @throws NotAcceptableResponseTypeException
109 107
      */
110
-    protected function validateAcceptableMIMETypes(APIRequest $request)
111
-    {
108
+    protected function validateAcceptableMIMETypes(APIRequest $request) {
112 109
         $supportedFormats = $this->responseFactory->getSupportedMIMETypes();
113 110
         $requestedFormats = $request->getAcceptableMIMETypes();
114 111
 
Please login to merge, or discard this patch.
src/Server/APIResponse/APIResponse.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 APIResponse
9 9
  * @package LunixREST\Server\APIResponse
10 10
  */
11
-class APIResponse
12
-{
11
+class APIResponse {
13 12
     /**
14 13
      * @var string
15 14
      */
@@ -19,8 +18,7 @@  discard block
 block discarded – undo
19 18
      */
20 19
     protected $stream;
21 20
 
22
-    public function __construct(string $MIMEType, StreamInterface $stream)
23
-    {
21
+    public function __construct(string $MIMEType, StreamInterface $stream) {
24 22
         $this->MIMEType = $MIMEType;
25 23
         $this->stream = $stream;
26 24
     }
Please login to merge, or discard this patch.
src/Server/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/Server/Throttle/CachePoolThrottle.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     {
58 58
         $item = $this->cacheItemPool->getItem($this->deriveCacheKey($request));
59 59
 
60
-        if($requestCount = $item->get()) {
60
+        if ($requestCount = $item->get()) {
61 61
             $item->set($requestCount + 1);
62 62
         } else {
63 63
             $item->set(1)->expiresAfter($this->perXSeconds);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,8 +9,7 @@  discard block
 block discarded – undo
9 9
  * Class CachePoolThrottle
10 10
  * @package LunixREST\Server\Throttle
11 11
  */
12
-abstract class CachePoolThrottle implements Throttle
13
-{
12
+abstract class CachePoolThrottle implements Throttle {
14 13
     /**
15 14
      * @var CacheItemPoolInterface
16 15
      */
@@ -30,8 +29,7 @@  discard block
 block discarded – undo
30 29
      * @param int $limit
31 30
      * @param int $perXSeconds
32 31
      */
33
-    public function __construct(CacheItemPoolInterface $cacheItemPool, int $limit = 60, int $perXSeconds = 60)
34
-    {
32
+    public function __construct(CacheItemPoolInterface $cacheItemPool, int $limit = 60, int $perXSeconds = 60) {
35 33
         $this->cacheItemPool = $cacheItemPool;
36 34
         $this->limit = $limit;
37 35
         $this->perXSeconds = $perXSeconds;
Please login to merge, or discard this patch.
src/Server/Throttle/NoThrottle.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
  * Class NoThrottle
9 9
  * @package LunixREST\Server\Throttle
10 10
  */
11
-class NoThrottle implements Throttle
12
-{
11
+class NoThrottle implements Throttle {
13 12
     /**
14 13
      * Never throttle
15 14
      * @param \LunixREST\Server\APIRequest\APIRequest $request
Please login to merge, or discard this patch.