@@ -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 | * Balloon |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @param object|array $config |
| 54 | 54 | * @return bool |
| 55 | 55 | */ |
| 56 | - public function registerPlugin($name, $config=null): bool |
|
| 56 | + public function registerPlugin($name, $config = null): bool |
|
| 57 | 57 | { |
| 58 | 58 | if ($name instanceof Config) { |
| 59 | 59 | foreach ($name as $id => $config) { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @param array $context |
| 113 | 113 | * @return bool |
| 114 | 114 | */ |
| 115 | - public function run(string $method, array $context=[]): bool |
|
| 115 | + public function run(string $method, array $context = []): bool |
|
| 116 | 116 | { |
| 117 | 117 | $this->logger->debug('execute plugins hooks for ['.$method.']', [ |
| 118 | 118 | 'category' => get_class($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 | * Balloon |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * @param array $constructor |
| 197 | 197 | * @return bool |
| 198 | 198 | */ |
| 199 | - public function run(array $constructor=[]): bool |
|
| 199 | + public function run(array $constructor = []): bool |
|
| 200 | 200 | { |
| 201 | 201 | $this->logger->info('execute requested route ['.$this->path.']', [ |
| 202 | 202 | 'category' => get_class($this), |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | if (!empty($body)) { |
| 320 | 320 | $json_params = json_decode($body, true); |
| 321 | 321 | } else { |
| 322 | - $parts = explode('&', $_SERVER['QUERY_STRING']); |
|
| 322 | + $parts = explode('&', $_SERVER['QUERY_STRING']); |
|
| 323 | 323 | if (!empty($parts)) { |
| 324 | 324 | $json_params = json_decode(urldecode($parts[0]), true); |
| 325 | 325 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | /** |
| 5 | 5 | * Balloon |
@@ -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 | * Balloon |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @param bool $body_only |
| 159 | 159 | * @return Response |
| 160 | 160 | */ |
| 161 | - public function setBody($body, bool $body_only=false): Response |
|
| 161 | + public function setBody($body, bool $body_only = false): Response |
|
| 162 | 162 | { |
| 163 | 163 | $this->body = $body; |
| 164 | 164 | $this->body_only = $body_only; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | { |
| 187 | 187 | $this->sendHeaders(); |
| 188 | 188 | $status = Http::STATUS_CODES[$this->code]; |
| 189 | - header('HTTP/1.0 ' . $this->code . ' ' . $status, true, $this->code); |
|
| 189 | + header('HTTP/1.0 '.$this->code.' '.$status, true, $this->code); |
|
| 190 | 190 | |
| 191 | 191 | if ($this->body === null && $this->code == 204) { |
| 192 | 192 | $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 | * Balloon |
@@ -250,25 +250,25 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | switch ($value['type']) { |
| 252 | 252 | case 'array': |
| 253 | - $arr = (array)$data[$value['attr']]; |
|
| 253 | + $arr = (array)$data[$value['attr']]; |
|
| 254 | 254 | unset($arr['count']); |
| 255 | 255 | $attrs[$attr] = $arr; |
| 256 | 256 | break; |
| 257 | 257 | |
| 258 | 258 | case 'string': |
| 259 | - $attrs[$attr] = (string)$store; |
|
| 259 | + $attrs[$attr] = (string)$store; |
|
| 260 | 260 | break; |
| 261 | 261 | |
| 262 | 262 | case 'int': |
| 263 | - $attrs[$attr] = (int)$store; |
|
| 263 | + $attrs[$attr] = (int)$store; |
|
| 264 | 264 | break; |
| 265 | 265 | |
| 266 | 266 | case 'bool': |
| 267 | - $attrs[$attr] = (bool)$store; |
|
| 267 | + $attrs[$attr] = (bool)$store; |
|
| 268 | 268 | break; |
| 269 | 269 | |
| 270 | 270 | case 'binary': |
| 271 | - $attrs[$attr] = new Binary($store, Binary::TYPE_GENERIC); |
|
| 271 | + $attrs[$attr] = new Binary($store, Binary::TYPE_GENERIC); |
|
| 272 | 272 | break; |
| 273 | 273 | |
| 274 | 274 | default: |
@@ -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 | * Balloon |
@@ -71,15 +71,15 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | // Check if given foreground color found |
| 73 | 73 | if (isset($this->foreground_colors[$foreground_color])) { |
| 74 | - $colored_string .= "\033[" . $this->foreground_colors[$foreground_color] . "m"; |
|
| 74 | + $colored_string .= "\033[".$this->foreground_colors[$foreground_color]."m"; |
|
| 75 | 75 | } |
| 76 | 76 | // Check if given background color found |
| 77 | 77 | if (isset($this->background_colors[$background_color])) { |
| 78 | - $colored_string .= "\033[" . $this->background_colors[$background_color] . "m"; |
|
| 78 | + $colored_string .= "\033[".$this->background_colors[$background_color]."m"; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | // Add string and end coloring |
| 82 | - $colored_string .= $string . "\033[0m"; |
|
| 82 | + $colored_string .= $string."\033[0m"; |
|
| 83 | 83 | |
| 84 | 84 | return $colored_string; |
| 85 | 85 | } |
@@ -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 | * Balloon |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | parent::init(); |
| 40 | 40 | $this->setExceptionHandler(); |
| 41 | 41 | |
| 42 | - $this->logger->info('processing incoming http ['. $_SERVER['REQUEST_METHOD'].'] request to ['.$_SERVER['REQUEST_URI'].']', [ |
|
| 42 | + $this->logger->info('processing incoming http ['.$_SERVER['REQUEST_METHOD'].'] request to ['.$_SERVER['REQUEST_URI'].']', [ |
|
| 43 | 43 | 'category' => get_class($this), |
| 44 | 44 | ]); |
| 45 | 45 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | protected function setExceptionHandler(): Http |
| 127 | 127 | { |
| 128 | - set_exception_handler(function ($e) { |
|
| 128 | + set_exception_handler(function($e) { |
|
| 129 | 129 | $this->logger->emergency('uncaught exception: '.$e->getMessage(), [ |
| 130 | 130 | 'category' => get_class($this), |
| 131 | 131 | 'exception' => $e |
@@ -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 | * Balloon |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | protected function setExceptionHandler(): Cli |
| 117 | 117 | { |
| 118 | - set_exception_handler(function ($e) { |
|
| 118 | + set_exception_handler(function($e) { |
|
| 119 | 119 | $this->logger->emergency('uncaught exception: '.$e->getMessage(), [ |
| 120 | 120 | 'category' => get_class($this), |
| 121 | 121 | 'exception' => $e |
@@ -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 | * Balloon |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @var Config |
| 47 | 47 | */ |
| 48 | - protected $option_log ; |
|
| 48 | + protected $option_log; |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | protected function setErrorHandler() |
| 144 | 144 | { |
| 145 | - set_error_handler(function ($errno, $errstr, $errfile, $errline) { |
|
| 145 | + set_error_handler(function($errno, $errstr, $errfile, $errline) { |
|
| 146 | 146 | $msg = $errstr." in ".$errfile.":".$errline; |
| 147 | 147 | switch ($errno) { |
| 148 | 148 | case E_ERROR: |