Completed
Push — master ( beb3fd...91a3d1 )
by John
02:45
created
src/RequestFactory/HeaderParser/ParsedHeaders.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@  discard block
 block discarded – undo
6 6
  * Class ParsedHeaders
7 7
  * @package LunixREST\RequestFactory\HeaderParser
8 8
  */
9
-class ParsedHeaders
10
-{
9
+class ParsedHeaders {
11 10
     /**
12 11
      * @var array
13 12
      */
@@ -27,8 +26,7 @@  discard block
 block discarded – undo
27 26
      * @param array $acceptableMIMETypes
28 27
      * @param $APIKey
29 28
      */
30
-    public function __construct($contentType, array $acceptableMIMETypes, $APIKey)
31
-    {
29
+    public function __construct($contentType, array $acceptableMIMETypes, $APIKey) {
32 30
         $this->contentType = $contentType;
33 31
         $this->acceptableMIMETypes = $acceptableMIMETypes;
34 32
         $this->APIKey = $APIKey;
@@ -37,8 +35,7 @@  discard block
 block discarded – undo
37 35
     /**
38 36
      * @return mixed
39 37
      */
40
-    public function getContentType()
41
-    {
38
+    public function getContentType() {
42 39
         return $this->contentType;
43 40
     }
44 41
 
@@ -53,8 +50,7 @@  discard block
 block discarded – undo
53 50
     /**
54 51
      * @return mixed
55 52
      */
56
-    public function getAPIKey()
57
-    {
53
+    public function getAPIKey() {
58 54
         return $this->APIKey;
59 55
     }
60 56
 }
Please login to merge, or discard this patch.
src/RequestFactory/DefaultRequestFactory.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,8 @@
 block discarded – undo
9 9
  * Class BasicRequestFactory
10 10
  * @package LunixREST\RequestFactory
11 11
  */
12
-class DefaultRequestFactory extends GenericRequestFactory
13
-{
14
-    public function __construct(URLParser $URLParser)
15
-    {
12
+class DefaultRequestFactory extends GenericRequestFactory {
13
+    public function __construct(URLParser $URLParser) {
16 14
         parent::__construct($URLParser, new DefaultHeaderParser());
17 15
     }
18 16
 }
Please login to merge, or discard this patch.
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   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
         }
91 91
 
92 92
         $body = $response->getBody();
93
-        while(!$body->eof()) {
93
+        while (!$body->eof()) {
94 94
             echo $body->read(1024);
95 95
         }
96 96
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
  * Class HTTPServer
18 18
  * @package LunixREST
19 19
  */
20
-class HTTPServer
21
-{
20
+class HTTPServer {
22 21
     use LoggerAwareTrait;
23 22
 
24 23
     /**
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
      * @param RequestFactory $requestFactory
37 36
      * @param LoggerInterface $logger
38 37
      */
39
-    public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger)
40
-    {
38
+    public function __construct(Server $server, RequestFactory $requestFactory, LoggerInterface $logger) {
41 39
         $this->server = $server;
42 40
         $this->requestFactory = $requestFactory;
43 41
         $this->logger = $logger;
@@ -115,8 +113,7 @@  discard block
 block discarded – undo
115 113
      * Dumps a PSR-7 ResponseInterface to the SAPI.
116 114
      * @param ResponseInterface $response
117 115
      */
118
-    public static function dumpResponse(ResponseInterface $response)
119
-    {
116
+    public static function dumpResponse(ResponseInterface $response) {
120 117
         $statusLine = sprintf(
121 118
             "HTTP/%s %d %s",
122 119
             $response->getProtocolVersion(),
Please login to merge, or discard this patch.
Server/ResponseFactory/Exceptions/UnableToCreateAPIResponseException.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
  * Class NotAcceptableResponseTypeException
9 9
  * @package LunixREST\Server\ResponseFactory\Exceptions
10 10
  */
11
-class UnableToCreateAPIResponseException extends UnableToHandleRequestException
12
-{
11
+class UnableToCreateAPIResponseException extends UnableToHandleRequestException {
13 12
 
14 13
 }
Please login to merge, or discard this patch.
Server/ResponseFactory/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\Server\ResponseFactory\Exceptions
8 8
  */
9
-class NotAcceptableResponseTypeException extends UnableToCreateAPIResponseException
10
-{
9
+class NotAcceptableResponseTypeException extends UnableToCreateAPIResponseException {
11 10
 
12 11
 }
Please login to merge, or discard this patch.
ResponseFactory/Exceptions/UnableToSerializeResponseDataException.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\Server\ResponseFactory\Exceptions
8 8
  */
9
-class UnableToSerializeResponseDataException extends UnableToCreateAPIResponseException
10
-{
9
+class UnableToSerializeResponseDataException extends UnableToCreateAPIResponseException {
11 10
 
12 11
 }
Please login to merge, or discard this patch.
src/Server/Router/Endpoint/Exceptions/InvalidRequestException.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 InvalidRequestException
7 7
  * @package LunixREST\Server\Router\Endpoint\Exceptions
8 8
  */
9
-class InvalidRequestException extends EndpointExecutionException
10
-{
9
+class InvalidRequestException extends EndpointExecutionException {
11 10
 
12 11
 }
Please login to merge, or discard this patch.