@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | if (defined("RESTSERVER_TEST")) { |
| 63 | 63 | return; |
| 64 | 64 | } |
| 65 | - header("Content-Type: " . $this->contentType); |
|
| 65 | + header("Content-Type: ".$this->contentType); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function getContentType() |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | { |
| 75 | 75 | foreach ($response->getHeaders() as $header => $value) { |
| 76 | 76 | if (is_array($value)) { |
| 77 | - header("$header: " . array_shift($value), true); |
|
| 77 | + header("$header: ".array_shift($value), true); |
|
| 78 | 78 | foreach ($value as $headerValue) { |
| 79 | 79 | header("$header: $headerValue", false); |
| 80 | 80 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $refClass = new \ReflectionClass($ex); |
| 20 | 20 | |
| 21 | - $title = str_replace("Exception", "", $refClass->getShortName()); |
|
| 21 | + $title = str_replace("Exception", "", $refClass->getShortName()); |
|
| 22 | 22 | $title = preg_replace("/([a-z0-9])([A-Z])/", "$1 $2", $title); |
| 23 | 23 | return preg_replace("/([a-z])(\d)/", "$1 $2", $title); |
| 24 | 24 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | protected $detailedErrorHandler = false; |
| 30 | 30 | protected $disableCors = false; |
| 31 | 31 | protected $corsOrigins = ['.*']; |
| 32 | - protected $corsMethods = [ 'GET', 'POST', 'PUT', 'DELETE', 'PATCH']; |
|
| 32 | + protected $corsMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']; |
|
| 33 | 33 | protected $corsHeaders = [ |
| 34 | 34 | 'Authorization', |
| 35 | 35 | 'Content-Type', |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | if (preg_match("~^.*//$origin$~", $request->server('HTTP_ORIGIN'))) { |
| 176 | 176 | $response->addHeader("Access-Control-Allow-Origin", $request->server('HTTP_ORIGIN')); |
| 177 | 177 | $response->addHeader('Access-Control-Allow-Credentials', 'true'); |
| 178 | - $response->addHeader('Access-Control-Max-Age', '86400'); // cache for 1 day |
|
| 178 | + $response->addHeader('Access-Control-Max-Age', '86400'); // cache for 1 day |
|
| 179 | 179 | |
| 180 | 180 | // Access-Control headers are received during OPTIONS requests |
| 181 | 181 | if ($request->server('REQUEST_METHOD') == 'OPTIONS') { |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | // Process Class::Method() |
| 211 | 211 | $function = $class[1]; |
| 212 | - $class = $class[0]; |
|
| 212 | + $class = $class[0]; |
|
| 213 | 213 | if (!class_exists($class)) { |
| 214 | 214 | throw new ClassNotFoundException("Class '$class' defined in the route is not found"); |
| 215 | 215 | } |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | throw new InvalidArgumentException("Default processor needs to class name of an OutputProcessor"); |
| 403 | 403 | } |
| 404 | 404 | if (!is_subclass_of($processor, BaseOutputProcessor::class)) { |
| 405 | - throw new InvalidArgumentException("Needs to be a class of " . BaseOutputProcessor::class); |
|
| 405 | + throw new InvalidArgumentException("Needs to be a class of ".BaseOutputProcessor::class); |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | new Route( |
| 97 | 97 | $route->getMethod(), |
| 98 | 98 | $route->getPath(), |
| 99 | - function () use ($route) { |
|
| 99 | + function() use ($route) { |
|
| 100 | 100 | return new MockOutputProcessor($route->getOutputProcessor()); |
| 101 | 101 | }, |
| 102 | 102 | $class, |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function writeHeader(HttpResponse $response) |
| 22 | 22 | { |
| 23 | - echo "HTTP/1.1 " . $response->getResponseCode() . "\r\n"; |
|
| 24 | - echo "Content-Type: " . $this->getContentType() . "\r\n"; |
|
| 23 | + echo "HTTP/1.1 ".$response->getResponseCode()."\r\n"; |
|
| 24 | + echo "Content-Type: ".$this->getContentType()."\r\n"; |
|
| 25 | 25 | |
| 26 | 26 | foreach ($response->getHeaders() as $header => $value) { |
| 27 | 27 | if (is_array($value)) { |