@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $this->cookies = $config['cookies']; |
233 | 233 | |
234 | 234 | if (isset($config['uri'])) { |
235 | - if (! $config['uri'] instanceof UriInterface) { |
|
235 | + if (!$config['uri'] instanceof UriInterface) { |
|
236 | 236 | throw new FrameworkException('The `uri` key must be an instance of ' . UriInterface::class); |
237 | 237 | } |
238 | 238 | $uri = $config['uri']; |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | $this->stream = $stream; |
266 | 266 | |
267 | 267 | $post = $config['post']; |
268 | - if (! (is_array($post) || is_object($post) || $post === null)) { |
|
268 | + if (!(is_array($post) || is_object($post) || $post === null)) { |
|
269 | 269 | throw new InvalidArgumentException(sprintf( |
270 | 270 | 'La clé `post` doit être un tableau, un objet ou null. On a obtenu `%s` à la place.', |
271 | 271 | get_debug_type($post) |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | } |
449 | 449 | |
450 | 450 | $type = strtolower($type); |
451 | - if (! isset(static::$_detectors[$type])) { |
|
451 | + if (!isset(static::$_detectors[$type])) { |
|
452 | 452 | return false; |
453 | 453 | } |
454 | 454 | if ($args !== []) { |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | public function isAll(array $types): bool |
601 | 601 | { |
602 | 602 | foreach ($types as $type) { |
603 | - if (! $this->is($type)) { |
|
603 | + if (!$this->is($type)) { |
|
604 | 604 | return false; |
605 | 605 | } |
606 | 606 | } |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | protected function normalizeHeaderName(string $name): string |
705 | 705 | { |
706 | 706 | $name = str_replace('-', '_', strtoupper($name)); |
707 | - if (! in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
707 | + if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
708 | 708 | $name = 'HTTP_' . $name; |
709 | 709 | } |
710 | 710 | |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | { |
891 | 891 | $new = clone $this; |
892 | 892 | |
893 | - if (! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) { |
|
893 | + if (!preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) { |
|
894 | 894 | throw new InvalidArgumentException(sprintf( |
895 | 895 | 'Méthode HTTP non prise en charge "%s" fournie', |
896 | 896 | $method |
@@ -1150,7 +1150,7 @@ discard block |
||
1150 | 1150 | } |
1151 | 1151 | } |
1152 | 1152 | |
1153 | - if (! isset($accept[$prefValue])) { |
|
1153 | + if (!isset($accept[$prefValue])) { |
|
1154 | 1154 | $accept[$prefValue] = []; |
1155 | 1155 | } |
1156 | 1156 | if ($prefValue !== '' && $prefValue !== '0') { |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | if ($name === null) { |
1229 | 1229 | return $this->data; |
1230 | 1230 | } |
1231 | - if (! is_array($this->data)) { |
|
1231 | + if (!is_array($this->data)) { |
|
1232 | 1232 | return $default; |
1233 | 1233 | } |
1234 | 1234 | |
@@ -1368,7 +1368,7 @@ discard block |
||
1368 | 1368 | */ |
1369 | 1369 | public function withProtocolVersion(string $version): static |
1370 | 1370 | { |
1371 | - if (! preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) { |
|
1371 | + if (!preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) { |
|
1372 | 1372 | throw new InvalidArgumentException(sprintf('Version de protocole `%s` non prise en charge fournie.', $version)); |
1373 | 1373 | } |
1374 | 1374 | $new = clone $this; |
@@ -1390,7 +1390,7 @@ discard block |
||
1390 | 1390 | public function getEnv(string $key, ?string $default = null): ?string |
1391 | 1391 | { |
1392 | 1392 | $key = strtoupper($key); |
1393 | - if (! array_key_exists($key, $this->_environment) || null === $this->_environment[$key]) { |
|
1393 | + if (!array_key_exists($key, $this->_environment) || null === $this->_environment[$key]) { |
|
1394 | 1394 | $this->_environment[$key] = env($key, $default); |
1395 | 1395 | } |
1396 | 1396 | |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | $file = Arr::get($this->uploadedFiles, $path); |
1608 | 1608 | if (is_array($file)) { |
1609 | 1609 | foreach ($file as $f) { |
1610 | - if (! ($f instanceof UploadedFile)) { |
|
1610 | + if (!($f instanceof UploadedFile)) { |
|
1611 | 1611 | return null; |
1612 | 1612 | } |
1613 | 1613 | } |
@@ -1615,7 +1615,7 @@ discard block |
||
1615 | 1615 | return $file; |
1616 | 1616 | } |
1617 | 1617 | |
1618 | - if (! ($file instanceof UploadedFileInterface)) { |
|
1618 | + if (!($file instanceof UploadedFileInterface)) { |
|
1619 | 1619 | return null; |
1620 | 1620 | } |
1621 | 1621 | |
@@ -1663,7 +1663,7 @@ discard block |
||
1663 | 1663 | continue; |
1664 | 1664 | } |
1665 | 1665 | |
1666 | - if (! $file instanceof UploadedFileInterface) { |
|
1666 | + if (!$file instanceof UploadedFileInterface) { |
|
1667 | 1667 | throw new InvalidArgumentException("Fichier invalide à `{$path}{$key}`"); |
1668 | 1668 | } |
1669 | 1669 | } |
@@ -1716,7 +1716,7 @@ discard block |
||
1716 | 1716 | if (empty($host = $uri->getHost())) { |
1717 | 1717 | return $new; |
1718 | 1718 | } |
1719 | - if (! empty($port = $uri->getPort())) { |
|
1719 | + if (!empty($port = $uri->getPort())) { |
|
1720 | 1720 | $host .= ':' . $port; |
1721 | 1721 | } |
1722 | 1722 | $new->_environment['HTTP_HOST'] = $host; |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | $validLocales = config('app.supported_locales'); |
1813 | 1813 | // S'il ne s'agit pas d'un paramètre régional valide, définissez-le |
1814 | 1814 | // aux paramètres régionaux par défaut du site. |
1815 | - if (! in_array($locale, $validLocales, true)) { |
|
1815 | + if (!in_array($locale, $validLocales, true)) { |
|
1816 | 1816 | $locale = config('app.language'); |
1817 | 1817 | } |
1818 | 1818 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function __construct(protected array $listeners = []) |
43 | 43 | { |
44 | - if (! array_key_exists(self::WILDCARD, $this->listeners)) { |
|
44 | + if (!array_key_exists(self::WILDCARD, $this->listeners)) { |
|
45 | 45 | $this->listeners[self::WILDCARD] = []; |
46 | 46 | } |
47 | 47 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return array_filter($this->listeners, static fn ($key) => $key !== self::WILDCARD, ARRAY_FILTER_USE_KEY); |
53 | 53 | } |
54 | 54 | |
55 | - if (! array_key_exists($event, $this->listeners)) { |
|
55 | + if (!array_key_exists($event, $this->listeners)) { |
|
56 | 56 | return []; |
57 | 57 | } |
58 | 58 | |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function on(string $event, callable $callback, int $priority = 0): bool |
78 | 78 | { |
79 | - if (! array_key_exists($event, $this->listeners)) { |
|
79 | + if (!array_key_exists($event, $this->listeners)) { |
|
80 | 80 | $this->listeners[$event] = []; |
81 | 81 | } |
82 | - if (! array_key_exists($priority, $this->listeners[$event])) { |
|
82 | + if (!array_key_exists($priority, $this->listeners[$event])) { |
|
83 | 83 | $this->listeners[$event][$priority] = []; |
84 | 84 | } |
85 | 85 | |
86 | - if (! in_array($callback, $this->listeners[$event][$priority], true)) { |
|
86 | + if (!in_array($callback, $this->listeners[$event][$priority], true)) { |
|
87 | 87 | $this->listeners[$event][$priority][] = $callback; |
88 | 88 | |
89 | 89 | return true; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function off(string $event, callable $callback): bool |
107 | 107 | { |
108 | - if (! array_key_exists($event, $this->listeners) || ! $this->listeners[$event]) { |
|
108 | + if (!array_key_exists($event, $this->listeners) || !$this->listeners[$event]) { |
|
109 | 109 | return false; |
110 | 110 | } |
111 | 111 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function emit($event, $target = null, $argv = []) |
138 | 138 | { |
139 | - if (! ($event instanceof EventInterface)) { |
|
139 | + if (!($event instanceof EventInterface)) { |
|
140 | 140 | $event = new Event($event, $target, $argv); |
141 | 141 | } else { |
142 | 142 | if ($target) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | $eventName = $event->getName(); |
151 | - if (! array_key_exists($eventName, $this->listeners)) { |
|
151 | + if (!array_key_exists($eventName, $this->listeners)) { |
|
152 | 152 | $this->listeners[$eventName] = []; |
153 | 153 | } |
154 | 154 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | ksort($events, SORT_NUMERIC); |
159 | 159 | |
160 | 160 | foreach ($events as $priority) { |
161 | - if (! is_array($priority)) { |
|
161 | + if (!is_array($priority)) { |
|
162 | 162 | continue; |
163 | 163 | } |
164 | 164 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | $this->renderVars['file'] = $this->getRenderedFile($options, $this->renderVars['view'], $this->ext); |
68 | 68 | |
69 | - if (! empty($layout = $this->layout)) { |
|
69 | + if (!empty($layout = $this->layout)) { |
|
70 | 70 | $pathinfo = pathinfo($layout, PATHINFO_EXTENSION); |
71 | 71 | if ($pathinfo === [] || $pathinfo === '' || $pathinfo === '0') { |
72 | 72 | $layout .= '.' . $this->ext; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $this->engine->assign($this->data); |
78 | 78 | |
79 | 79 | // Doit-on mettre en cache? |
80 | - if (! empty($this->renderVars['options']['cache_name']) || ! empty($this->renderVars['options']['cache'])) { |
|
80 | + if (!empty($this->renderVars['options']['cache_name']) || !empty($this->renderVars['options']['cache'])) { |
|
81 | 81 | $this->enableCache(); |
82 | 82 | $this->engine->setCacheLifetime(60 * ($this->renderVars['options']['cache'] ?? 60)); |
83 | 83 | $this->engine->setCompileId($this->renderVars['options']['cache_name'] ?? null); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $class = $this->translateURI($segment); |
162 | 162 | |
163 | 163 | // dès que nous rencontrons un segment qui n'est pas compatible PSR-4, arrêter la recherche |
164 | - if (! $this->isValidSegment($class)) { |
|
164 | + if (!$this->isValidSegment($class)) { |
|
165 | 165 | return false; |
166 | 166 | } |
167 | 167 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | throw new MethodNotFoundException(); |
388 | 388 | } |
389 | 389 | |
390 | - if (! $refMethod->isPublic()) { |
|
390 | + if (!$refMethod->isPublic()) { |
|
391 | 391 | throw new MethodNotFoundException(); |
392 | 392 | } |
393 | 393 | |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | return; |
450 | 450 | } |
451 | 451 | |
452 | - if (! in_array(ltrim($classname, '\\'), get_declared_classes(), true)) { |
|
452 | + if (!in_array(ltrim($classname, '\\'), get_declared_classes(), true)) { |
|
453 | 453 | throw new PageNotFoundException( |
454 | 454 | '"' . $classname . '" n\'a pas été trouvé.' |
455 | 455 | ); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | // Mais si un visiteur navigue vers l'URI `controller/somemethod`, `getSomemethod()` sera vérifié, et `method_exists()` retournera true parce que les noms de méthodes en PHP sont insensibles à la casse. |
474 | 474 | method_exists($this->controller, $method) |
475 | 475 | // Mais nous n'autorisons pas `controller/somemethod`, donc vérifiez le nom exact de la méthode. |
476 | - && ! in_array($method, get_class_methods($this->controller), true) |
|
476 | + && !in_array($method, get_class_methods($this->controller), true) |
|
477 | 477 | ) { |
478 | 478 | throw new PageNotFoundException( |
479 | 479 | '"' . $this->controller . '::' . $method . '()" n\'a pas été trouvé.' |
@@ -84,14 +84,14 @@ |
||
84 | 84 | $command = is_string($command) ? $command : 'command:name'; |
85 | 85 | $type = is_string($type) ? $type : 'basic'; |
86 | 86 | |
87 | - if (! in_array($type, ['basic', 'generator'], true)) { |
|
87 | + if (!in_array($type, ['basic', 'generator'], true)) { |
|
88 | 88 | // @codeCoverageIgnoreStart |
89 | 89 | $type = $this->choice(lang('CLI.generator.commandType'), ['basic', 'generator'], 'basic'); |
90 | 90 | $this->eol(); |
91 | 91 | // @codeCoverageIgnoreEnd |
92 | 92 | } |
93 | 93 | |
94 | - if (! is_string($group)) { |
|
94 | + if (!is_string($group)) { |
|
95 | 95 | $group = $type === 'generator' ? config('app.name') . ':Generateurs' : config('app.name'); |
96 | 96 | } |
97 | 97 |