@@ -143,7 +143,7 @@ |
||
| 143 | 143 | |
| 144 | 144 | public function updateConsoleForm(Form $form): void |
| 145 | 145 | { |
| 146 | - $count = $this->isMulti() ? 5 : 1; // TODO moznost nastavit kolko inputov sa ma vygenerovat v konzole, default moze byt 5 |
|
| 146 | + $count = $this->isMulti() ? 5 : 1; // TODO moznost nastavit kolko inputov sa ma vygenerovat v konzole, default moze byt 5 |
|
| 147 | 147 | for ($i = 0; $i < $count; $i++) { |
| 148 | 148 | $key = $this->getKey(); |
| 149 | 149 | if ($this->isMulti()) { |
@@ -9,11 +9,11 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | public function getRequestIp(): string |
| 11 | 11 | { |
| 12 | - if (!empty($_SERVER['HTTP_CLIENT_IP'])) { |
|
| 12 | + if ( ! empty($_SERVER['HTTP_CLIENT_IP'])) { |
|
| 13 | 13 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
| 14 | - } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] !== '127.0.0.1') { |
|
| 14 | + } elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] !== '127.0.0.1') { |
|
| 15 | 15 | $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; |
| 16 | - } elseif (!empty($_SERVER['REMOTE_ADDR'])) { |
|
| 16 | + } elseif ( ! empty($_SERVER['REMOTE_ADDR'])) { |
|
| 17 | 17 | $ip = $_SERVER['REMOTE_ADDR']; |
| 18 | 18 | } else { |
| 19 | 19 | $ip = 'cli'; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function __construct(string $status, array $errors = []) |
| 18 | 18 | { |
| 19 | - if (!in_array($status, [self::STATUS_OK, self::STATUS_ERROR], true)) { |
|
| 19 | + if ( ! in_array($status, [self::STATUS_OK, self::STATUS_ERROR], true)) { |
|
| 20 | 20 | throw new InvalidArgumentException($status . ' is not valid validation result status'); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -21,11 +21,11 @@ |
||
| 21 | 21 | { |
| 22 | 22 | foreach ($this->params as $param) { |
| 23 | 23 | $validationResult = $param->validate(); |
| 24 | - if (!$validationResult->isOk()) { |
|
| 24 | + if ( ! $validationResult->isOk()) { |
|
| 25 | 25 | $this->errors[$param->getKey()] = $validationResult->getErrors(); |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | - return !empty($this->errors); |
|
| 28 | + return ! empty($this->errors); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public function getErrors(): array |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | protected function readAuthorizationToken(): ?string |
| 21 | 21 | { |
| 22 | 22 | $apiKey = $_COOKIE[$this->cookieName] ?? null; |
| 23 | - if (!$apiKey) { |
|
| 23 | + if ( ! $apiKey) { |
|
| 24 | 24 | $this->errorMessage = 'API key is not set'; |
| 25 | 25 | return null; |
| 26 | 26 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | protected function readAuthorizationToken(): ?string |
| 30 | 30 | { |
| 31 | - if (!isset($_SERVER['HTTP_AUTHORIZATION'])) { |
|
| 31 | + if ( ! isset($_SERVER['HTTP_AUTHORIZATION'])) { |
|
| 32 | 32 | $this->errorMessage = 'Authorization header HTTP_Authorization is not set'; |
| 33 | 33 | return null; |
| 34 | 34 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | $headerName = 'HTTP_' . strtoupper(str_replace('-', '_', $this->headerName)); |
| 23 | 23 | $apiKey = $_SERVER[$headerName] ?? null; |
| 24 | - if (!$apiKey) { |
|
| 24 | + if ( ! $apiKey) { |
|
| 25 | 25 | $this->errorMessage = 'API key is not set'; |
| 26 | 26 | return null; |
| 27 | 27 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | protected function readAuthorizationToken(): ?string |
| 21 | 21 | { |
| 22 | 22 | $apiKey = $_GET[$this->queryParamName] ?? null; |
| 23 | - if (!$apiKey) { |
|
| 23 | + if ( ! $apiKey) { |
|
| 24 | 24 | $this->errorMessage = 'API key is not set'; |
| 25 | 25 | return null; |
| 26 | 26 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | } elseif ($param->getType() === InputParam::TYPE_COOKIE) { |
| 170 | 170 | $cookieFields[$key][] = $valueData; |
| 171 | 171 | } else { |
| 172 | - $getFields[$key][] = urlencode((string)$valueData); |
|
| 172 | + $getFields[$key][] = urlencode((string) $valueData); |
|
| 173 | 173 | } |
| 174 | 174 | } else { |
| 175 | 175 | if (in_array($param->getType(), [InputParam::TYPE_POST, InputParam::TYPE_FILE])) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } elseif ($param->getType() === InputParam::TYPE_COOKIE) { |
| 180 | 180 | $cookieFields[$key] = $valueData; |
| 181 | 181 | } else { |
| 182 | - $getFields[$key] = urlencode((string)$valueData); |
|
| 182 | + $getFields[$key] = urlencode((string) $valueData); |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | { |
| 224 | 224 | $result = []; |
| 225 | 225 | foreach ($values as $key => $value) { |
| 226 | - if (!is_array($value)) { |
|
| 226 | + if ( ! is_array($value)) { |
|
| 227 | 227 | $result[$key] = $value; |
| 228 | 228 | continue; |
| 229 | 229 | } |