@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | // ================================= ================================= // |
| 27 | 27 | |
| 28 | -if (! function_exists('site_url')) { |
|
| 28 | +if (!function_exists('site_url')) { |
|
| 29 | 29 | /** |
| 30 | 30 | * Renvoie une URL de site telle que définie par la configuration de l'application. |
| 31 | 31 | * |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | -if (! function_exists('base_url')) { |
|
| 52 | +if (!function_exists('base_url')) { |
|
| 53 | 53 | /** |
| 54 | 54 | * Renvoie l'URL de base telle que définie par la configuration de l'application. |
| 55 | 55 | * Les URL de base sont des URL de site coupées sans la page d'index. |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | -if (! function_exists('current_url')) { |
|
| 71 | +if (!function_exists('current_url')) { |
|
| 72 | 72 | /** |
| 73 | 73 | * Renvoie l'URL complète (y compris les segments) de la page où cette fonction est placée |
| 74 | 74 | * |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | -if (! function_exists('previous_url')) { |
|
| 98 | +if (!function_exists('previous_url')) { |
|
| 99 | 99 | /** |
| 100 | 100 | * Renvoie l'URL précédente sur laquelle se trouvait le visiteur actuel. Pour des raisons de sécurité |
| 101 | 101 | * nous vérifions d'abord une variable de session enregistrée, si elle existe, et l'utilisons. |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | -if (! function_exists('uri_string')) { |
|
| 118 | +if (!function_exists('uri_string')) { |
|
| 119 | 119 | /** |
| 120 | 120 | * Renvoie la partie chemin de l'URL actuelle |
| 121 | 121 | * |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | -if (! function_exists('index_page')) { |
|
| 132 | +if (!function_exists('index_page')) { |
|
| 133 | 133 | /** |
| 134 | 134 | * Renvoie la "index_page" de votre fichier de configuration |
| 135 | 135 | */ |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | -if (! function_exists('anchor')) { |
|
| 142 | +if (!function_exists('anchor')) { |
|
| 143 | 143 | /** |
| 144 | 144 | * Crée une ancre basée sur l'URL locale. |
| 145 | 145 | * |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | -if (! function_exists('anchor_popup')) { |
|
| 167 | +if (!function_exists('anchor_popup')) { |
|
| 168 | 168 | /** |
| 169 | 169 | * Lien d'ancrage - Version contextuelle |
| 170 | 170 | * |
@@ -187,12 +187,12 @@ discard block |
||
| 187 | 187 | return '<a href="' . $siteUrl . '" onclick="window.open(\'' . $siteUrl . "', '_blank'); return false;\">" . $title . '</a>'; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - if (! is_array($attributes)) { |
|
| 190 | + if (!is_array($attributes)) { |
|
| 191 | 191 | $attributes = [$attributes]; |
| 192 | 192 | |
| 193 | 193 | // Ref: http://www.w3schools.com/jsref/met_win_open.asp |
| 194 | 194 | $windowName = '_blank'; |
| 195 | - } elseif (! empty($attributes['window_name'])) { |
|
| 195 | + } elseif (!empty($attributes['window_name'])) { |
|
| 196 | 196 | $windowName = $attributes['window_name']; |
| 197 | 197 | unset($attributes['window_name']); |
| 198 | 198 | } else { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | -if (! function_exists('mailto')) { |
|
| 215 | +if (!function_exists('mailto')) { |
|
| 216 | 216 | /** |
| 217 | 217 | * Lien Mailto |
| 218 | 218 | * |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | -if (! function_exists('safe_mailto')) { |
|
| 232 | +if (!function_exists('safe_mailto')) { |
|
| 233 | 233 | /** |
| 234 | 234 | * Lien Mailto codé |
| 235 | 235 | * |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | -if (! function_exists('auto_link')) { |
|
| 323 | +if (!function_exists('auto_link')) { |
|
| 324 | 324 | /** |
| 325 | 325 | * Lien automatique |
| 326 | 326 | * |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | function auto_link(string $str, string $type = 'both', bool $popup = false): string |
| 336 | 336 | { |
| 337 | 337 | // Recherche et remplace tous les URLs. |
| 338 | - if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { |
|
| 338 | + if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE|PREG_SET_ORDER)) { |
|
| 339 | 339 | // Définissez notre HTML cible si vous utilisez des liens contextuels. |
| 340 | 340 | $target = ($popup) ? ' target="_blank"' : ''; |
| 341 | 341 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | -if (! function_exists('prep_url')) { |
|
| 369 | +if (!function_exists('prep_url')) { |
|
| 370 | 370 | /** |
| 371 | 371 | * Ajoute simplement la partie http:// ou https:// si aucun schéma n'est inclus. |
| 372 | 372 | * |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | -if (! function_exists('url_title')) { |
|
| 394 | +if (!function_exists('url_title')) { |
|
| 395 | 395 | /** |
| 396 | 396 | * Créer un titre d'URL |
| 397 | 397 | * |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | -if (! function_exists('mb_url_title')) { |
|
| 430 | +if (!function_exists('mb_url_title')) { |
|
| 431 | 431 | /** |
| 432 | 432 | * Créer un titre d'URL qui prend en compte les caractères accentués |
| 433 | 433 | * |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | -if (! function_exists('url_to')) { |
|
| 449 | +if (!function_exists('url_to')) { |
|
| 450 | 450 | /** |
| 451 | 451 | * Obtenir l'URL complète et absolue d'une méthode de contrôleur |
| 452 | 452 | * (avec arguments supplémentaires) |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | function url_to(string $controller, ...$args): string |
| 461 | 461 | { |
| 462 | - if (! $route = route($controller, ...$args)) { |
|
| 462 | + if (!$route = route($controller, ...$args)) { |
|
| 463 | 463 | $explode = explode('::', $controller); |
| 464 | 464 | |
| 465 | 465 | if (isset($explode[1])) { |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | -if (! function_exists('route')) { |
|
| 476 | +if (!function_exists('route')) { |
|
| 477 | 477 | /** |
| 478 | 478 | * Tente de rechercher une route en fonction de sa destination. |
| 479 | 479 | * |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | } |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | -if (! function_exists('url_is')) { |
|
| 488 | +if (!function_exists('url_is')) { |
|
| 489 | 489 | /** |
| 490 | 490 | * Détermine si le chemin d'URL actuel contient le chemin donné. |
| 491 | 491 | * Il peut contenir un caractère générique (*) qui autorisera tout caractère valide. |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | } |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | -if (! function_exists('link_active')) { |
|
| 506 | +if (!function_exists('link_active')) { |
|
| 507 | 507 | /** |
| 508 | 508 | * Lien actif dans la navbar |
| 509 | 509 | * Un peut comme le router-active-link de vuejs |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | return $active_class; |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | - if (! $exact && preg_match('#^' . $path . '/?#i', $current_section)) { |
|
| 530 | + if (!$exact && preg_match('#^' . $path . '/?#i', $current_section)) { |
|
| 531 | 531 | return $active_class; |
| 532 | 532 | } |
| 533 | 533 | |
@@ -539,14 +539,14 @@ discard block |
||
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | -if (! function_exists('clean_url')) { |
|
| 542 | +if (!function_exists('clean_url')) { |
|
| 543 | 543 | function clean_url(string $url): string |
| 544 | 544 | { |
| 545 | 545 | return Helpers::cleanUrl($url); |
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | -if (! function_exists('is_absolute_link')) { |
|
| 549 | +if (!function_exists('is_absolute_link')) { |
|
| 550 | 550 | /** |
| 551 | 551 | * Verifies si un chemin donnée est une url absolue ou relative |
| 552 | 552 | */ |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | $this->adapter->addData($data, $context); |
| 158 | 158 | |
| 159 | - if (! array_key_exists('errors', $this->getData())) { |
|
| 159 | + if (!array_key_exists('errors', $this->getData())) { |
|
| 160 | 160 | $this->setValidationErrors(); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | if (is_string($errors)) { |
| 186 | 186 | $errors = ['default' => $errors]; |
| 187 | 187 | } |
| 188 | - if (! ($errors instanceof ErrorBag)) { |
|
| 188 | + if (!($errors instanceof ErrorBag)) { |
|
| 189 | 189 | $errors = new ErrorBag($errors); |
| 190 | 190 | } |
| 191 | 191 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | $this->adapter->setData($data, $context); |
| 227 | 227 | |
| 228 | - if (! array_key_exists('errors', $this->getData())) { |
|
| 228 | + if (!array_key_exists('errors', $this->getData())) { |
|
| 229 | 229 | $this->setValidationErrors(); |
| 230 | 230 | } |
| 231 | 231 | |
@@ -265,10 +265,10 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | public function setAdapter(string $adapter, array $config = []): self |
| 267 | 267 | { |
| 268 | - if (! array_key_exists($adapter, self::$validAdapters)) { |
|
| 268 | + if (!array_key_exists($adapter, self::$validAdapters)) { |
|
| 269 | 269 | $adapter = 'native'; |
| 270 | 270 | } |
| 271 | - if (empty($this->config['adapters']) || ! is_array($this->config['adapters'])) { |
|
| 271 | + if (empty($this->config['adapters']) || !is_array($this->config['adapters'])) { |
|
| 272 | 272 | $this->config['adapters'] = []; |
| 273 | 273 | } |
| 274 | 274 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | protected function decorate(string $output): string |
| 326 | 326 | { |
| 327 | 327 | foreach ($this->config['decorators'] as $decorator) { |
| 328 | - if (! is_subclass_of($decorator, ViewDecoratorInterface::class)) { |
|
| 328 | + if (!is_subclass_of($decorator, ViewDecoratorInterface::class)) { |
|
| 329 | 329 | throw ViewException::invalidDecorator($decorator); |
| 330 | 330 | } |
| 331 | 331 | |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | class {class} extends {extends} |
| 8 | 8 | { |
| 9 | -<?php if (! empty($invokable)): ?> |
|
| 9 | +<?php if (!empty($invokable)): ?> |
|
| 10 | 10 | /** |
| 11 | 11 | * Traitement |
| 12 | 12 | * |
@@ -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); |
@@ -57,16 +57,16 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $viewer->setData($data)->setOptions($options); |
| 59 | 59 | |
| 60 | - if (! empty($this->layout) && is_string($this->layout)) { |
|
| 60 | + if (!empty($this->layout) && is_string($this->layout)) { |
|
| 61 | 61 | $viewer->setLayout($this->layout); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if (! empty($this->viewDatas) && is_array($this->viewDatas)) { |
|
| 64 | + if (!empty($this->viewDatas) && is_array($this->viewDatas)) { |
|
| 65 | 65 | $viewer->addData($this->viewDatas); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if (empty($data['title'])) { |
| 69 | - if (! is_string($controllerName = Dispatcher::getController(false))) { |
|
| 69 | + if (!is_string($controllerName = Dispatcher::getController(false))) { |
|
| 70 | 70 | $controllerName = static::class; |
| 71 | 71 | } |
| 72 | 72 | $controllerName = str_ireplace(['App\Controllers', 'Controller'], '', $controllerName); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $class = $this->translateURIDashes(ucfirst($segment)); |
| 134 | 134 | |
| 135 | 135 | // dès que nous rencontrons un segment qui n'est pas compatible PSR-4, arrêter la recherche |
| 136 | - if (! $this->isValidSegment($class)) { |
|
| 136 | + if (!$this->isValidSegment($class)) { |
|
| 137 | 137 | return false; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | throw new MethodNotFoundException(); |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | - if (! $refMethod->isPublic()) { |
|
| 344 | + if (!$refMethod->isPublic()) { |
|
| 345 | 345 | throw new MethodNotFoundException(); |
| 346 | 346 | } |
| 347 | 347 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | public function directory(): string |
| 456 | 456 | { |
| 457 | - return ! empty($this->directory) ? $this->directory : ''; |
|
| 457 | + return !empty($this->directory) ? $this->directory : ''; |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /** |
@@ -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->data($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->data(), $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 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function validation(array|string $rules, array $messages = []): Validation |
| 57 | 57 | { |
| 58 | 58 | if (is_string($rules)) { |
| 59 | - if (! class_exists($rules) || ! is_subclass_of($rules, DataValidation::class)) { |
|
| 59 | + if (!class_exists($rules) || !is_subclass_of($rules, DataValidation::class)) { |
|
| 60 | 60 | throw new InvalidArgumentException(); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function fullUrl(): string |
| 143 | 143 | { |
| 144 | - if (! empty($query = $this->getEnv('QUERY_STRING'))) { |
|
| 144 | + if (!empty($query = $this->getEnv('QUERY_STRING'))) { |
|
| 145 | 145 | return $this->url() . '?' . $query; |
| 146 | 146 | } |
| 147 | 147 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $this->cookies = $config['cookies']; |
| 235 | 235 | |
| 236 | 236 | if (isset($config['uri'])) { |
| 237 | - if (! $config['uri'] instanceof UriInterface) { |
|
| 237 | + if (!$config['uri'] instanceof UriInterface) { |
|
| 238 | 238 | throw new FrameworkException('The `uri` key must be an instance of ' . UriInterface::class); |
| 239 | 239 | } |
| 240 | 240 | $uri = $config['uri']; |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | $type = strtolower($type); |
| 440 | - if (! isset(static::$_detectors[$type])) { |
|
| 440 | + if (!isset(static::$_detectors[$type])) { |
|
| 441 | 441 | return false; |
| 442 | 442 | } |
| 443 | 443 | if ($args) { |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | public function isAll(array $types): bool |
| 590 | 590 | { |
| 591 | 591 | foreach ($types as $type) { |
| 592 | - if (! $this->is($type)) { |
|
| 592 | + if (!$this->is($type)) { |
|
| 593 | 593 | return false; |
| 594 | 594 | } |
| 595 | 595 | } |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | protected function normalizeHeaderName(string $name): string |
| 694 | 694 | { |
| 695 | 695 | $name = str_replace('-', '_', strtoupper($name)); |
| 696 | - if (! in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
| 696 | + if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
| 697 | 697 | $name = 'HTTP_' . $name; |
| 698 | 698 | } |
| 699 | 699 | |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | { |
| 872 | 872 | $new = clone $this; |
| 873 | 873 | |
| 874 | - if (! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) { |
|
| 874 | + if (!preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) { |
|
| 875 | 875 | throw new InvalidArgumentException(sprintf( |
| 876 | 876 | 'Méthode HTTP non prise en charge "%s" fournie', |
| 877 | 877 | $method |
@@ -1133,7 +1133,7 @@ discard block |
||
| 1133 | 1133 | } |
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | - if (! isset($accept[$prefValue])) { |
|
| 1136 | + if (!isset($accept[$prefValue])) { |
|
| 1137 | 1137 | $accept[$prefValue] = []; |
| 1138 | 1138 | } |
| 1139 | 1139 | if ($prefValue) { |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | if ($name === null) { |
| 1212 | 1212 | return $this->data; |
| 1213 | 1213 | } |
| 1214 | - if (! is_array($this->data)) { |
|
| 1214 | + if (!is_array($this->data)) { |
|
| 1215 | 1215 | return $default; |
| 1216 | 1216 | } |
| 1217 | 1217 | |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | */ |
| 1352 | 1352 | public function withProtocolVersion(string $version): static |
| 1353 | 1353 | { |
| 1354 | - if (! preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) { |
|
| 1354 | + if (!preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) { |
|
| 1355 | 1355 | throw new InvalidArgumentException(sprintf('Version de protocole `%s` non prise en charge fournie.', $version)); |
| 1356 | 1356 | } |
| 1357 | 1357 | $new = clone $this; |
@@ -1373,7 +1373,7 @@ discard block |
||
| 1373 | 1373 | public function getEnv(string $key, ?string $default = null): ?string |
| 1374 | 1374 | { |
| 1375 | 1375 | $key = strtoupper($key); |
| 1376 | - if (! array_key_exists($key, $this->_environment) || null === $this->_environment[$key]) { |
|
| 1376 | + if (!array_key_exists($key, $this->_environment) || null === $this->_environment[$key]) { |
|
| 1377 | 1377 | $this->_environment[$key] = env($key, $default); |
| 1378 | 1378 | } |
| 1379 | 1379 | |
@@ -1590,7 +1590,7 @@ discard block |
||
| 1590 | 1590 | $file = Arr::get($this->uploadedFiles, $path); |
| 1591 | 1591 | if (is_array($file)) { |
| 1592 | 1592 | foreach ($file as $f) { |
| 1593 | - if (! ($f instanceof UploadedFile)) { |
|
| 1593 | + if (!($f instanceof UploadedFile)) { |
|
| 1594 | 1594 | return null; |
| 1595 | 1595 | } |
| 1596 | 1596 | } |
@@ -1598,7 +1598,7 @@ discard block |
||
| 1598 | 1598 | return $file; |
| 1599 | 1599 | } |
| 1600 | 1600 | |
| 1601 | - if (! ($file instanceof UploadedFileInterface)) { |
|
| 1601 | + if (!($file instanceof UploadedFileInterface)) { |
|
| 1602 | 1602 | return null; |
| 1603 | 1603 | } |
| 1604 | 1604 | |
@@ -1646,7 +1646,7 @@ discard block |
||
| 1646 | 1646 | continue; |
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | - if (! $file instanceof UploadedFileInterface) { |
|
| 1649 | + if (!$file instanceof UploadedFileInterface) { |
|
| 1650 | 1650 | throw new InvalidArgumentException("Fichier invalide à '{$path}{$key}'"); |
| 1651 | 1651 | } |
| 1652 | 1652 | } |
@@ -1697,7 +1697,7 @@ discard block |
||
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | 1699 | $host = $uri->getHost(); |
| 1700 | - if (! $host) { |
|
| 1700 | + if (!$host) { |
|
| 1701 | 1701 | return $new; |
| 1702 | 1702 | } |
| 1703 | 1703 | $port = $uri->getPort(); |
@@ -1805,7 +1805,7 @@ discard block |
||
| 1805 | 1805 | $validLocales = config('app.supported_locales'); |
| 1806 | 1806 | // S'il ne s'agit pas d'un paramètre régional valide, définissez-le |
| 1807 | 1807 | // aux paramètres régionaux par défaut du site. |
| 1808 | - if (! in_array($locale, $validLocales, true)) { |
|
| 1808 | + if (!in_array($locale, $validLocales, true)) { |
|
| 1809 | 1809 | $locale = config('app.language'); |
| 1810 | 1810 | } |
| 1811 | 1811 | |
@@ -1905,7 +1905,7 @@ discard block |
||
| 1905 | 1905 | $override = true; |
| 1906 | 1906 | } |
| 1907 | 1907 | |
| 1908 | - if ($override && ! in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
| 1908 | + if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
| 1909 | 1909 | $data = []; |
| 1910 | 1910 | } |
| 1911 | 1911 | |
@@ -1955,7 +1955,7 @@ discard block |
||
| 1955 | 1955 | */ |
| 1956 | 1956 | protected function _processFiles(array $post, array $files): array |
| 1957 | 1957 | { |
| 1958 | - if (! is_array($files)) { |
|
| 1958 | + if (!is_array($files)) { |
|
| 1959 | 1959 | return $post; |
| 1960 | 1960 | } |
| 1961 | 1961 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $this->renderVars['file'] = $this->getRenderedFile($options, $this->renderVars['view'], 'tpl'); |
| 62 | 62 | |
| 63 | 63 | $layout = $this->layout; |
| 64 | - if (! empty($layout)) { |
|
| 64 | + if (!empty($layout)) { |
|
| 65 | 65 | if (empty(pathinfo($layout, PATHINFO_EXTENSION))) { |
| 66 | 66 | $layout .= '.tpl'; |
| 67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->engine->assign($this->data); |
| 72 | 72 | |
| 73 | 73 | // Doit-on mettre en cache? |
| 74 | - if (! empty($this->renderVars['options']['cache_name']) || ! empty($this->renderVars['options']['cache'])) { |
|
| 74 | + if (!empty($this->renderVars['options']['cache_name']) || !empty($this->renderVars['options']['cache'])) { |
|
| 75 | 75 | $this->enableCache(); |
| 76 | 76 | $this->engine->setCacheLifetime(60 * ($this->renderVars['options']['cache'] ?? 60)); |
| 77 | 77 | $this->engine->setCompileId($this->renderVars['options']['cache_name'] ?? null); |