@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // Toujours là ? Ensuite, nous pouvons essayer de faire correspondre l'URI avec |
| 189 | 189 | // Contrôleurs/répertoires, mais l'application peut ne pas |
| 190 | 190 | // vouloir ceci, comme dans le cas des API. |
| 191 | - if (! $this->collection->shouldAutoRoute()) { |
|
| 191 | + if (!$this->collection->shouldAutoRoute()) { |
|
| 192 | 192 | throw new PageNotFoundException("Impossible de trouver une route pour '{$this->collection->getHTTPVerb()}: {$uri}'."); |
| 193 | 193 | } |
| 194 | 194 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function controllerName() |
| 220 | 220 | { |
| 221 | - if (! is_string($this->controller)) { |
|
| 221 | + if (!is_string($this->controller)) { |
|
| 222 | 222 | return $this->controller; |
| 223 | 223 | } |
| 224 | 224 | |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | |
| 264 | 264 | return [ |
| 265 | 265 | $routeArray[0], // Controleur |
| 266 | - $routeArray[1] ?? 'index', // Methode |
|
| 266 | + $routeArray[1] ?? 'index', // Methode |
|
| 267 | 267 | ]; |
| 268 | 268 | } |
| 269 | 269 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | // Cette route est-elle censée rediriger vers une autre ? |
| 390 | 390 | if ($this->collection->isRedirect($routeKey)) { |
| 391 | 391 | // remplacement des groupes de routes correspondants par des références : post/([0-9]+) -> post/$1 |
| 392 | - $redirectTo = preg_replace_callback('/(\([^\(]+\))/', static function (): string { |
|
| 392 | + $redirectTo = preg_replace_callback('/(\([^\(]+\))/', static function(): string { |
|
| 393 | 393 | static $i = 1; |
| 394 | 394 | |
| 395 | 395 | return '$' . $i++; |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | ); |
| 410 | 410 | |
| 411 | 411 | if ($this->collection->shouldUseSupportedLocalesOnly() |
| 412 | - && ! in_array($matched['locale'], config('app.supported_locales'), true)) { |
|
| 412 | + && !in_array($matched['locale'], config('app.supported_locales'), true)) { |
|
| 413 | 413 | // Lancer une exception pour empêcher l'autorouteur, |
| 414 | 414 | // si activé, essayer de trouver une route |
| 415 | 415 | throw PageNotFoundException::localeNotSupported($matched['locale']); |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | |
| 422 | 422 | // Utilisons-nous Closures ? Si tel est le cas, nous devons collecter les paramètres dans un tableau |
| 423 | 423 | // afin qu'ils puissent être transmis ultérieurement à la méthode du contrôleur. |
| 424 | - if (! is_string($handler) && is_callable($handler)) { |
|
| 424 | + if (!is_string($handler) && is_callable($handler)) { |
|
| 425 | 425 | $this->controller = $handler; |
| 426 | 426 | |
| 427 | 427 | // Supprime la chaîne d'origine du tableau matches |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | |
| 499 | 499 | return preg_replace_callback( |
| 500 | 500 | $pattern, |
| 501 | - static function ($match) use ($matches) { |
|
| 501 | + static function($match) use ($matches) { |
|
| 502 | 502 | $index = (int) $match[1]; |
| 503 | 503 | |
| 504 | 504 | return $matches[$index] ?? ''; |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | |
| 539 | 539 | // $this->method contient déjà le nom de la méthode par défaut, |
| 540 | 540 | // donc ne l'écrasez pas avec le vide. |
| 541 | - if (! empty($method)) { |
|
| 541 | + if (!empty($method)) { |
|
| 542 | 542 | $this->setMethod($method); |
| 543 | 543 | } |
| 544 | 544 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // Sort to get the highest results first |
| 207 | - usort($results, static function ($a, $b): int { |
|
| 207 | + usort($results, static function($a, $b): int { |
|
| 208 | 208 | if ($a['q'] === $b['q']) { |
| 209 | 209 | $a_ast = substr_count($a['value'], '*'); |
| 210 | 210 | $b_ast = substr_count($b['value'], '*'); |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | foreach ($supported['params'] as $label => $value) { |
| 277 | - if (! isset($acceptable['params'][$label]) || $acceptable['params'][$label] !== $value) { |
|
| 277 | + if (!isset($acceptable['params'][$label]) || $acceptable['params'][$label] !== $value) { |
|
| 278 | 278 | return false; |
| 279 | 279 | } |
| 280 | 280 | } |
@@ -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 list<array>|list<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 list<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", |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | return $models; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - if (! self::isLoaded('models', $model)) { |
|
| 72 | + if (!self::isLoaded('models', $model)) { |
|
| 73 | 73 | self::loaded('models', $model, FileLocator::model($model, $connection)); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | private static function isLoaded(string $module, string $element): bool |
| 83 | 83 | { |
| 84 | - if (! isset(self::$loads[$module]) || ! is_array(self::$loads[$module])) { |
|
| 84 | + if (!isset(self::$loads[$module]) || !is_array(self::$loads[$module])) { |
|
| 85 | 85 | return false; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | foreach ($data as $key => $value) { |
| 74 | 74 | $replacementKey = "\n{$key} = {$value}"; |
| 75 | - if (! str_contains($oldFileContents, $key)) { |
|
| 75 | + if (!str_contains($oldFileContents, $key)) { |
|
| 76 | 76 | if (file_put_contents($this->path, $replacementKey, FILE_APPEND) === false) { |
| 77 | 77 | return false; |
| 78 | 78 | } |
@@ -139,18 +139,18 @@ discard block |
||
| 139 | 139 | public function parse(): ?array |
| 140 | 140 | { |
| 141 | 141 | // Nous ne voulons pas imposer la présence d'un fichier .env, ils devraient être facultatifs. |
| 142 | - if (! is_file($this->path)) { |
|
| 142 | + if (!is_file($this->path)) { |
|
| 143 | 143 | return null; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | // Assurez-vous que le fichier est lisible |
| 147 | - if (! is_readable($this->path)) { |
|
| 147 | + if (!is_readable($this->path)) { |
|
| 148 | 148 | throw new InvalidArgumentException("The .env file is not readable: {$this->path}"); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $vars = []; |
| 152 | 152 | |
| 153 | - $lines = file($this->path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
| 153 | + $lines = file($this->path, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES); |
|
| 154 | 154 | |
| 155 | 155 | foreach ($lines as $line) { |
| 156 | 156 | // C'est un commentaire? |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | protected function setVariable(string $name, string $value = '') |
| 177 | 177 | { |
| 178 | - if (! getenv($name, true)) { |
|
| 178 | + if (!getenv($name, true)) { |
|
| 179 | 179 | putenv("{$name}={$value}"); |
| 180 | 180 | } |
| 181 | 181 | if (empty($_ENV[$name])) { |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | |
| 281 | 281 | $value = preg_replace_callback( |
| 282 | 282 | '/\${([a-zA-Z0-9_]+)}/', |
| 283 | - static function ($matchedPatterns) use ($loader): string { |
|
| 283 | + static function($matchedPatterns) use ($loader): string { |
|
| 284 | 284 | $nestedVariable = $loader->getVariable($matchedPatterns[1]); |
| 285 | 285 | |
| 286 | 286 | if (null === $nestedVariable) { |
@@ -84,14 +84,14 @@ |
||
| 84 | 84 | $command = is_string($command) ? $command : 'command:name'; |
| 85 | 85 | $type = is_string($type) ? $type : 'basic'; |
| 86 | 86 | |
| 87 | - if (! in_array($type, ['basic', 'generator'], true)) { |
|
| 87 | + if (!in_array($type, ['basic', 'generator'], true)) { |
|
| 88 | 88 | // @codeCoverageIgnoreStart |
| 89 | 89 | $type = $this->choice(lang('CLI.generator.commandType'), ['basic', 'generator'], 'basic'); |
| 90 | 90 | $this->eol(); |
| 91 | 91 | // @codeCoverageIgnoreEnd |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if (! is_string($group)) { |
|
| 94 | + if (!is_string($group)) { |
|
| 95 | 95 | $group = $type === 'generator' ? config('app.name', 'App') . ':Generateurs' : config('app.name', 'App'); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | collect(static::$data) |
| 80 | 80 | ->map( |
| 81 | 81 | static fn ($items) => collect($items) |
| 82 | - ->map(static function ($value) { |
|
| 82 | + ->map(static function($value) { |
|
| 83 | 83 | if (is_array($value)) { |
| 84 | 84 | return [$value]; |
| 85 | 85 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | ->all(); |
| 95 | 95 | })->flatten(1) |
| 96 | 96 | ) |
| 97 | - ->sortBy(static function ($data, $key): int { |
|
| 97 | + ->sortBy(static function($data, $key): int { |
|
| 98 | 98 | $index = array_search($key, ['Environnement', 'Cache', 'Gestionnaires'], true); |
| 99 | 99 | |
| 100 | 100 | return $index === false ? 99 : $index; |
@@ -118,14 +118,14 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | protected function displayDetail(Collection $data): void |
| 120 | 120 | { |
| 121 | - $data->each(function ($data, $section): void { |
|
| 121 | + $data->each(function($data, $section): void { |
|
| 122 | 122 | $this->newLine(); |
| 123 | 123 | |
| 124 | 124 | $this->justify($section, '', ['first' => ['fg' => Color::GREEN]]); |
| 125 | 125 | |
| 126 | - $data->pipe(static fn ($data) => $section !== 'Environnement' ? $data->sort() : $data)->each(function ($detail): void { |
|
| 126 | + $data->pipe(static fn ($data) => $section !== 'Environnement' ? $data->sort() : $data)->each(function($detail): void { |
|
| 127 | 127 | [$label, $value] = $detail; |
| 128 | - if (! in_array($label, static::$displayed, true)) { |
|
| 128 | + if (!in_array($label, static::$displayed, true)) { |
|
| 129 | 129 | $this->justify($label, value($value, false)); |
| 130 | 130 | static::$displayed[] = $label; |
| 131 | 131 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | static::addToSection('Gestionnaires', static fn () => array_filter([ |
| 181 | 181 | 'Cache' => config('cache.handler'), |
| 182 | - 'Logs' => static function ($json): string { |
|
| 182 | + 'Logs' => static function($json): string { |
|
| 183 | 183 | $handlers = []; |
| 184 | 184 | |
| 185 | 185 | foreach (config('log.handlers') as $k => $v) { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | public static function format(mixed $value, ?Closure $console = null, ?Closure $json = null) |
| 254 | 254 | { |
| 255 | - return static function ($isJson) use ($value, $console, $json) { |
|
| 255 | + return static function($isJson) use ($value, $console, $json) { |
|
| 256 | 256 | if ($isJson === true && $json instanceof Closure) { |
| 257 | 257 | return value($json, $value); |
| 258 | 258 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | // Incluez le fichier routesFile s'il n'existe pas. |
| 258 | 258 | // Ne conserver que pour les fins BC pour l'instant. |
| 259 | 259 | $routeFiles = $this->routeFiles; |
| 260 | - if (! in_array($routesFile, $routeFiles, true)) { |
|
| 260 | + if (!in_array($routesFile, $routeFiles, true)) { |
|
| 261 | 261 | $routeFiles[] = $routesFile; |
| 262 | 262 | } |
| 263 | 263 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $routes = $this; |
| 266 | 266 | |
| 267 | 267 | foreach ($routeFiles as $routesFile) { |
| 268 | - if (! is_file($routesFile)) { |
|
| 268 | + if (!is_file($routesFile)) { |
|
| 269 | 269 | logger()->warning(sprintf('Fichier de route introuvable : "%s"', $routesFile)); |
| 270 | 270 | |
| 271 | 271 | continue; |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | */ |
| 315 | 315 | public function placeholder(array|string $placeholder, ?string $pattern = null): self |
| 316 | 316 | { |
| 317 | - if (! is_array($placeholder)) { |
|
| 317 | + if (!is_array($placeholder)) { |
|
| 318 | 318 | $placeholder = [$placeholder => $pattern]; |
| 319 | 319 | } |
| 320 | 320 | |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | * |
| 1027 | 1027 | * @param array|(Closure(mixed...): (ResponseInterface|string|void))|string $to |
| 1028 | 1028 | */ |
| 1029 | - public function match(array $verbs = [], string $from = '', $to = '', ?array $options = null): self |
|
| 1029 | + public function match(array $verbs = [], string $from = '', $to = '', ?array $options = null) : self |
|
| 1030 | 1030 | { |
| 1031 | 1031 | if ($from === '' || empty($to)) { |
| 1032 | 1032 | throw new InvalidArgumentException('Vous devez fournir les paramètres : $from, $to.'); |
@@ -1211,8 +1211,8 @@ discard block |
||
| 1211 | 1211 | // Ajoutez l'espace de noms par défaut si nécessaire. |
| 1212 | 1212 | $namespace = trim($this->defaultNamespace, '\\') . '\\'; |
| 1213 | 1213 | if ( |
| 1214 | - ! str_starts_with($search, '\\') |
|
| 1215 | - && ! str_starts_with($search, $namespace) |
|
| 1214 | + !str_starts_with($search, '\\') |
|
| 1215 | + && !str_starts_with($search, $namespace) |
|
| 1216 | 1216 | ) { |
| 1217 | 1217 | $search = $namespace . $search; |
| 1218 | 1218 | } |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | $from = $route['from']; |
| 1226 | 1226 | |
| 1227 | 1227 | // on ignore les closures |
| 1228 | - if (! is_string($to)) { |
|
| 1228 | + if (!is_string($to)) { |
|
| 1229 | 1229 | continue; |
| 1230 | 1230 | } |
| 1231 | 1231 | |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | |
| 1237 | 1237 | // S'il y a une chance de correspondance, alors ce sera |
| 1238 | 1238 | // soit avec $search au début de la chaîne $to. |
| 1239 | - if (! str_starts_with($to, $search)) { |
|
| 1239 | + if (!str_starts_with($to, $search)) { |
|
| 1240 | 1240 | continue; |
| 1241 | 1241 | } |
| 1242 | 1242 | |
@@ -1316,7 +1316,7 @@ discard block |
||
| 1316 | 1316 | |
| 1317 | 1317 | // Construisez notre chaîne résultante, en insérant les $params aux endroits appropriés. |
| 1318 | 1318 | foreach ($matches[0] as $index => $placeholder) { |
| 1319 | - if (! isset($params[$index])) { |
|
| 1319 | + if (!isset($params[$index])) { |
|
| 1320 | 1320 | throw new InvalidArgumentException( |
| 1321 | 1321 | 'Argument manquant pour "' . $placeholder . '" dans la route "' . $from . '".' |
| 1322 | 1322 | ); |
@@ -1327,7 +1327,7 @@ discard block |
||
| 1327 | 1327 | // ou peut-être que $placeholder n'est pas un espace réservé, mais une regex. |
| 1328 | 1328 | $pattern = $this->placeholders[$placeholderName] ?? $placeholder; |
| 1329 | 1329 | |
| 1330 | - if (! preg_match('#^' . $pattern . '$#u', (string) $params[$index])) { |
|
| 1330 | + if (!preg_match('#^' . $pattern . '$#u', (string) $params[$index])) { |
|
| 1331 | 1331 | throw RouterException::invalidParameterType(); |
| 1332 | 1332 | } |
| 1333 | 1333 | |
@@ -1388,7 +1388,7 @@ discard block |
||
| 1388 | 1388 | $from = trim($from, '/'); |
| 1389 | 1389 | } |
| 1390 | 1390 | |
| 1391 | - if (is_string($to) && ! str_contains($to, '::') && class_exists($to) && method_exists($to, '__invoke')) { |
|
| 1391 | + if (is_string($to) && !str_contains($to, '::') && class_exists($to) && method_exists($to, '__invoke')) { |
|
| 1392 | 1392 | $to = [$to, '__invoke']; |
| 1393 | 1393 | } |
| 1394 | 1394 | |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | if (isset($options['middleware'])) { |
| 1403 | 1403 | $options['middleware'] = (array) $options['middleware']; |
| 1404 | 1404 | |
| 1405 | - if (! isset($options['middlewares'])) { |
|
| 1405 | + if (!isset($options['middlewares'])) { |
|
| 1406 | 1406 | $options['middlewares'] = $options['middleware']; |
| 1407 | 1407 | } else { |
| 1408 | 1408 | $options['middlewares'] = array_merge($options['middlewares'], $options['middleware']); |
@@ -1430,9 +1430,9 @@ discard block |
||
| 1430 | 1430 | } |
| 1431 | 1431 | |
| 1432 | 1432 | // Limitation du nom d'hôte ? |
| 1433 | - if (! empty($options['hostname'])) { |
|
| 1433 | + if (!empty($options['hostname'])) { |
|
| 1434 | 1434 | // @todo déterminer s'il existe un moyen de mettre les hôtes sur liste blanche ? |
| 1435 | - if (! $this->checkHostname($options['hostname'])) { |
|
| 1435 | + if (!$this->checkHostname($options['hostname'])) { |
|
| 1436 | 1436 | return; |
| 1437 | 1437 | } |
| 1438 | 1438 | |
@@ -1440,10 +1440,10 @@ discard block |
||
| 1440 | 1440 | } |
| 1441 | 1441 | |
| 1442 | 1442 | // Limitation du nom sous-domaine ? |
| 1443 | - elseif (! empty($options['subdomain'])) { |
|
| 1443 | + elseif (!empty($options['subdomain'])) { |
|
| 1444 | 1444 | // Si nous ne correspondons pas au sous-domaine actuel, alors |
| 1445 | 1445 | // nous n'avons pas besoin d'ajouter la route. |
| 1446 | - if (! $this->checkSubdomains($options['subdomain'])) { |
|
| 1446 | + if (!$this->checkSubdomains($options['subdomain'])) { |
|
| 1447 | 1447 | return; |
| 1448 | 1448 | } |
| 1449 | 1449 | |
@@ -1476,9 +1476,9 @@ discard block |
||
| 1476 | 1476 | } |
| 1477 | 1477 | |
| 1478 | 1478 | // S'il s'agit d'une redirection, aucun traitement |
| 1479 | - if (! isset($options['redirect']) && is_string($to)) { |
|
| 1479 | + if (!isset($options['redirect']) && is_string($to)) { |
|
| 1480 | 1480 | // Si aucun espace de noms n'est trouvé, ajouter l'espace de noms par défaut |
| 1481 | - if (! str_contains($to, '\\') || strpos($to, '\\') > 0) { |
|
| 1481 | + if (!str_contains($to, '\\') || strpos($to, '\\') > 0) { |
|
| 1482 | 1482 | $namespace = $options['namespace'] ?? $this->defaultNamespace; |
| 1483 | 1483 | $to = trim($namespace, '\\') . '\\' . $to; |
| 1484 | 1484 | } |
@@ -1495,7 +1495,7 @@ discard block |
||
| 1495 | 1495 | // cela ne fonctionne que parce que les routes découvertes sont ajoutées juste avant |
| 1496 | 1496 | // pour tenter de router la requête. |
| 1497 | 1497 | $routeKeyExists = isset($this->routes[$verb][$routeKey]); |
| 1498 | - if ((isset($this->routesNames[$verb][$name]) || $routeKeyExists) && ! $overwrite) { |
|
| 1498 | + if ((isset($this->routesNames[$verb][$name]) || $routeKeyExists) && !$overwrite) { |
|
| 1499 | 1499 | return; |
| 1500 | 1500 | } |
| 1501 | 1501 | |
@@ -1521,7 +1521,7 @@ discard block |
||
| 1521 | 1521 | private function checkHostname(array|string $hostname): bool |
| 1522 | 1522 | { |
| 1523 | 1523 | // Les appels CLI ne peuvent pas être sur le nom d'hôte. |
| 1524 | - if (! isset($this->httpHost)) { |
|
| 1524 | + if (!isset($this->httpHost)) { |
|
| 1525 | 1525 | return false; |
| 1526 | 1526 | } |
| 1527 | 1527 | |
@@ -1544,7 +1544,7 @@ discard block |
||
| 1544 | 1544 | private function checkSubdomains($subdomains): bool |
| 1545 | 1545 | { |
| 1546 | 1546 | // Les appels CLI ne peuvent pas être sur le sous-domaine. |
| 1547 | - if (! isset($this->httpHost)) { |
|
| 1547 | + if (!isset($this->httpHost)) { |
|
| 1548 | 1548 | return false; |
| 1549 | 1549 | } |
| 1550 | 1550 | |
@@ -1552,13 +1552,13 @@ discard block |
||
| 1552 | 1552 | $this->currentSubdomain = $this->determineCurrentSubdomain(); |
| 1553 | 1553 | } |
| 1554 | 1554 | |
| 1555 | - if (! is_array($subdomains)) { |
|
| 1555 | + if (!is_array($subdomains)) { |
|
| 1556 | 1556 | $subdomains = [$subdomains]; |
| 1557 | 1557 | } |
| 1558 | 1558 | |
| 1559 | 1559 | // Les routes peuvent être limitées à n'importe quel sous-domaine. Dans ce cas, cependant, |
| 1560 | 1560 | // il nécessite la présence d'un sous-domaine. |
| 1561 | - if (! empty($this->currentSubdomain) && in_array('*', $subdomains, true)) { |
|
| 1561 | + if (!empty($this->currentSubdomain) && in_array('*', $subdomains, true)) { |
|
| 1562 | 1562 | return true; |
| 1563 | 1563 | } |
| 1564 | 1564 | |
@@ -1580,7 +1580,7 @@ discard block |
||
| 1580 | 1580 | // sur l'URL sinon parse_url sera mal interprété |
| 1581 | 1581 | // 'hôte' comme 'chemin'. |
| 1582 | 1582 | $url = $this->httpHost; |
| 1583 | - if (! str_starts_with($url, 'http')) { |
|
| 1583 | + if (!str_starts_with($url, 'http')) { |
|
| 1584 | 1584 | $url = 'http://' . $url; |
| 1585 | 1585 | } |
| 1586 | 1586 | |
@@ -1624,7 +1624,7 @@ discard block |
||
| 1624 | 1624 | */ |
| 1625 | 1625 | private function getControllerName(Closure|string $handler): ?string |
| 1626 | 1626 | { |
| 1627 | - if (! is_string($handler)) { |
|
| 1627 | + if (!is_string($handler)) { |
|
| 1628 | 1628 | return null; |
| 1629 | 1629 | } |
| 1630 | 1630 | |
@@ -1683,12 +1683,12 @@ discard block |
||
| 1683 | 1683 | */ |
| 1684 | 1684 | private function replaceLocale(string $route, ?string $locale = null): string |
| 1685 | 1685 | { |
| 1686 | - if (! str_contains($route, '{locale}')) { |
|
| 1686 | + if (!str_contains($route, '{locale}')) { |
|
| 1687 | 1687 | return $route; |
| 1688 | 1688 | } |
| 1689 | 1689 | |
| 1690 | 1690 | // Vérifier les paramètres régionaux non valides |
| 1691 | - if ($locale !== null && ! in_array($locale, config('app.supported_locales'), true)) { |
|
| 1691 | + if ($locale !== null && !in_array($locale, config('app.supported_locales'), true)) { |
|
| 1692 | 1692 | $locale = null; |
| 1693 | 1693 | } |
| 1694 | 1694 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | public function send(Mail $mail): bool |
| 194 | 194 | { |
| 195 | 195 | foreach ($this->bcc() as $key => $value) { |
| 196 | - if (empty($value) || ! is_string($value)) { |
|
| 196 | + if (empty($value) || !is_string($value)) { |
|
| 197 | 197 | continue; |
| 198 | 198 | } |
| 199 | 199 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | foreach ($this->cc() as $key => $value) { |
| 208 | - if (empty($value) || ! is_string($value)) { |
|
| 208 | + if (empty($value) || !is_string($value)) { |
|
| 209 | 209 | continue; |
| 210 | 210 | } |
| 211 | 211 | |
@@ -218,12 +218,12 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | $content = $this->content(); |
| 220 | 220 | |
| 221 | - if (! empty($content['view'])) { |
|
| 221 | + if (!empty($content['view'])) { |
|
| 222 | 222 | $mail->view($content['view'], $this->data()); |
| 223 | - } elseif (! empty($content['html'])) { |
|
| 223 | + } elseif (!empty($content['html'])) { |
|
| 224 | 224 | $mail->html($content['html']); |
| 225 | 225 | } |
| 226 | - if (! empty($content['text'])) { |
|
| 226 | + if (!empty($content['text'])) { |
|
| 227 | 227 | $mail->text($content['text']); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $mail->priority($this->priority()); |
| 233 | 233 | |
| 234 | 234 | foreach ($this->replyTo() as $key => $value) { |
| 235 | - if (empty($value) || ! is_string($value)) { |
|
| 235 | + if (empty($value) || !is_string($value)) { |
|
| 236 | 236 | continue; |
| 237 | 237 | } |
| 238 | 238 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $mail->subject($this->subject()); |
| 247 | 247 | |
| 248 | 248 | foreach ($this->to() as $key => $value) { |
| 249 | - if (empty($value) || ! is_string($value)) { |
|
| 249 | + if (empty($value) || !is_string($value)) { |
|
| 250 | 250 | continue; |
| 251 | 251 | } |
| 252 | 252 | |