@@ -69,7 +69,7 @@ |
||
| 69 | 69 | { |
| 70 | 70 | $this->invalidate(); |
| 71 | 71 | |
| 72 | - if ($overwrite || ! isset($this->configSchemas[$key])) { |
|
| 72 | + if ($overwrite || !isset($this->configSchemas[$key])) { |
|
| 73 | 73 | $this->configSchemas[$key] = $schema; |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -327,14 +327,14 @@ |
||
| 327 | 327 | */ |
| 328 | 328 | private function setFormatter(object $handler, array $allowed, ?string $format = 'json'): object |
| 329 | 329 | { |
| 330 | - if (! method_exists($handler, 'setFormatter')) { |
|
| 330 | + if (!method_exists($handler, 'setFormatter')) { |
|
| 331 | 331 | return $handler; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | if (empty($format)) { |
| 335 | 335 | $format = 'json'; |
| 336 | 336 | } |
| 337 | - if (! empty($allowed) && ! in_array($format, $allowed, true)) { |
|
| 337 | + if (!empty($allowed) && !in_array($format, $allowed, true)) { |
|
| 338 | 338 | throw new InvalidArgumentException('Invalid formatter for log file handler. Accepts values: ' . implode('/', $allowed)); |
| 339 | 339 | } |
| 340 | 340 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function start(string $name, ?float $time = null): self |
| 35 | 35 | { |
| 36 | 36 | $this->timers[strtolower($name)] = [ |
| 37 | - 'start' => ! empty($time) ? $time : microtime(true), |
|
| 37 | + 'start' => !empty($time) ? $time : microtime(true), |
|
| 38 | 38 | 'end' => null, |
| 39 | 39 | ]; |
| 40 | 40 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | public function add($middlewares): self |
| 51 | 51 | { |
| 52 | - if (! is_array($middlewares)) { |
|
| 52 | + if (!is_array($middlewares)) { |
|
| 53 | 53 | $middlewares = [$middlewares]; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | $body = $response->getBody(); |
| 113 | 113 | |
| 114 | - if (! $body->isSeekable()) { |
|
| 114 | + if (!$body->isSeekable()) { |
|
| 115 | 115 | echo $body; |
| 116 | 116 | |
| 117 | 117 | return; |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | $body->rewind(); |
| 121 | 121 | |
| 122 | - while (! $body->eof()) { |
|
| 122 | + while (!$body->eof()) { |
|
| 123 | 123 | echo $body->read($maxBufferLength); |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | $body = $response->getBody(); |
| 140 | 140 | |
| 141 | - if (! $body->isSeekable()) { |
|
| 141 | + if (!$body->isSeekable()) { |
|
| 142 | 142 | $contents = $body->getContents(); |
| 143 | 143 | echo substr($contents, $first, $last - $first + 1); |
| 144 | 144 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $pos = 0; |
| 151 | 151 | $length = $last - $first + 1; |
| 152 | 152 | |
| 153 | - while (! $body->eof() && $pos < $length) { |
|
| 153 | + while (!$body->eof() && $pos < $length) { |
|
| 154 | 154 | if (($pos + $maxBufferLength) > $length) { |
| 155 | 155 | echo $body->read($length - $pos); |
| 156 | 156 | break; |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $key = strtolower($key); |
| 234 | 234 | $data[$key] = $value; |
| 235 | 235 | } |
| 236 | - if (! empty($data['expires'])) { |
|
| 236 | + if (!empty($data['expires'])) { |
|
| 237 | 237 | $data['expires'] = strtotime($data['expires']); |
| 238 | 238 | } |
| 239 | 239 | setcookie( |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | $this->_streamMode = $options['streamMode'] ?? $this->_streamMode; |
| 451 | 451 | |
| 452 | 452 | if (isset($options['stream'])) { |
| 453 | - if (! $options['stream'] instanceof StreamInterface) { |
|
| 453 | + if (!$options['stream'] instanceof StreamInterface) { |
|
| 454 | 454 | throw new InvalidArgumentException('Stream option must be an object that implements StreamInterface'); |
| 455 | 455 | } |
| 456 | 456 | $this->stream = $options['stream']; |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | $this->_setStatus($options['status']); |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | - if (! isset($options['charset'])) { |
|
| 469 | + if (!isset($options['charset'])) { |
|
| 470 | 470 | $options['charset'] = config('app.charset'); |
| 471 | 471 | } |
| 472 | 472 | $this->_charset = $options['charset']; |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | protected function _clearHeader(string $header): void |
| 595 | 595 | { |
| 596 | 596 | $normalized = strtolower($header); |
| 597 | - if (! isset($this->headerNames[$normalized])) { |
|
| 597 | + if (!isset($this->headerNames[$normalized])) { |
|
| 598 | 598 | return; |
| 599 | 599 | } |
| 600 | 600 | $original = $this->headerNames[$normalized]; |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | */ |
| 834 | 834 | public function withCache($since, $time = '+1 day'): static |
| 835 | 835 | { |
| 836 | - if (! is_int($time)) { |
|
| 836 | + if (!is_int($time)) { |
|
| 837 | 837 | $time = strtotime($time); |
| 838 | 838 | if ($time === false) { |
| 839 | 839 | throw new InvalidArgumentException( |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | */ |
| 1288 | 1288 | public function getCookie(string $name): ?array |
| 1289 | 1289 | { |
| 1290 | - if (! $this->_cookies->has($name)) { |
|
| 1290 | + if (!$this->_cookies->has($name)) { |
|
| 1291 | 1291 | return null; |
| 1292 | 1292 | } |
| 1293 | 1293 | |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | |
| 1361 | 1361 | $extension = strtolower($file->getExtension()); |
| 1362 | 1362 | $mapped = $this->getMimeType($extension); |
| 1363 | - if ((! $extension || ! $mapped) && $options['download'] === null) { |
|
| 1363 | + if ((!$extension || !$mapped) && $options['download'] === null) { |
|
| 1364 | 1364 | $options['download'] = true; |
| 1365 | 1365 | } |
| 1366 | 1366 | |
@@ -1424,12 +1424,12 @@ discard block |
||
| 1424 | 1424 | if (strpos($path, '../') !== false || strpos($path, '..\\') !== false) { |
| 1425 | 1425 | throw new LoadException('The requested file contains `..` and will not be read.'); |
| 1426 | 1426 | } |
| 1427 | - if (! is_file($path)) { |
|
| 1428 | - $path = APP_PATH . $path; // @phpstan-ignore-line |
|
| 1427 | + if (!is_file($path)) { |
|
| 1428 | + $path = APP_PATH . $path; // @phpstan-ignore-line |
|
| 1429 | 1429 | } |
| 1430 | 1430 | |
| 1431 | 1431 | $file = new SplFileInfo($path); |
| 1432 | - if (! $file->isFile() || ! $file->isReadable()) { |
|
| 1432 | + if (!$file->isFile() || !$file->isReadable()) { |
|
| 1433 | 1433 | if (on_dev()) { |
| 1434 | 1434 | throw new LoadException(sprintf('The requested file %s was not found or not readable', $path)); |
| 1435 | 1435 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | // Sort to get the highest results first |
| 209 | - usort($results, static function ($a, $b) { |
|
| 209 | + usort($results, static function($a, $b) { |
|
| 210 | 210 | if ($a['q'] === $b['q']) { |
| 211 | 211 | $a_ast = substr_count($a['value'], '*'); |
| 212 | 212 | $b_ast = substr_count($b['value'], '*'); |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | foreach ($supported['params'] as $label => $value) { |
| 279 | - if (! isset($acceptable['params'][$label]) || $acceptable['params'][$label] !== $value) { |
|
| 279 | + if (!isset($acceptable['params'][$label]) || $acceptable['params'][$label] !== $value) { |
|
| 280 | 280 | return false; |
| 281 | 281 | } |
| 282 | 282 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | { |
| 50 | 50 | $route = Services::routes()->reverseRoute($route, ...$params); |
| 51 | 51 | |
| 52 | - if (! $route) { |
|
| 52 | + if (!$route) { |
|
| 53 | 53 | throw HttpException::invalidRedirectRoute($route); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -80,9 +80,9 @@ |
||
| 80 | 80 | $session = Services::session(); |
| 81 | 81 | |
| 82 | 82 | $session->setFlashdata('_blitz_old_input', [ |
| 83 | - 'get' => $_GET ?? [], |
|
| 84 | - 'post' => $_POST ?? [], |
|
| 85 | - ]); |
|
| 83 | + 'get' => $_GET ?? [], |
|
| 84 | + 'post' => $_POST ?? [], |
|
| 85 | + ]); |
|
| 86 | 86 | |
| 87 | 87 | // Si la validation contient des erreurs, retransmettez-les |
| 88 | 88 | // afin qu'ils puissent être affichés lors de la validation |
@@ -48,11 +48,11 @@ |
||
| 48 | 48 | |
| 49 | 49 | $object->setData($data)->setOptions($options); |
| 50 | 50 | |
| 51 | - if (! empty($this->layout) && is_string($this->layout)) { |
|
| 51 | + if (!empty($this->layout) && is_string($this->layout)) { |
|
| 52 | 52 | $object->setLayout($this->layout); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - if (! empty($this->viewDatas) && is_array($this->viewDatas)) { |
|
| 55 | + if (!empty($this->viewDatas) && is_array($this->viewDatas)) { |
|
| 56 | 56 | $object->addData($this->viewDatas); |
| 57 | 57 | } |
| 58 | 58 | |