@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $input = $this->all(); |
88 | 88 | |
89 | 89 | foreach ($keys as $value) { |
90 | - if (! Arr::has($input, $value)) { |
|
90 | + if (!Arr::has($input, $value)) { |
|
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $keys = is_array($key) ? $key : func_get_args(); |
150 | 150 | |
151 | 151 | foreach ($keys as $value) { |
152 | - if (! $this->isEmptyString($value)) { |
|
152 | + if (!$this->isEmptyString($value)) { |
|
153 | 153 | return false; |
154 | 154 | } |
155 | 155 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $keys = is_array($key) ? $key : func_get_args(); |
200 | 200 | |
201 | - return ! $this->has($keys); |
|
201 | + return !$this->has($keys); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | { |
227 | 227 | $value = $this->input($key); |
228 | 228 | |
229 | - return ! is_bool($value) && ! is_array($value) && trim((string) $value) === ''; |
|
229 | + return !is_bool($value) && !is_array($value) && trim((string) $value) === ''; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | { |
247 | 247 | $input = array_replace_recursive($this->input(), $this->allFiles()); |
248 | 248 | |
249 | - if (! $keys) { |
|
249 | + if (!$keys) { |
|
250 | 250 | return $input; |
251 | 251 | } |
252 | 252 | |
@@ -341,9 +341,9 @@ discard block |
||
341 | 341 | public function enum(string $key, $enumClass) |
342 | 342 | { |
343 | 343 | if ($this->isNotFilled($key) |
344 | - || ! function_exists('enum_exists') |
|
345 | - || ! enum_exists($enumClass) |
|
346 | - || ! method_exists($enumClass, 'tryFrom')) { |
|
344 | + || !function_exists('enum_exists') |
|
345 | + || !enum_exists($enumClass) |
|
346 | + || !method_exists($enumClass, 'tryFrom')) { |
|
347 | 347 | return null; |
348 | 348 | } |
349 | 349 | |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | */ |
458 | 458 | public function hasFile(string $key): bool |
459 | 459 | { |
460 | - if (! is_array($files = $this->file($key))) { |
|
460 | + if (!is_array($files = $this->file($key))) { |
|
461 | 461 | $files = [$files]; |
462 | 462 | } |
463 | 463 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $override = true; |
97 | 97 | } |
98 | 98 | |
99 | - if ($override && ! in_array($request->getMethod(), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
99 | + if ($override && !in_array($request->getMethod(), ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
100 | 100 | $parsedBody = []; |
101 | 101 | } |
102 | 102 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $request = $request->withUploadedFiles($files); |
115 | 115 | |
116 | 116 | $parsedBody = $request->getParsedBody(); |
117 | - if (! is_array($parsedBody)) { |
|
117 | + if (!is_array($parsedBody)) { |
|
118 | 118 | return $request; |
119 | 119 | } |
120 | 120 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | // Si la valeur HTTP_AUTHORIZATION est déjà définie, ou si le callback n'est pas appelable, nous renvoyons les parameters server sans changements |
171 | - if (isset($server['HTTP_AUTHORIZATION']) || ! is_callable($apacheRequestHeaderCallback)) { |
|
171 | + if (isset($server['HTTP_AUTHORIZATION']) || !is_callable($apacheRequestHeaderCallback)) { |
|
172 | 172 | return $server; |
173 | 173 | } |
174 | 174 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | public function isCorsRequest(ServerRequestInterface $request): bool |
59 | 59 | { |
60 | - return $request->hasHeader('Origin') && ! $this->isSameHost($request); |
|
60 | + return $request->hasHeader('Origin') && !$this->isSameHost($request); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function isPreflightRequest(ServerRequestInterface $request): bool |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | return true; |
95 | 95 | } |
96 | 96 | |
97 | - if (! $request->hasHeader('Origin')) { |
|
97 | + if (!$request->hasHeader('Origin')) { |
|
98 | 98 | return false; |
99 | 99 | } |
100 | 100 | |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | |
128 | 128 | public function varyHeader(ResponseInterface $response, $header): ResponseInterface |
129 | 129 | { |
130 | - if (! $response->hasHeader('Vary')) { |
|
130 | + if (!$response->hasHeader('Vary')) { |
|
131 | 131 | $response = $response->withHeader('Vary', $header); |
132 | - } elseif (! in_array($header, explode(', ', $response->getHeaderLine('Vary')), true)) { |
|
132 | + } elseif (!in_array($header, explode(', ', $response->getHeaderLine('Vary')), true)) { |
|
133 | 133 | $response = $response->withHeader('Vary', $response->getHeaderLine('Vary') . ', ' . $header); |
134 | 134 | } |
135 | 135 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | protected function configureAllowedOrigin(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface |
140 | 140 | { |
141 | - if ($this->options['allowedOrigins'] === true && ! $this->options['supportsCredentials']) { |
|
141 | + if ($this->options['allowedOrigins'] === true && !$this->options['supportsCredentials']) { |
|
142 | 142 | // Sûr+cacheable, tout autoriser |
143 | 143 | $response = $response->withHeader('Access-Control-Allow-Origin', '*'); |
144 | 144 | } elseif ($this->isSingleOriginAllowed()) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | protected function isSingleOriginAllowed(): bool |
160 | 160 | { |
161 | - if ($this->options['allowedOrigins'] === true || ! empty($this->options['allowedOriginsPatterns'])) { |
|
161 | + if ($this->options['allowedOrigins'] === true || !empty($this->options['allowedOriginsPatterns'])) { |
|
162 | 162 | return false; |
163 | 163 | } |
164 | 164 |
@@ -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 |
@@ -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 | */ |
@@ -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 |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $possibleView2 = $directory . $viewName . '.php'; |
80 | 80 | } |
81 | 81 | |
82 | - if ($view !== '' && ! is_file($view)) { |
|
82 | + if ($view !== '' && !is_file($view)) { |
|
83 | 83 | $directory = dirname((new ReflectionClass($this))->getFileName()) . DIRECTORY_SEPARATOR; |
84 | 84 | |
85 | 85 | $view = $directory . $view . '.php'; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | $foundView = current($candidateViews); |
101 | 101 | |
102 | - return (function () use ($properties, $foundView): string { |
|
102 | + return (function() use ($properties, $foundView): string { |
|
103 | 103 | extract($properties); |
104 | 104 | ob_start(); |
105 | 105 | include $foundView; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | $key = $this->_key($key); |
75 | 75 | |
76 | - if (! isset($this->cache[$key])) { |
|
76 | + if (!isset($this->cache[$key])) { |
|
77 | 77 | return false; |
78 | 78 | } |
79 | 79 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | if ($data === null) { |
113 | 113 | $data = 0; |
114 | - } elseif (! is_int($data)) { |
|
114 | + } elseif (!is_int($data)) { |
|
115 | 115 | return false; |
116 | 116 | } |
117 | 117 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | if ($data === null) { |
131 | 131 | $data = 0; |
132 | - } elseif (! is_int($data)) { |
|
132 | + } elseif (!is_int($data)) { |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | public function getMetaData(string $key): ?array |
175 | 175 | { |
176 | 176 | // n'existe pas, retourne null |
177 | - if (! array_key_exists($key, $this->expirations)) { |
|
177 | + if (!array_key_exists($key, $this->expirations)) { |
|
178 | 178 | return null; |
179 | 179 | } |
180 | 180 |