@@ -365,7 +365,7 @@ |
||
365 | 365 | switch($type) { |
366 | 366 | case 'bool': |
367 | 367 | if($param_value === 'false') { |
368 | - $return[$param->name] = false; |
|
368 | + $return[$param->name] = false; |
|
369 | 369 | } else { |
370 | 370 | $return[$param->name] = (bool)$param_value; |
371 | 371 | } |
@@ -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 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | 'code' => $exception->getCode() |
288 | 288 | ]; |
289 | 289 | |
290 | - if(defined("$class::HTTP_CODE")) { |
|
290 | + if (defined("$class::HTTP_CODE")) { |
|
291 | 291 | $http_code = $class::HTTP_CODE; |
292 | 292 | } else { |
293 | 293 | $http_code = 500; |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $param_value = $request_params[$param->name]; |
352 | 352 | } elseif (isset($json_params[$param->name])) { |
353 | 353 | $param_value = $json_params[$param->name]; |
354 | - } else if($optional === true) { |
|
354 | + } else if ($optional === true) { |
|
355 | 355 | $return[$param->name] = $param->getDefaultValue(); |
356 | 356 | continue; |
357 | 357 | } else { |
@@ -362,9 +362,9 @@ discard block |
||
362 | 362 | throw new Exception('misssing required parameter '.$param->name); |
363 | 363 | } |
364 | 364 | |
365 | - switch($type) { |
|
365 | + switch ($type) { |
|
366 | 366 | case 'bool': |
367 | - if($param_value === 'false') { |
|
367 | + if ($param_value === 'false') { |
|
368 | 368 | $return[$param->name] = false; |
369 | 369 | } else { |
370 | 370 | $return[$param->name] = (bool)$param_value; |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $return[$param->name] = (array)$param_value; |
381 | 381 | break; |
382 | 382 | default: |
383 | - if(class_exists($type) && $param_value !== null) { |
|
383 | + if (class_exists($type) && $param_value !== null) { |
|
384 | 384 | $return[$param->name] = new $type($param_value); |
385 | 385 | } else { |
386 | 386 | $return[$param->name] = $param_value; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function removeHeader(string $header): Response |
102 | 102 | { |
103 | - if(isset($this->headers[$header])) { |
|
103 | + if (isset($this->headers[$header])) { |
|
104 | 104 | unset($this->headers[$header]); |
105 | 105 | } |
106 | 106 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | return; |
205 | 205 | } |
206 | 206 | |
207 | - if($this->body instanceof Closure) { |
|
207 | + if ($this->body instanceof Closure) { |
|
208 | 208 | $body = $this->body->call($this); |
209 | 209 | } else { |
210 | 210 | $body = $this->body; |
@@ -362,14 +362,14 @@ discard block |
||
362 | 362 | * @param string $format |
363 | 363 | * @return Response |
364 | 364 | */ |
365 | - public function setOutputFormat(?string $format=null): Response |
|
365 | + public function setOutputFormat(?string $format = null): Response |
|
366 | 366 | { |
367 | - if($format === null) { |
|
367 | + if ($format === null) { |
|
368 | 368 | $this->output_format = null; |
369 | 369 | return $this->removeHeader('Content-Type'); |
370 | 370 | } |
371 | 371 | |
372 | - if(!array_key_exists($format, self::OUTPUT_FORMATS)) { |
|
372 | + if (!array_key_exists($format, self::OUTPUT_FORMATS)) { |
|
373 | 373 | throw new Exception('invalid output format given'); |
374 | 374 | } |
375 | 375 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * balloon |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function match(): bool |
83 | 83 | { |
84 | - $regex = preg_replace_callback('#({([A-Z0-9a-z]+)\:\#(.+?)\#})|\{(.+?)\}#', function ($match) { |
|
84 | + $regex = preg_replace_callback('#({([A-Z0-9a-z]+)\:\#(.+?)\#})|\{(.+?)\}#', function($match) { |
|
85 | 85 | if (4 === count($match)) { |
86 | 86 | return '(?<'.$match[2].'>'.$match[3].'+)'; |
87 | 87 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function setPath(string $path): self |
173 | 173 | { |
174 | - $this->path = (string) $path; |
|
174 | + $this->path = (string)$path; |
|
175 | 175 | |
176 | 176 | return $this; |
177 | 177 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | public function continuePropagation($next = true): self |
290 | 290 | { |
291 | - $this->continue_propagation = (bool) $next; |
|
291 | + $this->continue_propagation = (bool)$next; |
|
292 | 292 | |
293 | 293 | return $this; |
294 | 294 | } |