@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | protected $useErrorHandler = true; |
24 | 24 | protected $detailedErrorHandler = false; |
25 | 25 | protected $corsOrigins = []; |
26 | - protected $corsMethods = [ 'GET', 'POST', 'PUT', 'DELETE', 'PATCH']; |
|
26 | + protected $corsMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']; |
|
27 | 27 | protected $corsHeaders = [ |
28 | 28 | 'Authorization', |
29 | 29 | 'Content-Type', |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | case Dispatcher::METHOD_NOT_ALLOWED: |
85 | 85 | $outputProcessor = $this->prepareToOutput(); |
86 | 86 | if (strtoupper($httpMethod) == "OPTIONS" && !empty($this->corsOrigins)) { |
87 | - $this->executeRequest($outputProcessor, function () {}, $request); |
|
87 | + $this->executeRequest($outputProcessor, function() {}, $request); |
|
88 | 88 | return; |
89 | 89 | } |
90 | 90 | throw new Error405Exception('Method not allowed'); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | if (preg_match("~^.*//$origin$~", $request->server('HTTP_ORIGIN'))) { |
157 | 157 | $response->addHeader("Access-Control-Allow-Origin", $request->server('HTTP_ORIGIN')); |
158 | 158 | $response->addHeader('Access-Control-Allow-Credentials', 'true'); |
159 | - $response->addHeader('Access-Control-Max-Age', '86400'); // cache for 1 day |
|
159 | + $response->addHeader('Access-Control-Max-Age', '86400'); // cache for 1 day |
|
160 | 160 | |
161 | 161 | // Access-Control headers are received during OPTIONS requests |
162 | 162 | if ($request->server('REQUEST_METHOD') == 'OPTIONS') { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | |
181 | 181 | // Process Class::Method() |
182 | 182 | $function = $class[1]; |
183 | - $class = $class[0]; |
|
183 | + $class = $class[0]; |
|
184 | 184 | if (!class_exists($class)) { |
185 | 185 | throw new ClassNotFoundException("Class '$class' defined in the route is not found"); |
186 | 186 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | throw new InvalidArgumentException("Default processor needs to class name of an OutputProcessor"); |
366 | 366 | } |
367 | 367 | if (!is_subclass_of($processor, BaseOutputProcessor::class)) { |
368 | - throw new InvalidArgumentException("Needs to be a class of " . BaseOutputProcessor::class); |
|
368 | + throw new InvalidArgumentException("Needs to be a class of ".BaseOutputProcessor::class); |
|
369 | 369 | } |
370 | 370 | } |
371 | 371 |