@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @param array $params |
| 73 | 73 | * @return void |
| 74 | 74 | */ |
| 75 | - public function __construct(string $path, $class, ?string $method=null, array $params=[]) |
|
| 75 | + public function __construct(string $path, $class, ? string $method = null, array $params = []) |
|
| 76 | 76 | { |
| 77 | 77 | $this->setPath($path); |
| 78 | 78 | $this->setClass($class); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function match(): bool |
| 90 | 90 | { |
| 91 | - $regex = preg_replace_callback('#({([A-Z0-9a-z]+)\:\#(.+?)\#})|\{(.+?)\}#', function ($match) { |
|
| 91 | + $regex = preg_replace_callback('#({([A-Z0-9a-z]+)\:\#(.+?)\#})|\{(.+?)\}#', function($match) { |
|
| 92 | 92 | if (count($match) === 4) { |
| 93 | 93 | return '(?<'.$match[2].'>'.$match[3].'+)'; |
| 94 | 94 | } else { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @param array $constructor |
| 118 | 118 | * @return array |
| 119 | 119 | */ |
| 120 | - public function getCallable($constructor=[]): array |
|
| 120 | + public function getCallable($constructor = []): array |
|
| 121 | 121 | { |
| 122 | 122 | if (is_object($this->class)) { |
| 123 | 123 | $instance = $this->class; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * @param string $name |
| 140 | 140 | * @return string |
| 141 | 141 | */ |
| 142 | - protected function _buildMethodName(?string $name): string |
|
| 142 | + protected function _buildMethodName(? string $name) : string |
|
| 143 | 143 | { |
| 144 | 144 | $result = $this->router->getVerb(); |
| 145 | 145 | |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | * @param string $method |
| 265 | 265 | * @return Route |
| 266 | 266 | */ |
| 267 | - public function setMethod(?string $method): Route |
|
| 267 | + public function setMethod(? string $method) : Route |
|
| 268 | 268 | { |
| 269 | 269 | $this->method = $method; |
| 270 | 270 | return $this; |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | * @param bool $next |
| 313 | 313 | * @return Route |
| 314 | 314 | */ |
| 315 | - public function continuePropagation($next=true): Route |
|
| 315 | + public function continuePropagation($next = true): Route |
|
| 316 | 316 | { |
| 317 | 317 | $this->continue_propagation = (bool)$next; |
| 318 | 318 | return $this; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @param bool $body_only |
| 156 | 156 | * @return Response |
| 157 | 157 | */ |
| 158 | - public function setBody($body, bool $body_only=false): Response |
|
| 158 | + public function setBody($body, bool $body_only = false): Response |
|
| 159 | 159 | { |
| 160 | 160 | $this->body = $body; |
| 161 | 161 | $this->body_only = $body_only; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | { |
| 184 | 184 | $this->sendHeaders(); |
| 185 | 185 | $status = Http::STATUS_CODES[$this->code]; |
| 186 | - header('HTTP/1.0 ' . $this->code . ' ' . $status, true, $this->code); |
|
| 186 | + header('HTTP/1.0 '.$this->code.' '.$status, true, $this->code); |
|
| 187 | 187 | |
| 188 | 188 | if ($this->body === null && $this->code == 204) { |
| 189 | 189 | $this->terminate(); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @param array $constructor |
| 183 | 183 | * @return bool |
| 184 | 184 | */ |
| 185 | - public function run(array $constructor=[]): bool |
|
| 185 | + public function run(array $constructor = []): bool |
|
| 186 | 186 | { |
| 187 | 187 | $this->logger->info('execute requested route ['.$this->path.']', [ |
| 188 | 188 | 'category' => get_class($this), |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | if (!empty($body)) { |
| 287 | 287 | $json_params = json_decode($body, true); |
| 288 | 288 | } else { |
| 289 | - $parts = explode('&', $_SERVER['QUERY_STRING']); |
|
| 289 | + $parts = explode('&', $_SERVER['QUERY_STRING']); |
|
| 290 | 290 | if (!empty($parts)) { |
| 291 | 291 | $json_params = json_decode(urldecode($parts[0]), true); |
| 292 | 292 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @param Iterable $options |
| 35 | 35 | * @return AdapterInterface |
| 36 | 36 | */ |
| 37 | - public function setOptions(?Iterable $config=null): AdapterInterface |
|
| 37 | + public function setOptions(? Iterable $config = null) : AdapterInterface |
|
| 38 | 38 | { |
| 39 | 39 | parent::setOptions($config); |
| 40 | 40 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -70,15 +70,15 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // Check if given foreground color found |
| 72 | 72 | if (isset($this->foreground_colors[$foreground_color])) { |
| 73 | - $colored_string .= "\033[" . $this->foreground_colors[$foreground_color] . "m"; |
|
| 73 | + $colored_string .= "\033[".$this->foreground_colors[$foreground_color]."m"; |
|
| 74 | 74 | } |
| 75 | 75 | // Check if given background color found |
| 76 | 76 | if (isset($this->background_colors[$background_color])) { |
| 77 | - $colored_string .= "\033[" . $this->background_colors[$background_color] . "m"; |
|
| 77 | + $colored_string .= "\033[".$this->background_colors[$background_color]."m"; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Add string and end coloring |
| 81 | - $colored_string .= $string . "\033[0m"; |
|
| 81 | + $colored_string .= $string."\033[0m"; |
|
| 82 | 82 | |
| 83 | 83 | return $colored_string; |
| 84 | 84 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Micro |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @param Iterable $options |
| 30 | 30 | * @return void |
| 31 | 31 | */ |
| 32 | - public function __construct(?Iterable $config=null); |
|
| 32 | + public function __construct(? Iterable $config = null); |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -60,5 +60,5 @@ discard block |
||
| 60 | 60 | * @param Iterable $options |
| 61 | 61 | * @return AdapterInterface |
| 62 | 62 | */ |
| 63 | - public function setOptions(?Iterable $config=null): AdapterInterface; |
|
| 63 | + public function setOptions(? Iterable $config = null) : AdapterInterface; |
|
| 64 | 64 | } |