Completed
Branch version2 (a24b39)
by John
03:03
created
src/RequestFactory/GenericRequestFactory.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,12 +48,12 @@
 block discarded – undo
48 48
         $parsedHeaders = $this->headerParser->parse($serverRequest->getHeaders());
49 49
 
50 50
         $urlQueryData = [];
51
-        if($urlQueryString = $parsedURL->getQueryString()) {
51
+        if ($urlQueryString = $parsedURL->getQueryString()) {
52 52
             parse_str($urlQueryString, $urlQueryData);
53 53
         }
54 54
 
55 55
         $apiKey = $parsedURL->getAPIKey();
56
-        if($apiKey === null) {
56
+        if ($apiKey === null) {
57 57
             $apiKey = $parsedHeaders->getAPIKey();
58 58
         }
59 59
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 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
     }
Please login to merge, or discard this patch.
src/JSONHTTPServer.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@
 block discarded – undo
10 10
  * Class JSONHTTPServer
11 11
  * @package LunixREST
12 12
  */
13
-class JSONHTTPServer extends HTTPServer
14
-{
13
+class JSONHTTPServer extends HTTPServer {
15 14
     /**
16 15
      * @param ServerRequestInterface $serverRequest
17 16
      * @param ResponseInterface $response
Please login to merge, or discard this patch.
src/HTTPServer.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         } catch (InvalidAPIKeyException | AccessDeniedException $e) {
103 103
             $this->logCaughtThrowableResultingInHTTPCode(403, $e, LogLevel::NOTICE);
104 104
             return $response->withStatus(403, "Access Denied");
105
-        }  catch (ElementConflictException $e) {
105
+        } catch (ElementConflictException $e) {
106 106
             $this->logCaughtThrowableResultingInHTTPCode(409, $e, LogLevel::NOTICE);
107 107
             return $response->withStatus(409, "Conflict");
108 108
         } catch (ThrottleLimitExceededException $e) {
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         }
136 136
 
137 137
         $body = $response->getBody();
138
-        while(!$body->eof()) {
138
+        while (!$body->eof()) {
139 139
             echo $body->read(1024);
140 140
         }
141 141
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
  * Class HTTPServer
26 26
  * @package LunixREST
27 27
  */
28
-class HTTPServer
29
-{
28
+class HTTPServer {
30 29
     use LoggerAwareTrait;
31 30
 
32 31
     /**
@@ -44,8 +43,7 @@  discard block
 block discarded – undo
44 43
      * @param RequestFactory $requestFactory
45 44
      * @param LoggerInterface $logger
46 45
      */
47
-    public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger)
48
-    {
46
+    public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger) {
49 47
         $this->server = $server;
50 48
         $this->requestFactory = $requestFactory;
51 49
         $this->logger = $logger;
@@ -81,8 +79,7 @@  discard block
 block discarded – undo
81 79
      * @param ResponseInterface $response
82 80
      * @return ResponseInterface
83 81
      */
84
-    protected function handleAPIRequest(APIRequest $APIRequest, ResponseInterface $response)
85
-    {
82
+    protected function handleAPIRequest(APIRequest $APIRequest, ResponseInterface $response) {
86 83
         try {
87 84
             $APIResponse = $this->server->handleRequest($APIRequest);
88 85
 
@@ -103,7 +100,7 @@  discard block
 block discarded – undo
103 100
         } catch (InvalidAPIKeyException | AccessDeniedException $e) {
104 101
             $this->logCaughtThrowableResultingInHTTPCode(403, $e, LogLevel::NOTICE);
105 102
             return $response->withStatus(403, "Access Denied");
106
-        }  catch (ElementConflictException $e) {
103
+        } catch (ElementConflictException $e) {
107 104
             $this->logCaughtThrowableResultingInHTTPCode(409, $e, LogLevel::NOTICE);
108 105
             return $response->withStatus(409, "Conflict");
109 106
         } catch (ThrottleLimitExceededException $e) {
Please login to merge, or discard this patch.