@@ -351,11 +351,11 @@ |
||
| 351 | 351 | if (isset($request_params[$param->name]) && $request_params[$param->name] !== '') { |
| 352 | 352 | if (is_bool($default)) { |
| 353 | 353 | if($request_params[$param->name] === 'false') { |
| 354 | - $return[$param->name] = false; |
|
| 354 | + $return[$param->name] = false; |
|
| 355 | 355 | } else { |
| 356 | 356 | $return[$param->name] = (bool)$request_params[$param->name]; |
| 357 | 357 | } |
| 358 | - } elseif (is_int($default)) { |
|
| 358 | + } elseif (is_int($default)) { |
|
| 359 | 359 | $return[$param->name] = (int)$request_params[$param->name]; |
| 360 | 360 | } elseif (is_array($default)) { |
| 361 | 361 | $return[$param->name] = (array)$request_params[$param->name]; |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | * @param array $request |
| 68 | 68 | * @return void |
| 69 | 69 | */ |
| 70 | - public function __construct(LoggerInterface $logger, ?array $request=null, ?ContainerInterface $container=null) |
|
| 70 | + public function __construct(LoggerInterface $logger, ? array $request = null, ?ContainerInterface $container = null) |
|
| 71 | 71 | { |
| 72 | 72 | $this->logger = $logger; |
| 73 | 73 | $this->container = $container; |
| 74 | 74 | |
| 75 | - if($request === null) { |
|
| 75 | + if ($request === null) { |
|
| 76 | 76 | $request = $_SERVER; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | 'code' => $exception->getCode() |
| 286 | 286 | ]; |
| 287 | 287 | |
| 288 | - if(defined("$class::HTTP_CODE")) { |
|
| 288 | + if (defined("$class::HTTP_CODE")) { |
|
| 289 | 289 | $http_code = $class::HTTP_CODE; |
| 290 | 290 | } else { |
| 291 | 291 | $http_code = 500; |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | |
| 351 | 351 | if (isset($request_params[$param->name]) && $request_params[$param->name] !== '') { |
| 352 | 352 | if (is_bool($default)) { |
| 353 | - if($request_params[$param->name] === 'false') { |
|
| 353 | + if ($request_params[$param->name] === 'false') { |
|
| 354 | 354 | $return[$param->name] = false; |
| 355 | 355 | } else { |
| 356 | 356 | $return[$param->name] = (bool)$request_params[$param->name]; |
@@ -118,12 +118,12 @@ |
||
| 118 | 118 | * @param ContainerInterface $container |
| 119 | 119 | * @return array |
| 120 | 120 | */ |
| 121 | - public function getCallable(?ContainerInterface $container=null): array |
|
| 121 | + public function getCallable(?ContainerInterface $container = null) : array |
|
| 122 | 122 | { |
| 123 | 123 | if (is_object($this->class)) { |
| 124 | 124 | $instance = $this->class; |
| 125 | 125 | } else { |
| 126 | - if($container === null) { |
|
| 126 | + if ($container === null) { |
|
| 127 | 127 | $instance = new $this->class(); |
| 128 | 128 | } else { |
| 129 | 129 | $instance = $container->get($this->class); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function removeHeader(string $header): Response |
| 110 | 110 | { |
| 111 | - if(isset($this->headers[$header])) { |
|
| 111 | + if (isset($this->headers[$header])) { |
|
| 112 | 112 | unset($this->headers[$header]); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $this->terminate(); |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - if($this->body instanceof Closure) { |
|
| 216 | + if ($this->body instanceof Closure) { |
|
| 217 | 217 | $body = $this->body->call($this); |
| 218 | 218 | } else { |
| 219 | 219 | $body = $this->body; |
@@ -373,14 +373,14 @@ discard block |
||
| 373 | 373 | * @param string $format |
| 374 | 374 | * @return Response |
| 375 | 375 | */ |
| 376 | - public function setOutputFormat(?string $format=null): Response |
|
| 376 | + public function setOutputFormat(?string $format = null) : Response |
|
| 377 | 377 | { |
| 378 | - if($format === null) { |
|
| 378 | + if ($format === null) { |
|
| 379 | 379 | $this->output_format = null; |
| 380 | 380 | return $this->removeHeader('Content-Type'); |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - if(!array_key_exists($format, self::OUTPUT_FORMATS)) { |
|
| 383 | + if (!array_key_exists($format, self::OUTPUT_FORMATS)) { |
|
| 384 | 384 | throw new Exception('invalid output format given'); |
| 385 | 385 | } |
| 386 | 386 | |