@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | $file = $this->viewPath . $view; |
98 | 98 | |
99 | - if (! is_file($file)) { |
|
99 | + if (!is_file($file)) { |
|
100 | 100 | $fileOrig = $file; |
101 | 101 | $file = ($this->locator ?: service('locator'))->locateFile($view, 'Views'); |
102 | 102 | |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | foreach ($matches as $match) { |
300 | 300 | // Loop over each piece of $data, replacing |
301 | 301 | // its contents so that we know what to replace in parse() |
302 | - $str = ''; // holds the new contents for this tag pair. |
|
302 | + $str = ''; // holds the new contents for this tag pair. |
|
303 | 303 | |
304 | 304 | foreach ($data as $row) { |
305 | 305 | // Objects that have a `toArray()` method should be |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | |
342 | 342 | // Now replace our placeholders with the new content. |
343 | 343 | foreach ($temp as $pattern => $content) { |
344 | - $out = $this->replaceSingle($pattern, $content, $out, ! isset($pairs[$pattern])); |
|
344 | + $out = $this->replaceSingle($pattern, $content, $out, !isset($pairs[$pattern])); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | $str .= $out; |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | protected function replaceSingle(array|string $pattern, string $content, string $template, bool $escape = false): string |
500 | 500 | { |
501 | 501 | // Replace the content in the template |
502 | - return preg_replace_callback($pattern, function ($matches) use ($content, $escape): string { |
|
502 | + return preg_replace_callback($pattern, function($matches) use ($content, $escape): string { |
|
503 | 503 | // Check for {! !} syntax to not escape this one. |
504 | 504 | if ( |
505 | 505 | str_starts_with($matches[0], $this->leftDelimiter . '!') |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | |
522 | 522 | // Our regex earlier will leave all chained values on a single line |
523 | 523 | // so we need to break them apart so we can apply them all. |
524 | - $filters = ! empty($matches[1]) ? explode('|', $matches[1]) : []; |
|
524 | + $filters = !empty($matches[1]) ? explode('|', $matches[1]) : []; |
|
525 | 525 | |
526 | 526 | if ($escape && $filters === [] && ($context = $this->shouldAddEscaping($orig))) { |
527 | 527 | $filters[] = "esc({$context})"; |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | } |
550 | 550 | } |
551 | 551 | // No pipes, then we know we need to escape |
552 | - elseif (! str_contains($key, '|')) { |
|
552 | + elseif (!str_contains($key, '|')) { |
|
553 | 553 | $escape = 'html'; |
554 | 554 | } |
555 | 555 | // If there's a `noescape` then we're definitely false. |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $escape = false; |
558 | 558 | } |
559 | 559 | // If no `esc` filter is found, then we'll need to add one. |
560 | - elseif (! preg_match('/\s+esc/u', $key)) { |
|
560 | + elseif (!preg_match('/\s+esc/u', $key)) { |
|
561 | 561 | $escape = 'html'; |
562 | 562 | } |
563 | 563 | |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | $filter = $param !== [] ? trim(strtolower(substr($filter, 0, strpos($filter, '(')))) : trim($filter); |
595 | 595 | |
596 | 596 | $this->config['filters'] ??= []; |
597 | - if (! array_key_exists($filter, $this->config['filters'])) { |
|
597 | + if (!array_key_exists($filter, $this->config['filters'])) { |
|
598 | 598 | continue; |
599 | 599 | } |
600 | 600 | |
@@ -631,7 +631,7 @@ discard block |
||
631 | 631 | * $matches[1] = all parameters string in opening tag |
632 | 632 | * $matches[2] = content between the tags to send to the plugin. |
633 | 633 | */ |
634 | - if (! preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) { |
|
634 | + if (!preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) { |
|
635 | 635 | continue; |
636 | 636 | } |
637 | 637 |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | helper('assets'); |
79 | 79 | |
80 | - if (! empty($viewPathLocator)) { |
|
80 | + if (!empty($viewPathLocator)) { |
|
81 | 81 | if (is_string($viewPathLocator)) { |
82 | 82 | $this->viewPath = rtrim($viewPathLocator, '\\/ ') . DS; |
83 | 83 | } elseif ($viewPathLocator instanceof LocatorInterface) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - if (! $this->locator instanceof LocatorInterface && ! is_dir($this->viewPath)) { |
|
88 | + if (!$this->locator instanceof LocatorInterface && !is_dir($this->viewPath)) { |
|
89 | 89 | $this->viewPath = ''; |
90 | 90 | $this->locator = service('locator'); |
91 | 91 | } |
@@ -260,18 +260,18 @@ discard block |
||
260 | 260 | $ext ??= $this->ext; |
261 | 261 | |
262 | 262 | $viewPath = $options['viewPath'] ?? $this->viewPath; |
263 | - $file = ! empty($viewPath) ? str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')) : $view; |
|
263 | + $file = !empty($viewPath) ? str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')) : $view; |
|
264 | 264 | |
265 | 265 | $file = Helpers::ensureExt($file, $ext); |
266 | 266 | |
267 | - if (! is_file($file) && $this->locator instanceof LocatorInterface) { |
|
267 | + if (!is_file($file) && $this->locator instanceof LocatorInterface) { |
|
268 | 268 | $file = $this->locator->locateFile($view, 'Views', $ext); |
269 | 269 | } |
270 | 270 | |
271 | 271 | $file = realpath($file); |
272 | 272 | |
273 | 273 | // locateFile renverra une chaîne vide si le fichier est introuvable. |
274 | - if (! is_file($file)) { |
|
274 | + if (!is_file($file)) { |
|
275 | 275 | throw ViewException::invalidFile($view); |
276 | 276 | } |
277 | 277 |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $controller = $routes->getDefaultController(); |
176 | 176 | } |
177 | 177 | |
178 | - if (! $fullName && is_string($controller)) { |
|
178 | + if (!$fullName && is_string($controller)) { |
|
179 | 179 | $controller = str_replace($routes->getDefaultNamespace(), '', $controller); |
180 | 180 | } |
181 | 181 | |
@@ -298,14 +298,14 @@ discard block |
||
298 | 298 | return; |
299 | 299 | } |
300 | 300 | |
301 | - if (is_cli() && ! on_test()) { |
|
301 | + if (is_cli() && !on_test()) { |
|
302 | 302 | // @codeCoverageIgnoreStart |
303 | 303 | // $this->request = Services::clirequest($this->config); |
304 | 304 | // @codeCoverageIgnoreEnd |
305 | 305 | } |
306 | 306 | |
307 | 307 | $version = $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1'; |
308 | - if (! is_numeric($version)) { |
|
308 | + if (!is_numeric($version)) { |
|
309 | 309 | $version = substr($version, strpos($version, '/') + 1); |
310 | 310 | } |
311 | 311 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | // Supposons le succès jusqu'à preuve du contraire. |
325 | 325 | $this->response = service('response')->withStatus(200); |
326 | 326 | |
327 | - if (! is_cli() || on_test()) { |
|
327 | + if (!is_cli() || on_test()) { |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | $this->response = $this->response->withProtocolVersion($this->request->getProtocolVersion()); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | } |
409 | 409 | |
410 | 410 | // Essayez de charger automatiquement la classe |
411 | - if (! class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) { |
|
411 | + if (!class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) { |
|
412 | 412 | throw PageNotFoundException::controllerNotFound($this->controller, $this->method); |
413 | 413 | } |
414 | 414 | |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | |
500 | 500 | $this->outputBufferingEnd(); |
501 | 501 | |
502 | - throw PageNotFoundException::pageNotFound(! on_prod() || is_cli() ? $e->getMessage() : ''); |
|
502 | + throw PageNotFoundException::pageNotFound(!on_prod() || is_cli() ? $e->getMessage() : ''); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | /** |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | public function storePreviousURL($uri) |
542 | 542 | { |
543 | 543 | // Ignorer les requêtes CLI |
544 | - if (is_cli() && ! on_test()) { |
|
544 | + if (is_cli() && !on_test()) { |
|
545 | 545 | return; // @codeCoverageIgnore |
546 | 546 | } |
547 | 547 | |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | } |
552 | 552 | |
553 | 553 | // Ignorer les reponses non-HTML |
554 | - if (! str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) { |
|
554 | + if (!str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) { |
|
555 | 555 | return; |
556 | 556 | } |
557 | 557 | |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | */ |
576 | 576 | protected function sendResponse() |
577 | 577 | { |
578 | - if (! $this->isAjaxRequest()) { |
|
578 | + if (!$this->isAjaxRequest()) { |
|
579 | 579 | $this->response = service('toolbar')->prepare( |
580 | 580 | $this->getPerformanceStats(), |
581 | 581 | $this->request, |
@@ -672,12 +672,12 @@ discard block |
||
672 | 672 | */ |
673 | 673 | private function spoofRequestMethod(): callable |
674 | 674 | { |
675 | - return static function (ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
675 | + return static function(ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
676 | 676 | $post = $request->getParsedBody(); |
677 | 677 | |
678 | 678 | // Ne fonctionne qu'avec les formulaires POST |
679 | 679 | // Accepte seulement PUT, PATCH, DELETE |
680 | - if ($request->getMethod() === Method::POST && ! empty($post['_method']) && in_array($post['_method'], [Method::PUT, Method::PATCH, Method::DELETE], true)) { |
|
680 | + if ($request->getMethod() === Method::POST && !empty($post['_method']) && in_array($post['_method'], [Method::PUT, Method::PATCH, Method::DELETE], true)) { |
|
681 | 681 | $request = $request->withMethod($post['_method']); |
682 | 682 | } |
683 | 683 | |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | |
688 | 688 | private function bootApp(): callable |
689 | 689 | { |
690 | - return function (ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { |
|
690 | + return function(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { |
|
691 | 691 | Services::set(Request::class, $request); |
692 | 692 | Services::set(Response::class, $response); |
693 | 693 | |
@@ -695,10 +695,10 @@ discard block |
||
695 | 695 | $returned = $this->startController(); |
696 | 696 | |
697 | 697 | // Les controleur sous forme de Closure sont executes dans startController(). |
698 | - if (! is_callable($this->controller)) { |
|
698 | + if (!is_callable($this->controller)) { |
|
699 | 699 | $controller = $this->createController($request, $response); |
700 | 700 | |
701 | - if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) { |
|
701 | + if (!method_exists($controller, '_remap') && !is_callable([$controller, $this->method], false)) { |
|
702 | 702 | throw PageNotFoundException::methodNotFound($this->method); |
703 | 703 | } |
704 | 704 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | * the LICENSE file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -if (! function_exists('directory_map')) { |
|
12 | +if (!function_exists('directory_map')) { |
|
13 | 13 | /** |
14 | 14 | * Créer une carte de répertoire |
15 | 15 | * |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | -if (! function_exists('directory_mirror')) { |
|
59 | +if (!function_exists('directory_mirror')) { |
|
60 | 60 | /** |
61 | 61 | * Copie récursivement les fichiers et répertoires du répertoire d'origine |
62 | 62 | * dans le répertoire cible, c'est-à-dire "miroir" son contenu. |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | -if (! function_exists('write_file')) { |
|
72 | +if (!function_exists('write_file')) { |
|
73 | 73 | /** |
74 | 74 | * Write File |
75 | 75 | * |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
106 | -if (! function_exists('delete_files')) { |
|
106 | +if (!function_exists('delete_files')) { |
|
107 | 107 | /** |
108 | 108 | * Delete Files |
109 | 109 | * |
@@ -128,18 +128,18 @@ discard block |
||
128 | 128 | RecursiveIteratorIterator::CHILD_FIRST |
129 | 129 | ) as $object) { |
130 | 130 | $filename = $object->getFilename(); |
131 | - if (! $hidden && $filename[0] === '.') { |
|
131 | + if (!$hidden && $filename[0] === '.') { |
|
132 | 132 | continue; |
133 | 133 | } |
134 | 134 | |
135 | - if (! $htdocs || ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { |
|
135 | + if (!$htdocs || !preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { |
|
136 | 136 | $isDir = $object->isDir(); |
137 | 137 | if ($isDir && $delDir) { |
138 | 138 | rmdir($object->getPathname()); |
139 | 139 | |
140 | 140 | continue; |
141 | 141 | } |
142 | - if (! $isDir) { |
|
142 | + if (!$isDir) { |
|
143 | 143 | unlink($object->getPathname()); |
144 | 144 | } |
145 | 145 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | -if (! function_exists('get_filenames')) { |
|
155 | +if (!function_exists('get_filenames')) { |
|
156 | 156 | /** |
157 | 157 | * Get Filenames |
158 | 158 | * |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | RecursiveIteratorIterator::SELF_FIRST |
182 | 182 | ) as $name => $object) { |
183 | 183 | $basename = pathinfo($name, PATHINFO_BASENAME); |
184 | - if (! $hidden && $basename[0] === '.') { |
|
184 | + if (!$hidden && $basename[0] === '.') { |
|
185 | 185 | continue; |
186 | 186 | } |
187 | 187 | |
188 | - if ($includeDir || ! $object->isDir()) { |
|
188 | + if ($includeDir || !$object->isDir()) { |
|
189 | 189 | if ($includePath === false) { |
190 | 190 | $files[] = $basename; |
191 | 191 | } elseif ($includePath === null) { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
208 | -if (! function_exists('get_dir_file_info')) { |
|
208 | +if (!function_exists('get_dir_file_info')) { |
|
209 | 209 | /** |
210 | 210 | * Get Directory File Information |
211 | 211 | * |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
254 | -if (! function_exists('get_file_info')) { |
|
254 | +if (!function_exists('get_file_info')) { |
|
255 | 255 | /** |
256 | 256 | * Get File Info |
257 | 257 | * |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | */ |
268 | 268 | function get_file_info(string $file, $returnedValues = ['name', 'server_path', 'size', 'date']) |
269 | 269 | { |
270 | - if (! is_file($file)) { |
|
270 | + if (!is_file($file)) { |
|
271 | 271 | return null; |
272 | 272 | } |
273 | 273 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | } |
318 | 318 | } |
319 | 319 | |
320 | -if (! function_exists('symbolic_permissions')) { |
|
320 | +if (!function_exists('symbolic_permissions')) { |
|
321 | 321 | /** |
322 | 322 | * Symbolic Permissions |
323 | 323 | * |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | } |
366 | 366 | } |
367 | 367 | |
368 | -if (! function_exists('octal_permissions')) { |
|
368 | +if (!function_exists('octal_permissions')) { |
|
369 | 369 | /** |
370 | 370 | * Octal Permissions |
371 | 371 | * |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | } |
381 | 381 | } |
382 | 382 | |
383 | -if (! function_exists('same_file')) { |
|
383 | +if (!function_exists('same_file')) { |
|
384 | 384 | /** |
385 | 385 | * Checks if two files both exist and have identical hashes |
386 | 386 | * |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | } |
393 | 393 | } |
394 | 394 | |
395 | -if (! function_exists('set_realpath')) { |
|
395 | +if (!function_exists('set_realpath')) { |
|
396 | 396 | /** |
397 | 397 | * Set Realpath |
398 | 398 | * |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | // Resolve the path |
409 | 409 | if (realpath($path) !== false) { |
410 | 410 | $path = realpath($path); |
411 | - } elseif ($checkExistence && ! is_dir($path) && ! is_file($path)) { |
|
411 | + } elseif ($checkExistence && !is_dir($path) && !is_file($path)) { |
|
412 | 412 | throw new InvalidArgumentException('Not a valid path: ' . $path); |
413 | 413 | } |
414 | 414 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | // ================================= FONCTIONS UTIILITAIRES ESSENTIELLES ================================= // |
34 | 34 | |
35 | -if (! function_exists('env')) { |
|
35 | +if (!function_exists('env')) { |
|
36 | 36 | /** |
37 | 37 | * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation |
38 | 38 | * pour les variables d'environnement non prises en charge ou incohérentes |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | -if (! function_exists('helper')) { |
|
51 | +if (!function_exists('helper')) { |
|
52 | 52 | /** |
53 | 53 | * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms, |
54 | 54 | * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms. |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | -if (! function_exists('model')) { |
|
67 | +if (!function_exists('model')) { |
|
68 | 68 | /** |
69 | 69 | * Simple maniere d'obtenir un modele. |
70 | 70 | * |
@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @return T |
76 | 76 | */ |
77 | - function model(array|string $name, ?ConnectionInterface &$conn = null) |
|
77 | + function model(array|string $name, ?ConnectionInterface&$conn = null) |
|
78 | 78 | { |
79 | 79 | return Load::model($name, $conn); |
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | -if (! function_exists('service')) { |
|
83 | +if (!function_exists('service')) { |
|
84 | 84 | /** |
85 | 85 | * Permet un accès plus propre au fichier de configuration des services. |
86 | 86 | * Renvoie toujours une instance SHARED de la classe, donc l'appel de la fonction plusieurs fois renvera toujours la même instance. |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | -if (! function_exists('single_service')) { |
|
104 | +if (!function_exists('single_service')) { |
|
105 | 105 | /** |
106 | 106 | * Autoriser l'accès propre à un service. |
107 | 107 | * Renvoie toujours une nouvelle instance de la classe. |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
124 | -if (! function_exists('show404')) { |
|
124 | +if (!function_exists('show404')) { |
|
125 | 125 | /** |
126 | 126 | * Afficher une page 404 introuvable dans le navigateur |
127 | 127 | */ |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | -if (! function_exists('command')) { |
|
134 | +if (!function_exists('command')) { |
|
135 | 135 | /** |
136 | 136 | * Exécute une seule commande. |
137 | 137 | * Entrée attendue dans une seule chaîne comme celle qui serait utilisée sur la ligne de commande elle-même : |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | -if (! function_exists('config')) { |
|
197 | +if (!function_exists('config')) { |
|
198 | 198 | /** |
199 | 199 | * GET/SET App config |
200 | 200 | * |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | -if (! function_exists('logger')) { |
|
228 | +if (!function_exists('logger')) { |
|
229 | 229 | /** |
230 | 230 | * Une méthode de commodité pour les événements de journalisation via le système Log. |
231 | 231 | * |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | |
259 | -if (! function_exists('cache')) { |
|
259 | +if (!function_exists('cache')) { |
|
260 | 260 | /** |
261 | 261 | * Une méthode pratique qui donne accès au cache |
262 | 262 | * objet. Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | } |
288 | 288 | } |
289 | 289 | |
290 | -if (! function_exists('cookie')) { |
|
290 | +if (!function_exists('cookie')) { |
|
291 | 291 | /** |
292 | 292 | * Une méthode pratique qui donne accès à l'objet cookie. |
293 | 293 | * Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | } |
317 | 317 | } |
318 | 318 | |
319 | -if (! function_exists('session')) { |
|
319 | +if (!function_exists('session')) { |
|
320 | 320 | /** |
321 | 321 | * Une méthode pratique pour accéder à l'instance de session, ou un élément qui a été défini dans la session. |
322 | 322 | * |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | |
343 | 343 | // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== // |
344 | 344 | |
345 | -if (! function_exists('esc')) { |
|
345 | +if (!function_exists('esc')) { |
|
346 | 346 | /** |
347 | 347 | * Effectue un simple échappement automatique des données pour des raisons de sécurité. |
348 | 348 | * Pourrait envisager de rendre cela plus complexe à une date ultérieure. |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | } |
370 | 370 | } |
371 | 371 | |
372 | -if (! function_exists('h')) { |
|
372 | +if (!function_exists('h')) { |
|
373 | 373 | /** |
374 | 374 | * Méthode pratique pour htmlspecialchars. |
375 | 375 | * |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | -if (! function_exists('purify')) { |
|
391 | +if (!function_exists('purify')) { |
|
392 | 392 | /** |
393 | 393 | * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier. |
394 | 394 | * Utilisez facilement plusieurs configurations de purificateur. |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | } |
405 | 405 | } |
406 | 406 | |
407 | -if (! function_exists('remove_invisible_characters')) { |
|
407 | +if (!function_exists('remove_invisible_characters')) { |
|
408 | 408 | /** |
409 | 409 | * Supprimer les caractères invisibles |
410 | 410 | * |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | } |
418 | 418 | } |
419 | 419 | |
420 | -if (! function_exists('stringify_attributes')) { |
|
420 | +if (!function_exists('stringify_attributes')) { |
|
421 | 421 | /** |
422 | 422 | * Chaîner les attributs à utiliser dans les balises HTML. |
423 | 423 | * |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | |
432 | 432 | // ================================= FONCTIONS DE FORMULAIRE ================================= // |
433 | 433 | |
434 | -if (! function_exists('csrf_token')) { |
|
434 | +if (!function_exists('csrf_token')) { |
|
435 | 435 | /** |
436 | 436 | * Renvoie la valeur de hachage actuelle pour la protection CSRF. |
437 | 437 | * Peut être utilisé dans les vues lors de la construction manuelle d'input cachées, ou utilisé dans les variables javascript pour l'utilisation de l'API. |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | } |
443 | 443 | } |
444 | 444 | |
445 | -if (! function_exists('csrf_field')) { |
|
445 | +if (!function_exists('csrf_field')) { |
|
446 | 446 | /** |
447 | 447 | * Génère un champ input caché à utiliser dans les formulaires générés manuellement. |
448 | 448 | */ |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | } |
455 | 455 | } |
456 | 456 | |
457 | -if (! function_exists('csrf_meta')) { |
|
457 | +if (!function_exists('csrf_meta')) { |
|
458 | 458 | /** |
459 | 459 | * Génère une balise méta à utiliser dans les appels javascript. |
460 | 460 | */ |
@@ -466,13 +466,13 @@ discard block |
||
466 | 466 | } |
467 | 467 | } |
468 | 468 | |
469 | -if (! function_exists('method_field')) { |
|
469 | +if (!function_exists('method_field')) { |
|
470 | 470 | /** |
471 | 471 | * Générer un champ de formulaire pour usurper le verbe HTTP utilisé par les formulaires. |
472 | 472 | */ |
473 | 473 | function method_field(string $method): string |
474 | 474 | { |
475 | - if (! in_array($method = strtoupper($method), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
475 | + if (!in_array($method = strtoupper($method), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
476 | 476 | throw new InvalidArgumentException(sprintf('Methode %s invalide', $method)); |
477 | 477 | } |
478 | 478 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= // |
484 | 484 | |
485 | -if (! function_exists('environment')) { |
|
485 | +if (!function_exists('environment')) { |
|
486 | 486 | /** |
487 | 487 | * Renvoi l'environnement d'execution actuel ou determine si on est dans un environnement specifie |
488 | 488 | * |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | } |
521 | 521 | } |
522 | 522 | |
523 | -if (! function_exists('on_dev')) { |
|
523 | +if (!function_exists('on_dev')) { |
|
524 | 524 | /** |
525 | 525 | * Testez pour voir si nous sommes dans un environnement de développement. |
526 | 526 | */ |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | } |
535 | 535 | } |
536 | 536 | |
537 | -if (! function_exists('on_prod')) { |
|
537 | +if (!function_exists('on_prod')) { |
|
538 | 538 | /** |
539 | 539 | * Testez pour voir si nous sommes dans un environnement de production. |
540 | 540 | */ |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | } |
549 | 549 | } |
550 | 550 | |
551 | -if (! function_exists('on_test')) { |
|
551 | +if (!function_exists('on_test')) { |
|
552 | 552 | /** |
553 | 553 | * Testez pour voir si nous sommes dans un environnement de test |
554 | 554 | */ |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | } |
559 | 559 | } |
560 | 560 | |
561 | -if (! function_exists('is_cli')) { |
|
561 | +if (!function_exists('is_cli')) { |
|
562 | 562 | /** |
563 | 563 | * Testez pour voir si une demande a été faite à partir de la ligne de commande. |
564 | 564 | */ |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | } |
569 | 569 | } |
570 | 570 | |
571 | -if (! function_exists('is_php')) { |
|
571 | +if (!function_exists('is_php')) { |
|
572 | 572 | /** |
573 | 573 | * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie. |
574 | 574 | */ |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | } |
579 | 579 | } |
580 | 580 | |
581 | -if (! function_exists('is_windows')) { |
|
581 | +if (!function_exists('is_windows')) { |
|
582 | 582 | /** |
583 | 583 | * Déterminez si l'environnement actuel est basé sur Windows. |
584 | 584 | */ |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | } |
589 | 589 | } |
590 | 590 | |
591 | -if (! function_exists('is_https')) { |
|
591 | +if (!function_exists('is_https')) { |
|
592 | 592 | /** |
593 | 593 | * Determines if the application is accessed via an encrypted * (HTTPS) connection. |
594 | 594 | */ |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | } |
599 | 599 | } |
600 | 600 | |
601 | -if (! function_exists('is_localfile')) { |
|
601 | +if (!function_exists('is_localfile')) { |
|
602 | 602 | /** |
603 | 603 | * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non |
604 | 604 | */ |
@@ -608,11 +608,11 @@ discard block |
||
608 | 608 | return true; |
609 | 609 | } |
610 | 610 | |
611 | - return ! preg_match('#^(https?://)#i', $name); |
|
611 | + return !preg_match('#^(https?://)#i', $name); |
|
612 | 612 | } |
613 | 613 | } |
614 | 614 | |
615 | -if (! function_exists('is_online')) { |
|
615 | +if (!function_exists('is_online')) { |
|
616 | 616 | /** |
617 | 617 | * Tester si l'application s'exécute en local ou en ligne. |
618 | 618 | */ |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | } |
623 | 623 | } |
624 | 624 | |
625 | -if (! function_exists('is_connected')) { |
|
625 | +if (!function_exists('is_connected')) { |
|
626 | 626 | /** |
627 | 627 | * Verifie si l'utilisateur a une connexion internet active. |
628 | 628 | */ |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | } |
633 | 633 | } |
634 | 634 | |
635 | -if (! function_exists('is_ajax_request')) { |
|
635 | +if (!function_exists('is_ajax_request')) { |
|
636 | 636 | /** |
637 | 637 | * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH. |
638 | 638 | */ |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | } |
643 | 643 | } |
644 | 644 | |
645 | -if (! function_exists('redirection')) { |
|
645 | +if (!function_exists('redirection')) { |
|
646 | 646 | /** |
647 | 647 | * Redirige l'utilisateur |
648 | 648 | */ |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | } |
657 | 657 | } |
658 | 658 | |
659 | -if (! function_exists('redirect')) { |
|
659 | +if (!function_exists('redirect')) { |
|
660 | 660 | /** |
661 | 661 | * Méthode pratique qui fonctionne avec la $request globale actuelle et |
662 | 662 | * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | } |
679 | 679 | } |
680 | 680 | |
681 | -if (! function_exists('back')) { |
|
681 | +if (!function_exists('back')) { |
|
682 | 682 | /** |
683 | 683 | * Retourne a la page precedente |
684 | 684 | * |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | } |
691 | 691 | } |
692 | 692 | |
693 | -if (! function_exists('link_to')) { |
|
693 | +if (!function_exists('link_to')) { |
|
694 | 694 | /** |
695 | 695 | * Étant donné une chaîne de contrôleur/méthode et tous les paramètres, |
696 | 696 | * tentera de créer l'URL relative à la route correspondante. |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | } |
711 | 711 | } |
712 | 712 | |
713 | -if (! function_exists('clean_path')) { |
|
713 | +if (!function_exists('clean_path')) { |
|
714 | 714 | /** |
715 | 715 | * Une méthode pratique pour nettoyer les chemins pour |
716 | 716 | * une sortie plus belle. Utile pour les exceptions |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | } |
732 | 732 | } |
733 | 733 | |
734 | -if (! function_exists('old')) { |
|
734 | +if (!function_exists('old')) { |
|
735 | 735 | /** |
736 | 736 | * Fournit l'accès à "entrée ancienne" qui a été définie dans la session lors d'un redirect()-withInput(). |
737 | 737 | * |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | function old(string $key, $default = null, $escape = 'html') |
745 | 745 | { |
746 | 746 | // Assurez-vous de charger la session |
747 | - if (session_status() === PHP_SESSION_NONE && ! on_test()) { |
|
747 | + if (session_status() === PHP_SESSION_NONE && !on_test()) { |
|
748 | 748 | session(); // @codeCoverageIgnore |
749 | 749 | } |
750 | 750 | |
@@ -759,7 +759,7 @@ discard block |
||
759 | 759 | |
760 | 760 | // ================================= FONCTIONS DE DEBOGAGE ================================= // |
761 | 761 | |
762 | -if (! function_exists('deprecationWarning')) { |
|
762 | +if (!function_exists('deprecationWarning')) { |
|
763 | 763 | /** |
764 | 764 | * Méthode d'assistance pour générer des avertissements d'obsolescence |
765 | 765 | * |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | } |
774 | 774 | } |
775 | 775 | |
776 | -if (! function_exists('pr')) { |
|
776 | +if (!function_exists('pr')) { |
|
777 | 777 | /** |
778 | 778 | * print_r() convenience function. |
779 | 779 | * |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | } |
796 | 796 | } |
797 | 797 | |
798 | -if (! function_exists('pj')) { |
|
798 | +if (!function_exists('pj')) { |
|
799 | 799 | /** |
800 | 800 | * json pretty print convenience function. |
801 | 801 | * |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | } |
817 | 817 | } |
818 | 818 | |
819 | -if (! function_exists('trigger_warning')) { |
|
819 | +if (!function_exists('trigger_warning')) { |
|
820 | 820 | /** |
821 | 821 | * Déclenche un E_USER_WARNING. |
822 | 822 | */ |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | |
829 | 829 | // ================================= FONCTIONS DIVERSES ================================= // |
830 | 830 | |
831 | -if (! function_exists('force_https')) { |
|
831 | +if (!function_exists('force_https')) { |
|
832 | 832 | /** |
833 | 833 | * Utilisé pour forcer l'accès à une page via HTTPS. |
834 | 834 | * Utilise une redirection standard, plus définira l'en-tête HSTS |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | |
856 | 856 | // Si la session est active, nous devons régénérer |
857 | 857 | // l'ID de session pour des raisons de sécurité. |
858 | - if (! on_test() && session_status() === PHP_SESSION_ACTIVE) { |
|
858 | + if (!on_test() && session_status() === PHP_SESSION_ACTIVE) { |
|
859 | 859 | session()->regenerate(); // @codeCoverageIgnore |
860 | 860 | } |
861 | 861 | |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | } |
872 | 872 | } |
873 | 873 | |
874 | -if (! function_exists('get_type_name')) { |
|
874 | +if (!function_exists('get_type_name')) { |
|
875 | 875 | /** |
876 | 876 | * Renvoie la classe d'objets ou le type var de ce n'est pas un objet |
877 | 877 | * |
@@ -885,7 +885,7 @@ discard block |
||
885 | 885 | } |
886 | 886 | } |
887 | 887 | |
888 | -if (! function_exists('ip_address')) { |
|
888 | +if (!function_exists('ip_address')) { |
|
889 | 889 | /** |
890 | 890 | * Renvoie l'adresse IP de l'utilisateur actuel |
891 | 891 | */ |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | } |
896 | 896 | } |
897 | 897 | |
898 | -if (! function_exists('is_really_writable')) { |
|
898 | +if (!function_exists('is_really_writable')) { |
|
899 | 899 | /** |
900 | 900 | * Tests d'inscriptibilité des fichiers |
901 | 901 | */ |
@@ -905,7 +905,7 @@ discard block |
||
905 | 905 | } |
906 | 906 | } |
907 | 907 | |
908 | -if (! function_exists('lang')) { |
|
908 | +if (!function_exists('lang')) { |
|
909 | 909 | /** |
910 | 910 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
911 | 911 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | } |
917 | 917 | } |
918 | 918 | |
919 | -if (! function_exists('__')) { |
|
919 | +if (!function_exists('__')) { |
|
920 | 920 | /** |
921 | 921 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
922 | 922 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | } |
930 | 930 | } |
931 | 931 | |
932 | -if (! function_exists('namespace_split')) { |
|
932 | +if (!function_exists('namespace_split')) { |
|
933 | 933 | /** |
934 | 934 | * Séparez l'espace de noms du nom de classe. |
935 | 935 | * |
@@ -950,7 +950,7 @@ discard block |
||
950 | 950 | } |
951 | 951 | } |
952 | 952 | |
953 | -if (! function_exists('view_exist')) { |
|
953 | +if (!function_exists('view_exist')) { |
|
954 | 954 | /** |
955 | 955 | * Verifie si un fichier de vue existe. Utile pour limiter les failles include |
956 | 956 | */ |
@@ -960,7 +960,7 @@ discard block |
||
960 | 960 | } |
961 | 961 | } |
962 | 962 | |
963 | -if (! function_exists('view')) { |
|
963 | +if (!function_exists('view')) { |
|
964 | 964 | /** |
965 | 965 | * Saisit la classe compatible avec le RendererInterface et lui demande d'effectuer le rendu de la vue spécifiée. |
966 | 966 | * Fournit simplement une méthode de commodité qui peut être utilisée dans les contrôleurs, les bibliothèques et les routes sous forme de closure. |
@@ -975,7 +975,7 @@ discard block |
||
975 | 975 | } |
976 | 976 | } |
977 | 977 | |
978 | -if (! function_exists('component')) { |
|
978 | +if (!function_exists('component')) { |
|
979 | 979 | /** |
980 | 980 | * Les composants de vue sont utilisées dans les vues pour insérer des morceaux de HTML qui sont gérés par d'autres classes. |
981 | 981 | * |
@@ -991,7 +991,7 @@ discard block |
||
991 | 991 | } |
992 | 992 | } |
993 | 993 | |
994 | -if (! function_exists('flash')) { |
|
994 | +if (!function_exists('flash')) { |
|
995 | 995 | /** |
996 | 996 | * Fournisseur d'acces rapide a la classe PHP Flash |
997 | 997 | * |
@@ -1023,7 +1023,7 @@ discard block |
||
1023 | 1023 | }*/ |
1024 | 1024 | } |
1025 | 1025 | |
1026 | -if (! function_exists('geo_ip')) { |
|
1026 | +if (!function_exists('geo_ip')) { |
|
1027 | 1027 | /** |
1028 | 1028 | * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip |
1029 | 1029 | */ |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | } |
1034 | 1034 | } |
1035 | 1035 | |
1036 | -if (! function_exists('to_stream')) { |
|
1036 | +if (!function_exists('to_stream')) { |
|
1037 | 1037 | /** |
1038 | 1038 | * Créez un nouveau flux basé sur le type d'entrée. |
1039 | 1039 | * |
@@ -1054,7 +1054,7 @@ discard block |
||
1054 | 1054 | } |
1055 | 1055 | } |
1056 | 1056 | |
1057 | -if (! function_exists('value')) { |
|
1057 | +if (!function_exists('value')) { |
|
1058 | 1058 | /** |
1059 | 1059 | * Renvoie la valeur par défaut de la valeur donnée. |
1060 | 1060 | */ |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | } |
1065 | 1065 | } |
1066 | 1066 | |
1067 | -if (! function_exists('collect')) { |
|
1067 | +if (!function_exists('collect')) { |
|
1068 | 1068 | /** |
1069 | 1069 | * Créez une collection à partir de la valeur donnée. |
1070 | 1070 | */ |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | } |
1075 | 1075 | } |
1076 | 1076 | |
1077 | -if (! function_exists('with')) { |
|
1077 | +if (!function_exists('with')) { |
|
1078 | 1078 | /** |
1079 | 1079 | * Renvoie la valeur donnée, éventuellement transmise via le rappel donné. |
1080 | 1080 | * |
@@ -1086,7 +1086,7 @@ discard block |
||
1086 | 1086 | } |
1087 | 1087 | } |
1088 | 1088 | |
1089 | -if (! function_exists('tap')) { |
|
1089 | +if (!function_exists('tap')) { |
|
1090 | 1090 | /** |
1091 | 1091 | * Appelez la Closure donnée avec cette instance puis renvoyez l'instance. |
1092 | 1092 | */ |
@@ -1096,7 +1096,7 @@ discard block |
||
1096 | 1096 | } |
1097 | 1097 | } |
1098 | 1098 | |
1099 | -if (! function_exists('last')) { |
|
1099 | +if (!function_exists('last')) { |
|
1100 | 1100 | /** |
1101 | 1101 | * Recupere le dernier element d'un tableau |
1102 | 1102 | * |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | } |
1113 | 1113 | } |
1114 | 1114 | |
1115 | -if (! function_exists('invade')) { |
|
1115 | +if (!function_exists('invade')) { |
|
1116 | 1116 | /** |
1117 | 1117 | * Cette classe offre une fonction d'invasion qui vous permettra de lire / écrire des propriétés privées d'un objet. |
1118 | 1118 | * Il vous permettra également de définir, obtenir et appeler des méthodes privées. |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $config = config('cache'); |
54 | 54 | $handler = $this->argument('driver', $params[0] ?? $config['handler']); |
55 | 55 | |
56 | - if (! array_key_exists($handler, $config['valid_handlers'])) { |
|
56 | + if (!array_key_exists($handler, $config['valid_handlers'])) { |
|
57 | 57 | $this->fail($handler . ' n\'est pas un gestionnaire de cache valide.'); |
58 | 58 | |
59 | 59 | return; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $config['handler'] = $handler; |
63 | 63 | $cache = service('cache', $config); |
64 | 64 | |
65 | - if (! $cache->clear()) { |
|
65 | + if (!$cache->clear()) { |
|
66 | 66 | // @codeCoverageIgnoreStart |
67 | 67 | $this->fail('Erreur lors de l\'effacement du cache.'); |
68 | 68 |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | foreach ($options as $key => $value) { |
159 | 159 | $key = preg_replace('/^\-\-/', '', $key); |
160 | - if (! isset($options[$key])) { |
|
160 | + if (!isset($options[$key])) { |
|
161 | 161 | $options[$key] = $value; |
162 | 162 | } |
163 | 163 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function commandExists(string $commandName): bool |
172 | 172 | { |
173 | - return ! empty($this->_commands[$commandName]); |
|
173 | + return !empty($this->_commands[$commandName]); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | foreach ($files as $file) { |
206 | 206 | $className = $locator->findQualifiedNameFromPath($file); |
207 | 207 | |
208 | - if ($className === false || ! class_exists($className)) { |
|
208 | + if ($className === false || !class_exists($className)) { |
|
209 | 209 | continue; |
210 | 210 | } |
211 | 211 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $class = new ReflectionClass($className); |
232 | 232 | $logger = $logger ?: service('logger'); |
233 | 233 | |
234 | - if (! $class->isInstantiable() || ! $class->isSubclassOf(Command::class)) { |
|
234 | + if (!$class->isInstantiable() || !$class->isSubclassOf(Command::class)) { |
|
235 | 235 | throw CLIException::invalidCommand($className); |
236 | 236 | } |
237 | 237 | |
@@ -258,13 +258,13 @@ discard block |
||
258 | 258 | $value = (array) $value; |
259 | 259 | |
260 | 260 | $description = $value[0]; |
261 | - if (! is_string($description)) { |
|
261 | + if (!is_string($description)) { |
|
262 | 262 | continue; |
263 | 263 | } |
264 | 264 | |
265 | 265 | $default = $value[1] ?? null; |
266 | 266 | $filter = $value[2] ?? null; |
267 | - if ($filter !== null && ! is_callable($filter)) { |
|
267 | + if ($filter !== null && !is_callable($filter)) { |
|
268 | 268 | $filter = null; |
269 | 269 | } |
270 | 270 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $value = (array) $value; |
277 | 277 | |
278 | 278 | $description = $value[0]; |
279 | - if (! is_string($description)) { |
|
279 | + if (!is_string($description)) { |
|
280 | 280 | continue; |
281 | 281 | } |
282 | 282 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | } |
287 | 287 | |
288 | 288 | $console = $this; |
289 | - $action = function (?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) { |
|
289 | + $action = function(?array $arguments = [], ?array $options = [], ?bool $suppress = null) use ($instance, $command, $console) { |
|
290 | 290 | $this->name(); // ne pas retirer. car en cas, d'absence, cs-fixer mettra cette fonction en static. Et php-cli generera une erreur |
291 | 291 | |
292 | 292 | foreach ($instance->required as $package) { |
@@ -297,9 +297,9 @@ discard block |
||
297 | 297 | /** @var Interactor $io */ |
298 | 298 | $io = $console->io(); |
299 | 299 | |
300 | - if (! InstalledVersions::isInstalled($package)) { |
|
300 | + if (!InstalledVersions::isInstalled($package)) { |
|
301 | 301 | $io->info('Cette commande nécessite le package "' . $package . '" mais vous ne l\'avez pas', true); |
302 | - if (! $io->confirm('Voulez-vous l\'installer maintenant ?')) { |
|
302 | + if (!$io->confirm('Voulez-vous l\'installer maintenant ?')) { |
|
303 | 303 | return; |
304 | 304 | } |
305 | 305 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | } |
316 | 316 | |
317 | 317 | $suppress = $suppress ?: $console->suppress; |
318 | - if (! $suppress) { |
|
318 | + if (!$suppress) { |
|
319 | 319 | $console->start($instance); |
320 | 320 | } |
321 | 321 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | $result = $instance->setOptions($options)->setArguments($arguments)->execute($parameters); |
332 | 332 | |
333 | - if (! $suppress) { |
|
333 | + if (!$suppress) { |
|
334 | 334 | $console->end(); |
335 | 335 | } |
336 | 336 | |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | |
346 | 346 | private function registerException(Logger $logger) |
347 | 347 | { |
348 | - $this->onException(static function (Throwable $e, int $exitCode) use ($logger): void { |
|
348 | + $this->onException(static function(Throwable $e, int $exitCode) use ($logger): void { |
|
349 | 349 | $logger->error((string) $e, ['exitCode' => $exitCode, 'klinge' => true]); |
350 | 350 | }); |
351 | 351 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | */ |
200 | 200 | protected function getRouteInformation(array $route, SampleURIGenerator $uriGenerator, MiddlewareCollector $middlewareCollector): ?array |
201 | 201 | { |
202 | - if (! isset($route['middleware'])) { |
|
202 | + if (!isset($route['middleware'])) { |
|
203 | 203 | $sampleUri = $uriGenerator->get($route['route']); |
204 | 204 | $middlewares = $middlewareCollector->get($route['method'], $sampleUri); |
205 | 205 | $route['middleware'] = implode(' ', array_map(Helpers::classBasename(...), $middlewares)); |
@@ -224,8 +224,8 @@ discard block |
||
224 | 224 | { |
225 | 225 | if ($route['handler'] instanceof Closure) { |
226 | 226 | $path = (new ReflectionFunction($route['handler']))->getFileName(); |
227 | - } elseif (is_string($route['handler']) && ! (str_contains($route['handler'], '(View) ') || str_contains($route['handler'], '(Closure) '))) { |
|
228 | - if (! class_exists($classname = explode('::', $route['handler'])[0])) { |
|
227 | + } elseif (is_string($route['handler']) && !(str_contains($route['handler'], '(View) ') || str_contains($route['handler'], '(Closure) '))) { |
|
228 | + if (!class_exists($classname = explode('::', $route['handler'])[0])) { |
|
229 | 229 | return false; |
230 | 230 | } |
231 | 231 | $path = (new ReflectionClass($classname))->getFileName(); |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | */ |
242 | 242 | protected function filterRoute(array $route): ?array |
243 | 243 | { |
244 | - if (($this->option('name') && ! Text::contains((string) $route['name'], $this->option('name'))) |
|
245 | - || ($this->option('handler') && isset($route['handler']) && is_string($route['handler']) && ! Text::contains($route['handler'], $this->option('handler'))) |
|
246 | - || ($this->option('path') && ! Text::contains($route['uri'], $this->option('path'))) |
|
247 | - || ($this->option('method') && ! Text::contains($route['method'], strtoupper($this->option('method')))) |
|
248 | - || ($this->option('domain') && ! Text::contains((string) $route['domain'], $this->option('domain'))) |
|
244 | + if (($this->option('name') && !Text::contains((string) $route['name'], $this->option('name'))) |
|
245 | + || ($this->option('handler') && isset($route['handler']) && is_string($route['handler']) && !Text::contains($route['handler'], $this->option('handler'))) |
|
246 | + || ($this->option('path') && !Text::contains($route['uri'], $this->option('path'))) |
|
247 | + || ($this->option('method') && !Text::contains($route['method'], strtoupper($this->option('method')))) |
|
248 | + || ($this->option('domain') && !Text::contains((string) $route['domain'], $this->option('domain'))) |
|
249 | 249 | || ($this->option('except-vendor') && $route['vendor']) |
250 | - || ($this->option('only-vendor') && ! $route['vendor'])) { |
|
250 | + || ($this->option('only-vendor') && !$route['vendor'])) { |
|
251 | 251 | return null; |
252 | 252 | } |
253 | 253 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | protected function asJson(Collection $routes) |
309 | 309 | { |
310 | 310 | $this->json( |
311 | - $routes->map(static function ($route) { |
|
311 | + $routes->map(static function($route) { |
|
312 | 312 | $route['middleware'] = empty($route['middleware']) ? [] : explode(' ', $route['middleware']); |
313 | 313 | |
314 | 314 | return $route; |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $options = ['sep' => '-', 'second' => ['fg' => Color::GREEN]]; |
367 | 367 | $this->justify('Nombre total de routes définies', (string) $total, $options); |
368 | 368 | $this->justify('Nombre de routes affichées', (string) $routes->count(), $options); |
369 | - if (! $this->option('method')) { |
|
369 | + if (!$this->option('method')) { |
|
370 | 370 | $this->border(char: '.'); |
371 | 371 | $methods = $routes->map(static fn ($route) => $route['method'])->unique()->sort()->all(); |
372 | 372 |