@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | |
| 271 | 271 | $route = $this->routes->reverseRoute($action, ...$parameters); |
| 272 | 272 | |
| 273 | - if (! $route) { |
|
| 273 | + if (!$route) { |
|
| 274 | 274 | throw RouterException::actionNotDefined($action); |
| 275 | 275 | } |
| 276 | 276 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | */ |
| 342 | 342 | public function isValidUrl(string $path): bool |
| 343 | 343 | { |
| 344 | - if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) { |
|
| 344 | + if (!preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) { |
|
| 345 | 345 | return filter_var($path, FILTER_VALIDATE_URL) !== false; |
| 346 | 346 | } |
| 347 | 347 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $this->path = $path; |
| 36 | 36 | |
| 37 | 37 | foreach ($this->arguments as $argument => $value) { |
| 38 | - if (! is_string($argument)) { |
|
| 38 | + if (!is_string($argument)) { |
|
| 39 | 39 | continue; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $options = (array) $options; |
| 46 | 46 | |
| 47 | 47 | // N'est-il pas namespaced ? on cherche le dossier en fonction du controleur |
| 48 | - if (! str_contains($view, '\\')) { |
|
| 48 | + if (!str_contains($view, '\\')) { |
|
| 49 | 49 | $reflection = new ReflectionClass(static::class); |
| 50 | 50 | ['dirname' => $dirname, 'filename' => $filename] = pathinfo($reflection->getFileName()); |
| 51 | 51 | $dirname = str_ireplace('Controllers', 'Views', $dirname); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $dirname = implode('Views', $parts); |
| 60 | 60 | $path = implode(DS, [$dirname, $filename]) . DS; |
| 61 | 61 | |
| 62 | - if (! is_dir($path)) { |
|
| 62 | + if (!is_dir($path)) { |
|
| 63 | 63 | $path = implode(DS, [$dirname]) . DS; |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | $viewer->layout($this->layout); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (! empty($this->viewDatas) && is_array($this->viewDatas)) { |
|
| 75 | + if (!empty($this->viewDatas) && is_array($this->viewDatas)) { |
|
| 76 | 76 | $viewer->addData($this->viewDatas); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | if (empty($data['title'])) { |
| 80 | - if (! is_string($controllerName = Dispatcher::getController(false))) { |
|
| 80 | + if (!is_string($controllerName = Dispatcher::getController(false))) { |
|
| 81 | 81 | $controllerName = static::class; |
| 82 | 82 | } |
| 83 | 83 | $controllerName = str_ireplace(['App\Controllers', 'Controller'], '', $controllerName); |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | $authority = $this->host; |
| 151 | 151 | |
| 152 | - if (! empty($this->getUserInfo())) { |
|
| 152 | + if (!empty($this->getUserInfo())) { |
|
| 153 | 153 | $authority = $this->getUserInfo() . '@' . $authority; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | // N'ajoute pas de port s'il s'agit d'un port standard pour ce schéma |
| 157 | - if (! empty($this->port) && ! $ignorePort && $this->port !== $this->defaultPorts[$this->scheme]) { |
|
| 157 | + if (!empty($this->port) && !$ignorePort && $this->port !== $this->defaultPorts[$this->scheme]) { |
|
| 158 | 158 | $authority .= ':' . $this->port; |
| 159 | 159 | } |
| 160 | 160 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $userInfo = $this->user ?: ''; |
| 172 | 172 | |
| 173 | - if ($this->showPassword === true && ! empty($this->password)) { |
|
| 173 | + if ($this->showPassword === true && !empty($this->password)) { |
|
| 174 | 174 | $userInfo .= ':' . $this->password; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $vars = $this->query; |
| 221 | 221 | |
| 222 | 222 | if (array_key_exists('except', $options)) { |
| 223 | - if (! is_array($options['except'])) { |
|
| 223 | + if (!is_array($options['except'])) { |
|
| 224 | 224 | $options['except'] = [$options['except']]; |
| 225 | 225 | } |
| 226 | 226 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | } elseif (array_key_exists('only', $options)) { |
| 231 | 231 | $temp = []; |
| 232 | 232 | |
| 233 | - if (! is_array($options['only'])) { |
|
| 233 | + if (!is_array($options['only'])) { |
|
| 234 | 234 | $options['only'] = [$options['only']]; |
| 235 | 235 | } |
| 236 | 236 | |
@@ -344,11 +344,11 @@ discard block |
||
| 344 | 344 | public static function createURIString(?string $scheme = null, ?string $authority = null, ?string $path = null, ?string $query = null, ?string $fragment = null): string |
| 345 | 345 | { |
| 346 | 346 | $uri = ''; |
| 347 | - if (! empty($scheme)) { |
|
| 347 | + if (!empty($scheme)) { |
|
| 348 | 348 | $uri .= $scheme . '://'; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | - if (! empty($authority)) { |
|
| 351 | + if (!empty($authority)) { |
|
| 352 | 352 | $uri .= $authority; |
| 353 | 353 | } |
| 354 | 354 | |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | { |
| 377 | 377 | $parts = parse_url($str); |
| 378 | 378 | |
| 379 | - if (! isset($parts['path'])) { |
|
| 379 | + if (!isset($parts['path'])) { |
|
| 380 | 380 | $parts['path'] = $this->getPath(); |
| 381 | 381 | } |
| 382 | 382 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | // Ne peut pas avoir de début ? |
| 552 | - if (! empty($query) && str_starts_with($query, '?')) { |
|
| 552 | + if (!empty($query) && str_starts_with($query, '?')) { |
|
| 553 | 553 | $query = substr($query, 1); |
| 554 | 554 | } |
| 555 | 555 | |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | $temp = []; |
| 626 | 626 | |
| 627 | 627 | foreach ($this->query as $key => $value) { |
| 628 | - if (! in_array($key, $params, true)) { |
|
| 628 | + if (!in_array($key, $params, true)) { |
|
| 629 | 629 | continue; |
| 630 | 630 | } |
| 631 | 631 | |
@@ -700,19 +700,19 @@ discard block |
||
| 700 | 700 | */ |
| 701 | 701 | protected function applyParts(array $parts) |
| 702 | 702 | { |
| 703 | - if (! empty($parts['host'])) { |
|
| 703 | + if (!empty($parts['host'])) { |
|
| 704 | 704 | $this->host = $parts['host']; |
| 705 | 705 | } |
| 706 | - if (! empty($parts['user'])) { |
|
| 706 | + if (!empty($parts['user'])) { |
|
| 707 | 707 | $this->user = $parts['user']; |
| 708 | 708 | } |
| 709 | - if (! empty($parts['path'])) { |
|
| 709 | + if (!empty($parts['path'])) { |
|
| 710 | 710 | $this->path = $this->filterPath($parts['path']); |
| 711 | 711 | } |
| 712 | - if (! empty($parts['query'])) { |
|
| 712 | + if (!empty($parts['query'])) { |
|
| 713 | 713 | $this->setQuery($parts['query']); |
| 714 | 714 | } |
| 715 | - if (! empty($parts['fragment'])) { |
|
| 715 | + if (!empty($parts['fragment'])) { |
|
| 716 | 716 | $this->fragment = $parts['fragment']; |
| 717 | 717 | } |
| 718 | 718 | |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | $transformed = clone $relative; |
| 761 | 761 | |
| 762 | 762 | // 5.2.2 Transformer les références dans une méthode non stricte (pas de schéma) |
| 763 | - if (! empty($relative->getAuthority())) { |
|
| 763 | + if (!empty($relative->getAuthority())) { |
|
| 764 | 764 | $transformed->setAuthority($relative->getAuthority()) |
| 765 | 765 | ->setPath($relative->getPath()) |
| 766 | 766 | ->setQuery($relative->getQuery()); |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | */ |
| 801 | 801 | protected function mergePaths(self $base, self $reference): string |
| 802 | 802 | { |
| 803 | - if (! empty($base->getAuthority()) && '' === $base->getPath()) { |
|
| 803 | + if (!empty($base->getAuthority()) && '' === $base->getPath()) { |
|
| 804 | 804 | return '/' . ltrim($reference->getPath(), '/ '); |
| 805 | 805 | } |
| 806 | 806 | |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | $basePath = trim($baseUri->getPath(), '/') . '/'; |
| 884 | 884 | $trimPath = ltrim($path, '/'); |
| 885 | 885 | |
| 886 | - if ($basePath !== '/' && ! str_starts_with($trimPath, $basePath)) { |
|
| 886 | + if ($basePath !== '/' && !str_starts_with($trimPath, $basePath)) { |
|
| 887 | 887 | $path = $basePath . $trimPath; |
| 888 | 888 | } |
| 889 | 889 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | // Enregistrer les variables actuelles |
| 122 | 122 | $renderVars = $this->renderVars; |
| 123 | 123 | |
| 124 | - $output = (function (): string { |
|
| 124 | + $output = (function(): string { |
|
| 125 | 125 | extract($this->tempData); |
| 126 | 126 | ob_start(); |
| 127 | 127 | include $this->renderVars['file']; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | $this->logPerformance($this->renderVars['start'], microtime(true), $this->renderVars['view']); |
| 144 | 144 | |
| 145 | - if (($this->debug && (! isset($options['debug']) || $options['debug'] === true))) { |
|
| 145 | + if (($this->debug && (!isset($options['debug']) || $options['debug'] === true))) { |
|
| 146 | 146 | if (in_array(ViewsCollector::class, config('toolbar.collectors'), true)) { |
| 147 | 147 | // Nettoyer nos noms de chemins pour les rendre un peu plus propres |
| 148 | 148 | $this->renderVars['file'] = clean_path($this->renderVars['file']); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $saveData ??= $this->saveData; |
| 179 | 179 | $this->prepareTemplateData($saveData); |
| 180 | 180 | |
| 181 | - $output = (function (string $view): string { |
|
| 181 | + $output = (function(string $view): string { |
|
| 182 | 182 | extract($this->tempData); |
| 183 | 183 | ob_start(); |
| 184 | 184 | eval('?>' . $view); |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | $section = array_pop($this->sectionStack); |
| 322 | 322 | |
| 323 | 323 | // Assurez-vous qu'un tableau existe afin que nous puissions stocker plusieurs entrées pour cela. |
| 324 | - if (! array_key_exists($section, $this->sections)) { |
|
| 324 | + if (!array_key_exists($section, $this->sections)) { |
|
| 325 | 325 | $this->sections[$section] = []; |
| 326 | 326 | } |
| 327 | 327 | |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | public function show(string $sectionName, bool $preserve = false) |
| 359 | 359 | { |
| 360 | - if (! isset($this->sections[$sectionName])) { |
|
| 360 | + if (!isset($this->sections[$sectionName])) { |
|
| 361 | 361 | echo ''; |
| 362 | 362 | |
| 363 | 363 | return; |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | * |
| 401 | 401 | * @alias self::insert() |
| 402 | 402 | */ |
| 403 | - public function include(string $view, ?array $data = [], ?array $options = null, ?bool $saveData = null): string |
|
| 403 | + public function include(string $view, ?array $data = [], ?array $options = null, ?bool $saveData = null) : string |
|
| 404 | 404 | { |
| 405 | 405 | return $this->insert($view, $data, $options, $saveData); |
| 406 | 406 | } |
@@ -629,11 +629,11 @@ discard block |
||
| 629 | 629 | */ |
| 630 | 630 | public function stylesBundle(): void |
| 631 | 631 | { |
| 632 | - if (! empty($this->_lib_styles)) { |
|
| 632 | + if (!empty($this->_lib_styles)) { |
|
| 633 | 633 | lib_styles(array_unique($this->_lib_styles)); |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | - if (! empty($this->_styles)) { |
|
| 636 | + if (!empty($this->_styles)) { |
|
| 637 | 637 | styles(array_unique($this->_styles)); |
| 638 | 638 | } |
| 639 | 639 | |
@@ -665,11 +665,11 @@ discard block |
||
| 665 | 665 | */ |
| 666 | 666 | public function scriptsBundle(): void |
| 667 | 667 | { |
| 668 | - if (! empty($this->_lib_scripts)) { |
|
| 668 | + if (!empty($this->_lib_scripts)) { |
|
| 669 | 669 | lib_scripts(array_unique($this->_lib_scripts)); |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | - if (! empty($this->_scripts)) { |
|
| 672 | + if (!empty($this->_scripts)) { |
|
| 673 | 673 | scripts(array_unique($this->_scripts)); |
| 674 | 674 | } |
| 675 | 675 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public static function makeUploadedFile(array $spec): UploadedFile |
| 65 | 65 | { |
| 66 | - if (! isset($spec['tmp_name']) || ! isset($spec['size']) || ! isset($spec['error'])) { |
|
| 66 | + if (!isset($spec['tmp_name']) || !isset($spec['size']) || !isset($spec['error'])) { |
|
| 67 | 67 | throw new InvalidArgumentException(sprintf( |
| 68 | 68 | '$spec fourni à %s DOIT contenir chacune des clés "tmp_name", "size", et "error" ; une ou plusieurs étaient manquantes', |
| 69 | 69 | __FUNCTION__ |
@@ -103,13 +103,13 @@ discard block |
||
| 103 | 103 | * |
| 104 | 104 | * @return array[]|UploadedFile[] |
| 105 | 105 | */ |
| 106 | - $recursiveNormalize = static function ( |
|
| 106 | + $recursiveNormalize = static function( |
|
| 107 | 107 | array $tmpNameTree, |
| 108 | 108 | array $sizeTree, |
| 109 | 109 | array $errorTree, |
| 110 | 110 | ?array $nameTree = null, |
| 111 | 111 | ?array $typeTree = null |
| 112 | - ) use (&$recursiveNormalize): array { |
|
| 112 | + ) use (&$recursiveNormalize) : array { |
|
| 113 | 113 | $normalized = []; |
| 114 | 114 | |
| 115 | 115 | foreach ($tmpNameTree as $key => $value) { |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | * |
| 148 | 148 | * @return UploadedFile[] |
| 149 | 149 | */ |
| 150 | - $normalizeUploadedFileSpecification = static function (array $files = []) use (&$recursiveNormalize): array { |
|
| 150 | + $normalizeUploadedFileSpecification = static function(array $files = []) use (&$recursiveNormalize): array { |
|
| 151 | 151 | if ( |
| 152 | - ! isset($files['tmp_name']) || ! is_array($files['tmp_name']) |
|
| 153 | - || ! isset($files['size']) || ! is_array($files['size']) |
|
| 154 | - || ! isset($files['error']) || ! is_array($files['error']) |
|
| 152 | + !isset($files['tmp_name']) || !is_array($files['tmp_name']) |
|
| 153 | + || !isset($files['size']) || !is_array($files['size']) |
|
| 154 | + || !isset($files['error']) || !is_array($files['error']) |
|
| 155 | 155 | ) { |
| 156 | 156 | throw new InvalidArgumentException(sprintf( |
| 157 | 157 | 'Les fichiers fournis à %s DOIVENT contenir chacune des clés "tmp_name", "size" et "error", |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $input = $this->all(); |
| 88 | 88 | |
| 89 | 89 | foreach ($keys as $value) { |
| 90 | - if (! Arr::has($input, $value)) { |
|
| 90 | + if (!Arr::has($input, $value)) { |
|
| 91 | 91 | return false; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $keys = is_array($key) ? $key : func_get_args(); |
| 150 | 150 | |
| 151 | 151 | foreach ($keys as $value) { |
| 152 | - if (! $this->isEmptyString($value)) { |
|
| 152 | + if (!$this->isEmptyString($value)) { |
|
| 153 | 153 | return false; |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | { |
| 199 | 199 | $keys = is_array($key) ? $key : func_get_args(); |
| 200 | 200 | |
| 201 | - return ! $this->has($keys); |
|
| 201 | + return !$this->has($keys); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | { |
| 227 | 227 | $value = $this->input($key); |
| 228 | 228 | |
| 229 | - return ! is_bool($value) && ! is_array($value) && trim((string) $value) === ''; |
|
| 229 | + return !is_bool($value) && !is_array($value) && trim((string) $value) === ''; |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | { |
| 247 | 247 | $input = array_replace_recursive($this->input(), $this->allFiles()); |
| 248 | 248 | |
| 249 | - if (! $keys) { |
|
| 249 | + if (!$keys) { |
|
| 250 | 250 | return $input; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -341,9 +341,9 @@ discard block |
||
| 341 | 341 | public function enum(string $key, $enumClass) |
| 342 | 342 | { |
| 343 | 343 | if ($this->isNotFilled($key) |
| 344 | - || ! function_exists('enum_exists') |
|
| 345 | - || ! enum_exists($enumClass) |
|
| 346 | - || ! method_exists($enumClass, 'tryFrom')) { |
|
| 344 | + || !function_exists('enum_exists') |
|
| 345 | + || !enum_exists($enumClass) |
|
| 346 | + || !method_exists($enumClass, 'tryFrom')) { |
|
| 347 | 347 | return null; |
| 348 | 348 | } |
| 349 | 349 | |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | */ |
| 458 | 458 | public function hasFile(string $key): bool |
| 459 | 459 | { |
| 460 | - if (! is_array($files = $this->file($key))) { |
|
| 460 | + if (!is_array($files = $this->file($key))) { |
|
| 461 | 461 | $files = [$files]; |
| 462 | 462 | } |
| 463 | 463 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $this->cookies = $config['cookies']; |
| 232 | 232 | |
| 233 | 233 | if (isset($config['uri'])) { |
| 234 | - if (! $config['uri'] instanceof UriInterface) { |
|
| 234 | + if (!$config['uri'] instanceof UriInterface) { |
|
| 235 | 235 | throw new FrameworkException('The `uri` key must be an instance of ' . UriInterface::class); |
| 236 | 236 | } |
| 237 | 237 | $uri = $config['uri']; |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $this->stream = $stream; |
| 267 | 267 | |
| 268 | 268 | $post = $config['post']; |
| 269 | - if (! (is_array($post) || is_object($post) || $post === null)) { |
|
| 269 | + if (!(is_array($post) || is_object($post) || $post === null)) { |
|
| 270 | 270 | throw new InvalidArgumentException(sprintf( |
| 271 | 271 | 'La clé `post` doit être un tableau, un objet ou null. On a obtenu `%s` à la place.', |
| 272 | 272 | get_debug_type($post) |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | $type = strtolower($type); |
| 452 | - if (! isset(static::$_detectors[$type])) { |
|
| 452 | + if (!isset(static::$_detectors[$type])) { |
|
| 453 | 453 | return false; |
| 454 | 454 | } |
| 455 | 455 | if ($args) { |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | public function isAll(array $types): bool |
| 602 | 602 | { |
| 603 | 603 | foreach ($types as $type) { |
| 604 | - if (! $this->is($type)) { |
|
| 604 | + if (!$this->is($type)) { |
|
| 605 | 605 | return false; |
| 606 | 606 | } |
| 607 | 607 | } |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | protected function normalizeHeaderName(string $name): string |
| 706 | 706 | { |
| 707 | 707 | $name = str_replace('-', '_', strtoupper($name)); |
| 708 | - if (! in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
| 708 | + if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
| 709 | 709 | $name = 'HTTP_' . $name; |
| 710 | 710 | } |
| 711 | 711 | |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | { |
| 892 | 892 | $new = clone $this; |
| 893 | 893 | |
| 894 | - if (! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) { |
|
| 894 | + if (!preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) { |
|
| 895 | 895 | throw new InvalidArgumentException(sprintf( |
| 896 | 896 | 'Méthode HTTP non prise en charge "%s" fournie', |
| 897 | 897 | $method |
@@ -1153,7 +1153,7 @@ discard block |
||
| 1153 | 1153 | } |
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | - if (! isset($accept[$prefValue])) { |
|
| 1156 | + if (!isset($accept[$prefValue])) { |
|
| 1157 | 1157 | $accept[$prefValue] = []; |
| 1158 | 1158 | } |
| 1159 | 1159 | if ($prefValue) { |
@@ -1231,7 +1231,7 @@ discard block |
||
| 1231 | 1231 | if ($name === null) { |
| 1232 | 1232 | return $this->data; |
| 1233 | 1233 | } |
| 1234 | - if (! is_array($this->data)) { |
|
| 1234 | + if (!is_array($this->data)) { |
|
| 1235 | 1235 | return $default; |
| 1236 | 1236 | } |
| 1237 | 1237 | |
@@ -1371,7 +1371,7 @@ discard block |
||
| 1371 | 1371 | */ |
| 1372 | 1372 | public function withProtocolVersion(string $version): static |
| 1373 | 1373 | { |
| 1374 | - if (! preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) { |
|
| 1374 | + if (!preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) { |
|
| 1375 | 1375 | throw new InvalidArgumentException(sprintf('Version de protocole `%s` non prise en charge fournie.', $version)); |
| 1376 | 1376 | } |
| 1377 | 1377 | $new = clone $this; |
@@ -1393,7 +1393,7 @@ discard block |
||
| 1393 | 1393 | public function getEnv(string $key, ?string $default = null): ?string |
| 1394 | 1394 | { |
| 1395 | 1395 | $key = strtoupper($key); |
| 1396 | - if (! array_key_exists($key, $this->_environment) || null === $this->_environment[$key]) { |
|
| 1396 | + if (!array_key_exists($key, $this->_environment) || null === $this->_environment[$key]) { |
|
| 1397 | 1397 | $this->_environment[$key] = env($key, $default); |
| 1398 | 1398 | } |
| 1399 | 1399 | |
@@ -1610,7 +1610,7 @@ discard block |
||
| 1610 | 1610 | $file = Arr::get($this->uploadedFiles, $path); |
| 1611 | 1611 | if (is_array($file)) { |
| 1612 | 1612 | foreach ($file as $f) { |
| 1613 | - if (! ($f instanceof UploadedFile)) { |
|
| 1613 | + if (!($f instanceof UploadedFile)) { |
|
| 1614 | 1614 | return null; |
| 1615 | 1615 | } |
| 1616 | 1616 | } |
@@ -1618,7 +1618,7 @@ discard block |
||
| 1618 | 1618 | return $file; |
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | - if (! ($file instanceof UploadedFileInterface)) { |
|
| 1621 | + if (!($file instanceof UploadedFileInterface)) { |
|
| 1622 | 1622 | return null; |
| 1623 | 1623 | } |
| 1624 | 1624 | |
@@ -1666,7 +1666,7 @@ discard block |
||
| 1666 | 1666 | continue; |
| 1667 | 1667 | } |
| 1668 | 1668 | |
| 1669 | - if (! $file instanceof UploadedFileInterface) { |
|
| 1669 | + if (!$file instanceof UploadedFileInterface) { |
|
| 1670 | 1670 | throw new InvalidArgumentException("Fichier invalide à `{$path}{$key}`"); |
| 1671 | 1671 | } |
| 1672 | 1672 | } |
@@ -1717,7 +1717,7 @@ discard block |
||
| 1717 | 1717 | } |
| 1718 | 1718 | |
| 1719 | 1719 | $host = $uri->getHost(); |
| 1720 | - if (! $host) { |
|
| 1720 | + if (!$host) { |
|
| 1721 | 1721 | return $new; |
| 1722 | 1722 | } |
| 1723 | 1723 | $port = $uri->getPort(); |
@@ -1825,7 +1825,7 @@ discard block |
||
| 1825 | 1825 | $validLocales = config('app.supported_locales'); |
| 1826 | 1826 | // S'il ne s'agit pas d'un paramètre régional valide, définissez-le |
| 1827 | 1827 | // aux paramètres régionaux par défaut du site. |
| 1828 | - if (! in_array($locale, $validLocales, true)) { |
|
| 1828 | + if (!in_array($locale, $validLocales, true)) { |
|
| 1829 | 1829 | $locale = config('app.language'); |
| 1830 | 1830 | } |
| 1831 | 1831 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $override = true; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if ($override && ! in_array($request->getMethod(), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
| 99 | + if ($override && !in_array($request->getMethod(), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
| 100 | 100 | $parsedBody = []; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $request = $request->withUploadedFiles($files); |
| 115 | 115 | |
| 116 | 116 | $parsedBody = $request->getParsedBody(); |
| 117 | - if (! is_array($parsedBody)) { |
|
| 117 | + if (!is_array($parsedBody)) { |
|
| 118 | 118 | return $request; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Si la valeur HTTP_AUTHORIZATION est déjà définie, ou si le callback n'est pas appelable, nous renvoyons les parameters server sans changements |
| 171 | - if (isset($server['HTTP_AUTHORIZATION']) || ! is_callable($apacheRequestHeaderCallback)) { |
|
| 171 | + if (isset($server['HTTP_AUTHORIZATION']) || !is_callable($apacheRequestHeaderCallback)) { |
|
| 172 | 172 | return $server; |
| 173 | 173 | } |
| 174 | 174 | |