@@ -138,7 +138,7 @@ |
||
138 | 138 | $response = $this->cors->varyHeader($response, 'Access-Control-Request-Method'); |
139 | 139 | } |
140 | 140 | |
141 | - if (! $response->hasHeader('Access-Control-Allow-Origin')) { |
|
141 | + if (!$response->hasHeader('Access-Control-Allow-Origin')) { |
|
142 | 142 | $response = $this->cors->addActualRequestHeaders($request, $response); |
143 | 143 | } |
144 | 144 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $accessor = service($accessor); |
24 | 24 | } |
25 | 25 | |
26 | - if (! is_object($accessor)) { |
|
26 | + if (!is_object($accessor)) { |
|
27 | 27 | throw new InvalidArgumentException(sprintf('La methode `%s::accessor` doit retourner un object ou le nom d\'un service.', static::class)); |
28 | 28 | } |
29 | 29 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | protected function factory(): AbstractAdapter |
114 | 114 | { |
115 | - if (! empty($this->adapter)) { |
|
115 | + if (!empty($this->adapter)) { |
|
116 | 116 | return $this->adapter; |
117 | 117 | } |
118 | 118 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $handler = static::$validHandlers[$handler]; |
127 | 127 | } |
128 | 128 | |
129 | - if (! class_exists($handler)) { |
|
129 | + if (!class_exists($handler)) { |
|
130 | 130 | throw new InvalidArgumentException(lang('Mail.invalidHandler', [$handler])); |
131 | 131 | } |
132 | 132 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $debug = on_dev(); |
136 | 136 | } |
137 | 137 | |
138 | - if (! is_subclass_of($handler, AbstractAdapter::class)) { |
|
138 | + if (!is_subclass_of($handler, AbstractAdapter::class)) { |
|
139 | 139 | throw new InvalidArgumentException(lang('Mail.handlerMustExtendClass', [$handler, AbstractAdapter::class])); |
140 | 140 | } |
141 | 141 | |
@@ -341,15 +341,15 @@ discard block |
||
341 | 341 | $path = ''; |
342 | 342 | |
343 | 343 | // N'est-il pas namespaced ? on cherche le dossier en fonction du parametre "view_base" |
344 | - if (! str_contains($view, '\\')) { |
|
344 | + if (!str_contains($view, '\\')) { |
|
345 | 345 | $path = $this->config['view_dir'] ?? ''; |
346 | - if (! empty($path)) { |
|
346 | + if (!empty($path)) { |
|
347 | 347 | $path .= '/'; |
348 | 348 | } |
349 | 349 | } |
350 | 350 | |
351 | 351 | $view = view($path . $view, $data); |
352 | - if (! empty($this->config['template'])) { |
|
352 | + if (!empty($this->config['template'])) { |
|
353 | 353 | $view->layout($this->config['template']); |
354 | 354 | } |
355 | 355 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | // ================================= ================================= // |
27 | 27 | |
28 | -if (! function_exists('url')) { |
|
28 | +if (!function_exists('url')) { |
|
29 | 29 | /** |
30 | 30 | * Générer une url pour l'application. |
31 | 31 | * |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | -if (! function_exists('site_url')) { |
|
47 | +if (!function_exists('site_url')) { |
|
48 | 48 | /** |
49 | 49 | * Renvoie une URL de site telle que définie par la configuration de l'application. |
50 | 50 | * |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
71 | -if (! function_exists('base_url')) { |
|
71 | +if (!function_exists('base_url')) { |
|
72 | 72 | /** |
73 | 73 | * Renvoie l'URL de base telle que définie par la configuration de l'application. |
74 | 74 | * Les URL de base sont des URL de site coupées sans la page d'index. |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | -if (! function_exists('current_url')) { |
|
90 | +if (!function_exists('current_url')) { |
|
91 | 91 | /** |
92 | 92 | * Renvoie l'URL complète (y compris les segments) de la page où cette fonction est placée |
93 | 93 | * |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
117 | -if (! function_exists('previous_url')) { |
|
117 | +if (!function_exists('previous_url')) { |
|
118 | 118 | /** |
119 | 119 | * Renvoie l'URL précédente sur laquelle se trouvait le visiteur actuel. Pour des raisons de sécurité |
120 | 120 | * nous vérifions d'abord une variable de session enregistrée, si elle existe, et l'utilisons. |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | -if (! function_exists('uri_string')) { |
|
134 | +if (!function_exists('uri_string')) { |
|
135 | 135 | /** |
136 | 136 | * Renvoie la partie chemin de l'URL actuelle |
137 | 137 | * |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
148 | -if (! function_exists('index_page')) { |
|
148 | +if (!function_exists('index_page')) { |
|
149 | 149 | /** |
150 | 150 | * Renvoie la "index_page" de votre fichier de configuration |
151 | 151 | */ |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | } |
157 | 157 | |
158 | -if (! function_exists('anchor')) { |
|
158 | +if (!function_exists('anchor')) { |
|
159 | 159 | /** |
160 | 160 | * Crée une ancre basée sur l'URL locale. |
161 | 161 | * |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | -if (! function_exists('anchor_popup')) { |
|
183 | +if (!function_exists('anchor_popup')) { |
|
184 | 184 | /** |
185 | 185 | * Lien d'ancrage - Version contextuelle |
186 | 186 | * |
@@ -203,12 +203,12 @@ discard block |
||
203 | 203 | return '<a href="' . $siteUrl . '" onclick="window.open(\'' . $siteUrl . "', '_blank'); return false;\">" . $title . '</a>'; |
204 | 204 | } |
205 | 205 | |
206 | - if (! is_array($attributes)) { |
|
206 | + if (!is_array($attributes)) { |
|
207 | 207 | $attributes = [$attributes]; |
208 | 208 | |
209 | 209 | // Ref: http://www.w3schools.com/jsref/met_win_open.asp |
210 | 210 | $windowName = '_blank'; |
211 | - } elseif (! empty($attributes['window_name'])) { |
|
211 | + } elseif (!empty($attributes['window_name'])) { |
|
212 | 212 | $windowName = $attributes['window_name']; |
213 | 213 | unset($attributes['window_name']); |
214 | 214 | } else { |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } |
229 | 229 | } |
230 | 230 | |
231 | -if (! function_exists('mailto')) { |
|
231 | +if (!function_exists('mailto')) { |
|
232 | 232 | /** |
233 | 233 | * Lien Mailto |
234 | 234 | * |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
248 | -if (! function_exists('safe_mailto')) { |
|
248 | +if (!function_exists('safe_mailto')) { |
|
249 | 249 | /** |
250 | 250 | * Lien Mailto codé |
251 | 251 | * |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | } |
337 | 337 | } |
338 | 338 | |
339 | -if (! function_exists('auto_link')) { |
|
339 | +if (!function_exists('auto_link')) { |
|
340 | 340 | /** |
341 | 341 | * Lien automatique |
342 | 342 | * |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | function auto_link(string $str, string $type = 'both', bool $popup = false): string |
352 | 352 | { |
353 | 353 | // Recherche et remplace tous les URLs. |
354 | - if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { |
|
354 | + if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[^\s()<>;]+\w#i', $str, $matches, PREG_OFFSET_CAPTURE|PREG_SET_ORDER)) { |
|
355 | 355 | // Définissez notre HTML cible si vous utilisez des liens contextuels. |
356 | 356 | $target = ($popup) ? ' target="_blank"' : ''; |
357 | 357 | |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | } |
383 | 383 | } |
384 | 384 | |
385 | -if (! function_exists('prep_url')) { |
|
385 | +if (!function_exists('prep_url')) { |
|
386 | 386 | /** |
387 | 387 | * Ajoute simplement la partie http:// ou https:// si aucun schéma n'est inclus. |
388 | 388 | * |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
410 | -if (! function_exists('url_title')) { |
|
410 | +if (!function_exists('url_title')) { |
|
411 | 411 | /** |
412 | 412 | * Créer un titre d'URL |
413 | 413 | * |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | } |
444 | 444 | } |
445 | 445 | |
446 | -if (! function_exists('mb_url_title')) { |
|
446 | +if (!function_exists('mb_url_title')) { |
|
447 | 447 | /** |
448 | 448 | * Créer un titre d'URL qui prend en compte les caractères accentués |
449 | 449 | * |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | } |
463 | 463 | } |
464 | 464 | |
465 | -if (! function_exists('url_to')) { |
|
465 | +if (!function_exists('url_to')) { |
|
466 | 466 | /** |
467 | 467 | * Obtenir l'URL complète et absolue d'une méthode de contrôleur |
468 | 468 | * (avec arguments supplémentaires) |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | */ |
476 | 476 | function url_to(string $controller, ...$args): string |
477 | 477 | { |
478 | - if (! $route = route($controller, ...$args)) { |
|
478 | + if (!$route = route($controller, ...$args)) { |
|
479 | 479 | $explode = explode('::', $controller); |
480 | 480 | |
481 | 481 | if (isset($explode[1])) { |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | } |
490 | 490 | } |
491 | 491 | |
492 | -if (! function_exists('route')) { |
|
492 | +if (!function_exists('route')) { |
|
493 | 493 | /** |
494 | 494 | * Tente de rechercher une route en fonction de sa destination. |
495 | 495 | * |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | } |
502 | 502 | } |
503 | 503 | |
504 | -if (! function_exists('action')) { |
|
504 | +if (!function_exists('action')) { |
|
505 | 505 | /** |
506 | 506 | * Obtenir l'URL d'une action du contrôleur. |
507 | 507 | * |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
516 | -if (! function_exists('url_is')) { |
|
516 | +if (!function_exists('url_is')) { |
|
517 | 517 | /** |
518 | 518 | * Détermine si le chemin d'URL actuel contient le chemin donné. |
519 | 519 | * Il peut contenir un caractère générique (*) qui autorisera tout caractère valide. |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | } |
532 | 532 | } |
533 | 533 | |
534 | -if (! function_exists('link_active')) { |
|
534 | +if (!function_exists('link_active')) { |
|
535 | 535 | /** |
536 | 536 | * Lien actif dans la navbar |
537 | 537 | * Un peut comme le router-active-link de vuejs |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | return $active_class; |
556 | 556 | } |
557 | 557 | |
558 | - if (! $exact && preg_match('#^' . $path . '/?#i', $current_section)) { |
|
558 | + if (!$exact && preg_match('#^' . $path . '/?#i', $current_section)) { |
|
559 | 559 | return $active_class; |
560 | 560 | } |
561 | 561 | |
@@ -567,14 +567,14 @@ discard block |
||
567 | 567 | } |
568 | 568 | } |
569 | 569 | |
570 | -if (! function_exists('clean_url')) { |
|
570 | +if (!function_exists('clean_url')) { |
|
571 | 571 | function clean_url(string $url): string |
572 | 572 | { |
573 | 573 | return Helpers::cleanUrl($url); |
574 | 574 | } |
575 | 575 | } |
576 | 576 | |
577 | -if (! function_exists('is_absolute_link')) { |
|
577 | +if (!function_exists('is_absolute_link')) { |
|
578 | 578 | /** |
579 | 579 | * Verifies si un chemin donnée est une url absolue ou relative |
580 | 580 | */ |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | // Si cela semble être une URL relative, alors convertissez-la en URL complète |
69 | 69 | // pour une meilleure sécurité. |
70 | - if (! str_starts_with($uri, 'http')) { |
|
70 | + if (!str_starts_with($uri, 'http')) { |
|
71 | 71 | $uri = site_url($uri); |
72 | 72 | } |
73 | 73 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | { |
137 | 137 | $request = $this->generator->getRequest(); |
138 | 138 | |
139 | - $intended = $request->method() === 'GET' && ! $request->expectsJson() |
|
139 | + $intended = $request->method() === 'GET' && !$request->expectsJson() |
|
140 | 140 | ? $this->generator->full() |
141 | 141 | : $this->generator->previous(); |
142 | 142 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $errors = [$key => $errors]; |
191 | 191 | } |
192 | 192 | |
193 | - if (! empty($errors)) { |
|
193 | + if (!empty($errors)) { |
|
194 | 194 | $this->session->flashErrors($errors, $key); |
195 | 195 | } |
196 | 196 |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | $this->_streamMode = $options['streamMode'] ?? $this->_streamMode; |
460 | 460 | |
461 | 461 | if (isset($options['stream'])) { |
462 | - if (! $options['stream'] instanceof StreamInterface) { |
|
462 | + if (!$options['stream'] instanceof StreamInterface) { |
|
463 | 463 | throw new InvalidArgumentException('Stream option must be an object that implements StreamInterface'); |
464 | 464 | } |
465 | 465 | $this->stream = $options['stream']; |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | $this->_setStatus($options['status']); |
476 | 476 | } |
477 | 477 | |
478 | - if (! isset($options['charset'])) { |
|
478 | + if (!isset($options['charset'])) { |
|
479 | 479 | $options['charset'] = config('app.charset'); |
480 | 480 | } |
481 | 481 | $this->_charset = $options['charset']; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | $charset = true; |
524 | 524 | } |
525 | 525 | |
526 | - if ($charset && ! str_contains($type, ';')) { |
|
526 | + if ($charset && !str_contains($type, ';')) { |
|
527 | 527 | $this->_setHeader('Content-Type', "{$type}; charset={$this->_charset}"); |
528 | 528 | } else { |
529 | 529 | $this->_setHeader('Content-Type', $type); |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | protected function _clearHeader(string $header): void |
604 | 604 | { |
605 | 605 | $normalized = strtolower($header); |
606 | - if (! isset($this->headerNames[$normalized])) { |
|
606 | + if (!isset($this->headerNames[$normalized])) { |
|
607 | 607 | return; |
608 | 608 | } |
609 | 609 | $original = $this->headerNames[$normalized]; |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | throw HttpException::invalidStatusCode($code); |
671 | 671 | } |
672 | 672 | |
673 | - if (! array_key_exists($code, $this->_statusCodes) && empty($reasonPhrase)) { |
|
673 | + if (!array_key_exists($code, $this->_statusCodes) && empty($reasonPhrase)) { |
|
674 | 674 | throw HttpException::unkownStatusCode($code); |
675 | 675 | } |
676 | 676 | |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | if ($mapped) { |
764 | 764 | return is_array($mapped) ? current($mapped) : $mapped; |
765 | 765 | } |
766 | - if (! str_contains($contentType, '/')) { |
|
766 | + if (!str_contains($contentType, '/')) { |
|
767 | 767 | throw new InvalidArgumentException(sprintf('`%s` est un content type invalide.', $contentType)); |
768 | 768 | } |
769 | 769 | |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | */ |
847 | 847 | public function withCache($since, $time = '+1 day'): static |
848 | 848 | { |
849 | - if (! is_int($time)) { |
|
849 | + if (!is_int($time)) { |
|
850 | 850 | $time = strtotime($time); |
851 | 851 | if ($time === false) { |
852 | 852 | throw new InvalidArgumentException( |
@@ -1314,7 +1314,7 @@ discard block |
||
1314 | 1314 | */ |
1315 | 1315 | public function getCookie(string $name): ?array |
1316 | 1316 | { |
1317 | - if (! $this->hasCookie($name)) { |
|
1317 | + if (!$this->hasCookie($name)) { |
|
1318 | 1318 | return null; |
1319 | 1319 | } |
1320 | 1320 | |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | */ |
1327 | 1327 | public function hasCookie(string $name, ?string $value = null): bool |
1328 | 1328 | { |
1329 | - if (! $this->_cookies->has($name)) { |
|
1329 | + if (!$this->_cookies->has($name)) { |
|
1330 | 1330 | return false; |
1331 | 1331 | } |
1332 | 1332 | |
@@ -1403,7 +1403,7 @@ discard block |
||
1403 | 1403 | |
1404 | 1404 | $extension = strtolower($file->getExtension()); |
1405 | 1405 | $mapped = $this->getMimeType($extension); |
1406 | - if ((! $extension || ! $mapped) && $options['download'] === null) { |
|
1406 | + if ((!$extension || !$mapped) && $options['download'] === null) { |
|
1407 | 1407 | $options['download'] = true; |
1408 | 1408 | } |
1409 | 1409 | |
@@ -1465,12 +1465,12 @@ discard block |
||
1465 | 1465 | if (str_contains($path, '../') || str_contains($path, '..\\')) { |
1466 | 1466 | throw new LoadException('The requested file contains `..` and will not be read.'); |
1467 | 1467 | } |
1468 | - if (! is_file($path)) { |
|
1468 | + if (!is_file($path)) { |
|
1469 | 1469 | $path = APP_PATH . $path; |
1470 | 1470 | } |
1471 | 1471 | |
1472 | 1472 | $file = new SplFileInfo($path); |
1473 | - if (! $file->isFile() || ! $file->isReadable()) { |
|
1473 | + if (!$file->isFile() || !$file->isReadable()) { |
|
1474 | 1474 | if (on_dev()) { |
1475 | 1475 | throw new LoadException(sprintf('The requested file %s was not found or not readable', $path)); |
1476 | 1476 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function seek(int $position): void |
253 | 253 | { |
254 | - if (! isset($this->queue[$position])) { |
|
254 | + if (!isset($this->queue[$position])) { |
|
255 | 255 | throw new OutOfBoundsException(sprintf('Invalid seek position (%s).', $position)); |
256 | 256 | } |
257 | 257 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function current(): MiddlewareInterface |
273 | 273 | { |
274 | - if (! isset($this->queue[$this->position])) { |
|
274 | + if (!isset($this->queue[$this->position])) { |
|
275 | 275 | throw new OutOfBoundsException(sprintf('Position actuelle non valide (%s).', $this->position)); |
276 | 276 | } |
277 | 277 | |
@@ -343,8 +343,8 @@ discard block |
||
343 | 343 | public function resolveGroups() |
344 | 344 | { |
345 | 345 | foreach ($this->queue as $queue) { |
346 | - if (is_string($queue) && ! empty($this->groups[$queue])) { |
|
347 | - if (! is_array($this->groups[$queue])) { |
|
346 | + if (is_string($queue) && !empty($this->groups[$queue])) { |
|
347 | + if (!is_array($this->groups[$queue])) { |
|
348 | 348 | continue; |
349 | 349 | } |
350 | 350 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | // ================================= FONCTIONS UTIILITAIRES ESSENTIELLES ================================= // |
30 | 30 | |
31 | -if (! function_exists('env')) { |
|
31 | +if (!function_exists('env')) { |
|
32 | 32 | /** |
33 | 33 | * Obtient une variable d'environnement à partir des sources disponibles et fournit une émulation |
34 | 34 | * pour les variables d'environnement non prises en charge ou incohérentes |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | -if (! function_exists('helper')) { |
|
47 | +if (!function_exists('helper')) { |
|
48 | 48 | /** |
49 | 49 | * Charge un fichier d'aide en mémoire. Prend en charge les assistants d'espace de noms, |
50 | 50 | * à la fois dans et hors du répertoire 'helpers' d'un répertoire à espace de noms. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | -if (! function_exists('model')) { |
|
63 | +if (!function_exists('model')) { |
|
64 | 64 | /** |
65 | 65 | * Simple maniere d'obtenir un modele. |
66 | 66 | * |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @return T |
72 | 72 | */ |
73 | - function model(array|string $name, ?ConnectionInterface &$conn = null) |
|
73 | + function model(array|string $name, ?ConnectionInterface&$conn = null) |
|
74 | 74 | { |
75 | 75 | return Load::model($name, $conn); |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | -if (! function_exists('service')) { |
|
79 | +if (!function_exists('service')) { |
|
80 | 80 | /** |
81 | 81 | * Permet un accès plus propre au fichier de configuration des services. |
82 | 82 | * Renvoie toujours une instance SHARED de la classe, donc l'appel de la fonction plusieurs fois renvera toujours la même instance. |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
100 | -if (! function_exists('single_service')) { |
|
100 | +if (!function_exists('single_service')) { |
|
101 | 101 | /** |
102 | 102 | * Autoriser l'accès propre à un service. |
103 | 103 | * Renvoie toujours une nouvelle instance de la classe. |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | -if (! function_exists('show404')) { |
|
120 | +if (!function_exists('show404')) { |
|
121 | 121 | /** |
122 | 122 | * Afficher une page 404 introuvable dans le navigateur |
123 | 123 | */ |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | -if (! function_exists('command')) { |
|
130 | +if (!function_exists('command')) { |
|
131 | 131 | /** |
132 | 132 | * Exécute une seule commande. |
133 | 133 | * Entrée attendue dans une seule chaîne comme celle qui serait utilisée sur la ligne de commande elle-même : |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | } |
191 | 191 | |
192 | -if (! function_exists('config')) { |
|
192 | +if (!function_exists('config')) { |
|
193 | 193 | /** |
194 | 194 | * GET/SET App config |
195 | 195 | * |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
220 | -if (! function_exists('logger')) { |
|
220 | +if (!function_exists('logger')) { |
|
221 | 221 | /** |
222 | 222 | * Une méthode de commodité pour les événements de journalisation via le système Log. |
223 | 223 | * |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | } |
249 | 249 | |
250 | -if (! function_exists('cache')) { |
|
250 | +if (!function_exists('cache')) { |
|
251 | 251 | /** |
252 | 252 | * Une méthode pratique qui donne accès au cache |
253 | 253 | * objet. Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | } |
278 | 278 | } |
279 | 279 | |
280 | -if (! function_exists('cookie')) { |
|
280 | +if (!function_exists('cookie')) { |
|
281 | 281 | /** |
282 | 282 | * Une méthode pratique qui donne accès à l'objet cookie. |
283 | 283 | * Si aucun paramètre n'est fourni, renverra l'objet, |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | } |
306 | 306 | } |
307 | 307 | |
308 | -if (! function_exists('session')) { |
|
308 | +if (!function_exists('session')) { |
|
309 | 309 | /** |
310 | 310 | * Une méthode pratique pour accéder à l'instance de session, ou un élément qui a été défini dans la session. |
311 | 311 | * |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | // =========================== FONCTIONS DE PREVENTION D'ATTAQUE =========================== // |
332 | 332 | |
333 | -if (! function_exists('esc')) { |
|
333 | +if (!function_exists('esc')) { |
|
334 | 334 | /** |
335 | 335 | * Effectue un simple échappement automatique des données pour des raisons de sécurité. |
336 | 336 | * Pourrait envisager de rendre cela plus complexe à une date ultérieure. |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | } |
358 | 358 | } |
359 | 359 | |
360 | -if (! function_exists('h')) { |
|
360 | +if (!function_exists('h')) { |
|
361 | 361 | /** |
362 | 362 | * Méthode pratique pour htmlspecialchars. |
363 | 363 | * |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | } |
377 | 377 | } |
378 | 378 | |
379 | -if (! function_exists('purify')) { |
|
379 | +if (!function_exists('purify')) { |
|
380 | 380 | /** |
381 | 381 | * Purifiez l'entrée à l'aide de la classe autonome HTMLPurifier. |
382 | 382 | * Utilisez facilement plusieurs configurations de purificateur. |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | } |
393 | 393 | } |
394 | 394 | |
395 | -if (! function_exists('remove_invisible_characters')) { |
|
395 | +if (!function_exists('remove_invisible_characters')) { |
|
396 | 396 | /** |
397 | 397 | * Supprimer les caractères invisibles |
398 | 398 | * |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | } |
406 | 406 | } |
407 | 407 | |
408 | -if (! function_exists('stringify_attributes')) { |
|
408 | +if (!function_exists('stringify_attributes')) { |
|
409 | 409 | /** |
410 | 410 | * Chaîner les attributs à utiliser dans les balises HTML. |
411 | 411 | * |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | |
420 | 420 | // ================================= FONCTIONS DE FORMULAIRE ================================= // |
421 | 421 | |
422 | -if (! function_exists('csrf_token')) { |
|
422 | +if (!function_exists('csrf_token')) { |
|
423 | 423 | /** |
424 | 424 | * Renvoie la valeur de hachage actuelle pour la protection CSRF. |
425 | 425 | * 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. |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | } |
431 | 431 | } |
432 | 432 | |
433 | -if (! function_exists('csrf_field')) { |
|
433 | +if (!function_exists('csrf_field')) { |
|
434 | 434 | /** |
435 | 435 | * Génère un champ input caché à utiliser dans les formulaires générés manuellement. |
436 | 436 | */ |
@@ -438,11 +438,11 @@ discard block |
||
438 | 438 | { |
439 | 439 | $name = config('security.csrf_token_name', '_token'); |
440 | 440 | |
441 | - return '<input type="hidden"' . (! empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . $name . '" value="' . csrf_token() . '">'; |
|
441 | + return '<input type="hidden"' . (!empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . $name . '" value="' . csrf_token() . '">'; |
|
442 | 442 | } |
443 | 443 | } |
444 | 444 | |
445 | -if (! function_exists('csrf_meta')) { |
|
445 | +if (!function_exists('csrf_meta')) { |
|
446 | 446 | /** |
447 | 447 | * Génère une balise méta à utiliser dans les appels javascript. |
448 | 448 | */ |
@@ -450,11 +450,11 @@ discard block |
||
450 | 450 | { |
451 | 451 | $name = config('security.csrf_header_name', 'X-CSRF-TOKEN'); |
452 | 452 | |
453 | - return '<meta' . (! empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . $name . '" content="' . csrf_token() . '">'; |
|
453 | + return '<meta' . (!empty($id) ? ' id="' . esc($id, 'attr') . '"' : '') . ' name="' . $name . '" content="' . csrf_token() . '">'; |
|
454 | 454 | } |
455 | 455 | } |
456 | 456 | |
457 | -if (! function_exists('method_field')) { |
|
457 | +if (!function_exists('method_field')) { |
|
458 | 458 | /** |
459 | 459 | * Générer un champ de formulaire pour usurper le verbe HTTP utilisé par les formulaires. |
460 | 460 | */ |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | |
467 | 467 | // ================================= FONCTIONS D'ENVIRONNEMENT D'EXECUTION ================================= // |
468 | 468 | |
469 | -if (! function_exists('environment')) { |
|
469 | +if (!function_exists('environment')) { |
|
470 | 470 | /** |
471 | 471 | * Renvoi l'environnement d'execution actuel ou determine si on est dans un environnement specifie |
472 | 472 | * |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | } |
505 | 505 | } |
506 | 506 | |
507 | -if (! function_exists('on_dev')) { |
|
507 | +if (!function_exists('on_dev')) { |
|
508 | 508 | /** |
509 | 509 | * Testez pour voir si nous sommes dans un environnement de développement. |
510 | 510 | */ |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | } |
519 | 519 | } |
520 | 520 | |
521 | -if (! function_exists('on_prod')) { |
|
521 | +if (!function_exists('on_prod')) { |
|
522 | 522 | /** |
523 | 523 | * Testez pour voir si nous sommes dans un environnement de production. |
524 | 524 | */ |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | } |
533 | 533 | } |
534 | 534 | |
535 | -if (! function_exists('on_test')) { |
|
535 | +if (!function_exists('on_test')) { |
|
536 | 536 | /** |
537 | 537 | * Testez pour voir si nous sommes dans un environnement de test |
538 | 538 | */ |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | } |
543 | 543 | } |
544 | 544 | |
545 | -if (! function_exists('is_cli')) { |
|
545 | +if (!function_exists('is_cli')) { |
|
546 | 546 | /** |
547 | 547 | * Testez pour voir si une demande a été faite à partir de la ligne de commande. |
548 | 548 | */ |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | } |
553 | 553 | } |
554 | 554 | |
555 | -if (! function_exists('is_php')) { |
|
555 | +if (!function_exists('is_php')) { |
|
556 | 556 | /** |
557 | 557 | * Détermine si la version actuelle de PHP est égale ou supérieure à la valeur fournie. |
558 | 558 | */ |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | } |
563 | 563 | } |
564 | 564 | |
565 | -if (! function_exists('is_windows')) { |
|
565 | +if (!function_exists('is_windows')) { |
|
566 | 566 | /** |
567 | 567 | * Déterminez si l'environnement actuel est basé sur Windows. |
568 | 568 | */ |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | } |
573 | 573 | } |
574 | 574 | |
575 | -if (! function_exists('is_https')) { |
|
575 | +if (!function_exists('is_https')) { |
|
576 | 576 | /** |
577 | 577 | * Determines if the application is accessed via an encrypted * (HTTPS) connection. |
578 | 578 | */ |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | } |
583 | 583 | } |
584 | 584 | |
585 | -if (! function_exists('is_localfile')) { |
|
585 | +if (!function_exists('is_localfile')) { |
|
586 | 586 | /** |
587 | 587 | * Vérifiez si le fichier auquel vous souhaitez accéder est un fichier local de votre application ou non |
588 | 588 | */ |
@@ -592,11 +592,11 @@ discard block |
||
592 | 592 | return true; |
593 | 593 | } |
594 | 594 | |
595 | - return ! preg_match('#^(https?://)#i', $name); |
|
595 | + return !preg_match('#^(https?://)#i', $name); |
|
596 | 596 | } |
597 | 597 | } |
598 | 598 | |
599 | -if (! function_exists('is_online')) { |
|
599 | +if (!function_exists('is_online')) { |
|
600 | 600 | /** |
601 | 601 | * Tester si l'application s'exécute en local ou en ligne. |
602 | 602 | */ |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | } |
607 | 607 | } |
608 | 608 | |
609 | -if (! function_exists('is_connected')) { |
|
609 | +if (!function_exists('is_connected')) { |
|
610 | 610 | /** |
611 | 611 | * Verifie si l'utilisateur a une connexion internet active. |
612 | 612 | */ |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | } |
617 | 617 | } |
618 | 618 | |
619 | -if (! function_exists('is_ajax_request')) { |
|
619 | +if (!function_exists('is_ajax_request')) { |
|
620 | 620 | /** |
621 | 621 | * Testez pour voir si une requête contient l'en-tête HTTP_X_REQUESTED_WITH. |
622 | 622 | */ |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | } |
627 | 627 | } |
628 | 628 | |
629 | -if (! function_exists('redirection')) { |
|
629 | +if (!function_exists('redirection')) { |
|
630 | 630 | /** |
631 | 631 | * Redirige l'utilisateur |
632 | 632 | */ |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | } |
641 | 641 | } |
642 | 642 | |
643 | -if (! function_exists('redirect')) { |
|
643 | +if (!function_exists('redirect')) { |
|
644 | 644 | /** |
645 | 645 | * Méthode pratique qui fonctionne avec la $request globale actuelle et |
646 | 646 | * l'instance $router à rediriger à l'aide de routes nommées et le routage inversé |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | { |
655 | 655 | $redirection = Services::redirection(); |
656 | 656 | |
657 | - if (! empty($uri)) { |
|
657 | + if (!empty($uri)) { |
|
658 | 658 | return $redirection->route($uri); |
659 | 659 | } |
660 | 660 | |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | } |
663 | 663 | } |
664 | 664 | |
665 | -if (! function_exists('back')) { |
|
665 | +if (!function_exists('back')) { |
|
666 | 666 | /** |
667 | 667 | * Retourne a la page precedente |
668 | 668 | * |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | } |
675 | 675 | } |
676 | 676 | |
677 | -if (! function_exists('link_to')) { |
|
677 | +if (!function_exists('link_to')) { |
|
678 | 678 | /** |
679 | 679 | * Étant donné une chaîne de contrôleur/méthode et tous les paramètres, |
680 | 680 | * tentera de créer l'URL relative à la route correspondante. |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | } |
695 | 695 | } |
696 | 696 | |
697 | -if (! function_exists('clean_path')) { |
|
697 | +if (!function_exists('clean_path')) { |
|
698 | 698 | /** |
699 | 699 | * Une méthode pratique pour nettoyer les chemins pour |
700 | 700 | * une sortie plus belle. Utile pour les exceptions |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | } |
727 | 727 | } |
728 | 728 | |
729 | -if (! function_exists('old')) { |
|
729 | +if (!function_exists('old')) { |
|
730 | 730 | /** |
731 | 731 | * Fournit l'accès à "entrée ancienne" qui a été définie dans la session lors d'un redirect()-withInput(). |
732 | 732 | * |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | function old(string $key, $default = null, $escape = 'html') |
740 | 740 | { |
741 | 741 | // Assurez-vous de charger la session |
742 | - if (session_status() === PHP_SESSION_NONE && ! on_test()) { |
|
742 | + if (session_status() === PHP_SESSION_NONE && !on_test()) { |
|
743 | 743 | session(); // @codeCoverageIgnore |
744 | 744 | } |
745 | 745 | |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | |
755 | 755 | // ================================= FONCTIONS DE DEBOGAGE ================================= // |
756 | 756 | |
757 | -if (! function_exists('deprecationWarning')) { |
|
757 | +if (!function_exists('deprecationWarning')) { |
|
758 | 758 | /** |
759 | 759 | * Méthode d'assistance pour générer des avertissements d'obsolescence |
760 | 760 | * |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | } |
771 | 771 | } |
772 | 772 | |
773 | -if (! function_exists('pr')) { |
|
773 | +if (!function_exists('pr')) { |
|
774 | 774 | /** |
775 | 775 | * print_r() convenience function. |
776 | 776 | * |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | } |
793 | 793 | } |
794 | 794 | |
795 | -if (! function_exists('pj')) { |
|
795 | +if (!function_exists('pj')) { |
|
796 | 796 | /** |
797 | 797 | * json pretty print convenience function. |
798 | 798 | * |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | } |
814 | 814 | } |
815 | 815 | |
816 | -if (! function_exists('trigger_warning')) { |
|
816 | +if (!function_exists('trigger_warning')) { |
|
817 | 817 | /** |
818 | 818 | * Déclenche un E_USER_WARNING. |
819 | 819 | */ |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | |
826 | 826 | // ================================= FONCTIONS DIVERSES ================================= // |
827 | 827 | |
828 | -if (! function_exists('force_https')) { |
|
828 | +if (!function_exists('force_https')) { |
|
829 | 829 | /** |
830 | 830 | * Utilisé pour forcer l'accès à une page via HTTPS. |
831 | 831 | * Utilise une redirection standard, plus définira l'en-tête HSTS |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | |
853 | 853 | // Si la session est active, nous devons régénérer |
854 | 854 | // l'ID de session pour des raisons de sécurité. |
855 | - if (! on_test() && session_status() === PHP_SESSION_ACTIVE) { |
|
855 | + if (!on_test() && session_status() === PHP_SESSION_ACTIVE) { |
|
856 | 856 | Services::session()->regenerate(); // @codeCoverageIgnore |
857 | 857 | } |
858 | 858 | |
@@ -868,7 +868,7 @@ discard block |
||
868 | 868 | } |
869 | 869 | } |
870 | 870 | |
871 | -if (! function_exists('get_type_name')) { |
|
871 | +if (!function_exists('get_type_name')) { |
|
872 | 872 | /** |
873 | 873 | * Renvoie la classe d'objets ou le type var de ce n'est pas un objet |
874 | 874 | * |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | } |
883 | 883 | } |
884 | 884 | |
885 | -if (! function_exists('ip_address')) { |
|
885 | +if (!function_exists('ip_address')) { |
|
886 | 886 | /** |
887 | 887 | * Renvoie l'adresse IP de l'utilisateur actuel |
888 | 888 | */ |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | } |
893 | 893 | } |
894 | 894 | |
895 | -if (! function_exists('is_really_writable')) { |
|
895 | +if (!function_exists('is_really_writable')) { |
|
896 | 896 | /** |
897 | 897 | * Tests d'inscriptibilité des fichiers |
898 | 898 | */ |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | } |
903 | 903 | } |
904 | 904 | |
905 | -if (! function_exists('lang')) { |
|
905 | +if (!function_exists('lang')) { |
|
906 | 906 | /** |
907 | 907 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
908 | 908 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | } |
914 | 914 | } |
915 | 915 | |
916 | -if (! function_exists('__')) { |
|
916 | +if (!function_exists('__')) { |
|
917 | 917 | /** |
918 | 918 | * Une méthode pratique pour traduire une chaîne ou un tableau d'entrées et formater |
919 | 919 | * le résultat avec le MessageFormatter de l'extension intl. |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | } |
927 | 927 | } |
928 | 928 | |
929 | -if (! function_exists('namespace_split')) { |
|
929 | +if (!function_exists('namespace_split')) { |
|
930 | 930 | /** |
931 | 931 | * Séparez l'espace de noms du nom de classe. |
932 | 932 | * |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | } |
948 | 948 | } |
949 | 949 | |
950 | -if (! function_exists('view_exist')) { |
|
950 | +if (!function_exists('view_exist')) { |
|
951 | 951 | /** |
952 | 952 | * Verifie si un fichier de vue existe. Utile pour limiter les failles include |
953 | 953 | */ |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | } |
958 | 958 | } |
959 | 959 | |
960 | -if (! function_exists('view')) { |
|
960 | +if (!function_exists('view')) { |
|
961 | 961 | /** |
962 | 962 | * Charge une vue |
963 | 963 | * |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | } |
970 | 970 | } |
971 | 971 | |
972 | -if (! function_exists('flash')) { |
|
972 | +if (!function_exists('flash')) { |
|
973 | 973 | /** |
974 | 974 | * Fournisseur d'acces rapide a la classe PHP Flash |
975 | 975 | * |
@@ -1001,7 +1001,7 @@ discard block |
||
1001 | 1001 | }*/ |
1002 | 1002 | } |
1003 | 1003 | |
1004 | -if (! function_exists('geo_ip')) { |
|
1004 | +if (!function_exists('geo_ip')) { |
|
1005 | 1005 | /** |
1006 | 1006 | * Recuperation des coordonnees (pays, ville, etc) d'un utilisateur en fonction de son ip |
1007 | 1007 | */ |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | } |
1012 | 1012 | } |
1013 | 1013 | |
1014 | -if (! function_exists('to_stream')) { |
|
1014 | +if (!function_exists('to_stream')) { |
|
1015 | 1015 | /** |
1016 | 1016 | * Créez un nouveau flux basé sur le type d'entrée. |
1017 | 1017 | * |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | } |
1033 | 1033 | } |
1034 | 1034 | |
1035 | -if (! function_exists('value')) { |
|
1035 | +if (!function_exists('value')) { |
|
1036 | 1036 | /** |
1037 | 1037 | * Renvoie la valeur par défaut de la valeur donnée. |
1038 | 1038 | */ |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | } |
1043 | 1043 | } |
1044 | 1044 | |
1045 | -if (! function_exists('collect')) { |
|
1045 | +if (!function_exists('collect')) { |
|
1046 | 1046 | /** |
1047 | 1047 | * Créez une collection à partir de la valeur donnée. |
1048 | 1048 | */ |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | } |
1053 | 1053 | } |
1054 | 1054 | |
1055 | -if (! function_exists('with')) { |
|
1055 | +if (!function_exists('with')) { |
|
1056 | 1056 | /** |
1057 | 1057 | * Renvoie la valeur donnée, éventuellement transmise via le rappel donné. |
1058 | 1058 | * |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | } |
1065 | 1065 | } |
1066 | 1066 | |
1067 | -if (! function_exists('tap')) { |
|
1067 | +if (!function_exists('tap')) { |
|
1068 | 1068 | /** |
1069 | 1069 | * Appelez la Closure donnée avec cette instance puis renvoyez l'instance. |
1070 | 1070 | */ |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | } |
1075 | 1075 | } |
1076 | 1076 | |
1077 | -if (! function_exists('last')) { |
|
1077 | +if (!function_exists('last')) { |
|
1078 | 1078 | /** |
1079 | 1079 | * Recupere le dernier element d'un tableau |
1080 | 1080 | * |
@@ -1090,7 +1090,7 @@ discard block |
||
1090 | 1090 | } |
1091 | 1091 | } |
1092 | 1092 | |
1093 | -if (! function_exists('invade')) { |
|
1093 | +if (!function_exists('invade')) { |
|
1094 | 1094 | /** |
1095 | 1095 | * Cette classe offre une fonction d'invasion qui vous permettra de lire / écrire des propriétés privées d'un objet. |
1096 | 1096 | * Il vous permettra également de définir, obtenir et appeler des méthodes privées. |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $controller = $routes->getDefaultController(); |
178 | 178 | } |
179 | 179 | |
180 | - if (! $fullName && is_string($controller)) { |
|
180 | + if (!$fullName && is_string($controller)) { |
|
181 | 181 | $controller = str_replace($routes->getDefaultNamespace(), '', $controller); |
182 | 182 | } |
183 | 183 | |
@@ -300,14 +300,14 @@ discard block |
||
300 | 300 | return; |
301 | 301 | } |
302 | 302 | |
303 | - if (is_cli() && ! on_test()) { |
|
303 | + if (is_cli() && !on_test()) { |
|
304 | 304 | // @codeCoverageIgnoreStart |
305 | 305 | // $this->request = Services::clirequest($this->config); |
306 | 306 | // @codeCoverageIgnoreEnd |
307 | 307 | } |
308 | 308 | |
309 | 309 | $version = $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1'; |
310 | - if (! is_numeric($version)) { |
|
310 | + if (!is_numeric($version)) { |
|
311 | 311 | $version = substr($version, strpos($version, '/') + 1); |
312 | 312 | } |
313 | 313 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | // Supposons le succès jusqu'à preuve du contraire. |
327 | 327 | $this->response = Services::response()->withStatus(200); |
328 | 328 | |
329 | - if (! is_cli() || on_test()) { |
|
329 | + if (!is_cli() || on_test()) { |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | $this->response = $this->response->withProtocolVersion($this->request->getProtocolVersion()); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | } |
411 | 411 | |
412 | 412 | // Essayez de charger automatiquement la classe |
413 | - if (! class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) { |
|
413 | + if (!class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) { |
|
414 | 414 | throw PageNotFoundException::controllerNotFound($this->controller, $this->method); |
415 | 415 | } |
416 | 416 | |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | |
502 | 502 | $this->outputBufferingEnd(); |
503 | 503 | |
504 | - throw PageNotFoundException::pageNotFound(! on_prod() || is_cli() ? $e->getMessage() : ''); |
|
504 | + throw PageNotFoundException::pageNotFound(!on_prod() || is_cli() ? $e->getMessage() : ''); |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | /** |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | public function storePreviousURL($uri) |
544 | 544 | { |
545 | 545 | // Ignorer les requêtes CLI |
546 | - if (is_cli() && ! on_test()) { |
|
546 | + if (is_cli() && !on_test()) { |
|
547 | 547 | return; // @codeCoverageIgnore |
548 | 548 | } |
549 | 549 | |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | } |
554 | 554 | |
555 | 555 | // Ignorer les reponses non-HTML |
556 | - if (! str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) { |
|
556 | + if (!str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) { |
|
557 | 557 | return; |
558 | 558 | } |
559 | 559 | |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | protected function sendResponse() |
579 | 579 | { |
580 | - if (! $this->isAjaxRequest()) { |
|
580 | + if (!$this->isAjaxRequest()) { |
|
581 | 581 | $this->response = Services::toolbar()->prepare( |
582 | 582 | $this->getPerformanceStats(), |
583 | 583 | $this->request, |
@@ -670,11 +670,11 @@ discard block |
||
670 | 670 | */ |
671 | 671 | private function spoofRequestMethod(): callable |
672 | 672 | { |
673 | - return static function (ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
673 | + return static function(ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
674 | 674 | $post = $request->getParsedBody(); |
675 | 675 | |
676 | 676 | // Ne fonctionne qu'avec les formulaires POST |
677 | - if ($request->getMethod() === Method::POST && ! empty($post['_method'])) { |
|
677 | + if ($request->getMethod() === Method::POST && !empty($post['_method'])) { |
|
678 | 678 | // Accepte seulement PUT, PATCH, DELETE |
679 | 679 | if (in_array($post['_method'], [Method::PUT, Method::PATCH, Method::DELETE], true)) { |
680 | 680 | $request = $request->withMethod($post['_method']); |
@@ -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 |