@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | // Si cela semble être une URL relative, alors convertissez-la en URL complète |
65 | 65 | // pour une meilleure sécurité. |
66 | - if (! str_starts_with($uri, 'http')) { |
|
66 | + if (!str_starts_with($uri, 'http')) { |
|
67 | 67 | $uri = site_url($uri); |
68 | 68 | } |
69 | 69 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | $request = $this->generator->getRequest(); |
126 | 126 | |
127 | - $intended = $request->method() === 'GET' && ! $request->expectsJson() |
|
127 | + $intended = $request->method() === 'GET' && !$request->expectsJson() |
|
128 | 128 | ? $this->generator->full() |
129 | 129 | : $this->generator->previous(); |
130 | 130 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $errors = [$key => $errors]; |
179 | 179 | } |
180 | 180 | |
181 | - if (! empty($errors)) { |
|
181 | + if (!empty($errors)) { |
|
182 | 182 | Services::viewer()->share('errors', new ErrorBag($this->session->flashErrors($errors, $key))); |
183 | 183 | } |
184 | 184 |
@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | |
173 | 173 | $authority = $this->host; |
174 | 174 | |
175 | - if (! empty($this->getUserInfo())) { |
|
175 | + if (!empty($this->getUserInfo())) { |
|
176 | 176 | $authority = $this->getUserInfo() . '@' . $authority; |
177 | 177 | } |
178 | 178 | |
179 | - if (! empty($this->port) && ! $ignorePort) { |
|
179 | + if (!empty($this->port) && !$ignorePort) { |
|
180 | 180 | // N'ajoute pas de port s'il s'agit d'un port standard pour ce schéma |
181 | 181 | if ($this->port !== $this->defaultPorts[$this->scheme]) { |
182 | 182 | $authority .= ':' . $this->port; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | { |
196 | 196 | $userInfo = $this->user; |
197 | 197 | |
198 | - if ($this->showPassword === true && ! empty($this->password)) { |
|
198 | + if ($this->showPassword === true && !empty($this->password)) { |
|
199 | 199 | $userInfo .= ':' . $this->password; |
200 | 200 | } |
201 | 201 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $vars = $this->query; |
246 | 246 | |
247 | 247 | if (array_key_exists('except', $options)) { |
248 | - if (! is_array($options['except'])) { |
|
248 | + if (!is_array($options['except'])) { |
|
249 | 249 | $options['except'] = [$options['except']]; |
250 | 250 | } |
251 | 251 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | } elseif (array_key_exists('only', $options)) { |
256 | 256 | $temp = []; |
257 | 257 | |
258 | - if (! is_array($options['only'])) { |
|
258 | + if (!is_array($options['only'])) { |
|
259 | 259 | $options['only'] = [$options['only']]; |
260 | 260 | } |
261 | 261 | |
@@ -356,11 +356,11 @@ discard block |
||
356 | 356 | public static function createURIString(?string $scheme = null, ?string $authority = null, ?string $path = null, ?string $query = null, ?string $fragment = null): string |
357 | 357 | { |
358 | 358 | $uri = ''; |
359 | - if (! empty($scheme)) { |
|
359 | + if (!empty($scheme)) { |
|
360 | 360 | $uri .= $scheme . '://'; |
361 | 361 | } |
362 | 362 | |
363 | - if (! empty($authority)) { |
|
363 | + if (!empty($authority)) { |
|
364 | 364 | $uri .= $authority; |
365 | 365 | } |
366 | 366 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | { |
387 | 387 | $parts = parse_url($str); |
388 | 388 | |
389 | - if (empty($parts['host']) && ! empty($parts['path'])) { |
|
389 | + if (empty($parts['host']) && !empty($parts['path'])) { |
|
390 | 390 | $parts['host'] = $parts['path']; |
391 | 391 | unset($parts['path']); |
392 | 392 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | } |
532 | 532 | |
533 | 533 | // Ne peut pas avoir de début ? |
534 | - if (! empty($query) && str_starts_with($query, '?')) { |
|
534 | + if (!empty($query) && str_starts_with($query, '?')) { |
|
535 | 535 | $query = substr($query, 1); |
536 | 536 | } |
537 | 537 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $temp = []; |
597 | 597 | |
598 | 598 | foreach ($this->query as $key => $value) { |
599 | - if (! in_array($key, $params, true)) { |
|
599 | + if (!in_array($key, $params, true)) { |
|
600 | 600 | continue; |
601 | 601 | } |
602 | 602 | |
@@ -667,19 +667,19 @@ discard block |
||
667 | 667 | */ |
668 | 668 | protected function applyParts(array $parts) |
669 | 669 | { |
670 | - if (! empty($parts['host'])) { |
|
670 | + if (!empty($parts['host'])) { |
|
671 | 671 | $this->host = $parts['host']; |
672 | 672 | } |
673 | - if (! empty($parts['user'])) { |
|
673 | + if (!empty($parts['user'])) { |
|
674 | 674 | $this->user = $parts['user']; |
675 | 675 | } |
676 | - if (! empty($parts['path'])) { |
|
676 | + if (!empty($parts['path'])) { |
|
677 | 677 | $this->path = $this->filterPath($parts['path']); |
678 | 678 | } |
679 | - if (! empty($parts['query'])) { |
|
679 | + if (!empty($parts['query'])) { |
|
680 | 680 | $this->setQuery($parts['query']); |
681 | 681 | } |
682 | - if (! empty($parts['fragment'])) { |
|
682 | + if (!empty($parts['fragment'])) { |
|
683 | 683 | $this->fragment = $parts['fragment']; |
684 | 684 | } |
685 | 685 | |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | $this->password = $parts['pass']; |
702 | 702 | } |
703 | 703 | |
704 | - if (! empty($parts['path'])) { |
|
704 | + if (!empty($parts['path'])) { |
|
705 | 705 | $this->segments = explode('/', trim($parts['path'], '/')); |
706 | 706 | } |
707 | 707 | } |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | $transformed = clone $relative; |
729 | 729 | |
730 | 730 | // 5.2.2 Transformer les références dans une méthode non stricte (pas de schéma) |
731 | - if (! empty($relative->getAuthority())) { |
|
731 | + if (!empty($relative->getAuthority())) { |
|
732 | 732 | $transformed->setAuthority($relative->getAuthority()) |
733 | 733 | ->setPath($relative->getPath()) |
734 | 734 | ->setQuery($relative->getQuery()); |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | */ |
769 | 769 | protected function mergePaths(self $base, self $reference): string |
770 | 770 | { |
771 | - if (! empty($base->getAuthority()) && empty($base->getPath())) { |
|
771 | + if (!empty($base->getAuthority()) && empty($base->getPath())) { |
|
772 | 772 | return '/' . ltrim($reference->getPath(), '/ '); |
773 | 773 | } |
774 | 774 |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | { |
256 | 256 | $route = $this->routes->reverseRoute($name, ...$parameters); |
257 | 257 | |
258 | - if (! $route) { |
|
258 | + if (!$route) { |
|
259 | 259 | throw HttpException::invalidRedirectRoute($route); |
260 | 260 | } |
261 | 261 | |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | */ |
333 | 333 | public function isValidUrl(string $path): bool |
334 | 334 | { |
335 | - if (! preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) { |
|
335 | + if (!preg_match('~^(#|//|https?://|(mailto|tel|sms):)~', $path)) { |
|
336 | 336 | return filter_var($path, FILTER_VALIDATE_URL) !== false; |
337 | 337 | } |
338 | 338 |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $this->cookies = $config['cookies']; |
257 | 257 | |
258 | 258 | if (isset($config['uri'])) { |
259 | - if (! $config['uri'] instanceof UriInterface) { |
|
259 | + if (!$config['uri'] instanceof UriInterface) { |
|
260 | 260 | throw new FrameworkException('The `uri` key must be an instance of ' . UriInterface::class); |
261 | 261 | } |
262 | 262 | $uri = $config['uri']; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $ref = $this->getEnv('HTTP_REFERER'); |
397 | 397 | |
398 | 398 | $base = /* Configure::read('App.fullBaseUrl') . */ $this->webroot; |
399 | - if (! empty($ref) && ! empty($base)) { |
|
399 | + if (!empty($ref) && !empty($base)) { |
|
400 | 400 | if ($local && str_starts_with($ref, $base)) { |
401 | 401 | $ref = substr($ref, strlen($base)); |
402 | 402 | if ($ref === '' || str_starts_with($ref, '//')) { |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | |
409 | 409 | return $ref; |
410 | 410 | } |
411 | - if (! $local) { |
|
411 | + if (!$local) { |
|
412 | 412 | return $ref; |
413 | 413 | } |
414 | 414 | } |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | } |
461 | 461 | |
462 | 462 | $type = strtolower($type); |
463 | - if (! isset(static::$_detectors[$type])) { |
|
463 | + if (!isset(static::$_detectors[$type])) { |
|
464 | 464 | return false; |
465 | 465 | } |
466 | 466 | if ($args) { |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | foreach ($detect['header'] as $header => $value) { |
540 | 540 | $header = $this->getEnv('http_' . $header); |
541 | 541 | if ($header !== null) { |
542 | - if (! is_string($value) && ! is_bool($value) && is_callable($value)) { |
|
542 | + if (!is_string($value) && !is_bool($value) && is_callable($value)) { |
|
543 | 543 | return $value($header); |
544 | 544 | } |
545 | 545 | |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | public function isAll(array $types): bool |
613 | 613 | { |
614 | 614 | foreach ($types as $type) { |
615 | - if (! $this->is($type)) { |
|
615 | + if (!$this->is($type)) { |
|
616 | 616 | return false; |
617 | 617 | } |
618 | 618 | } |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | protected function normalizeHeaderName(string $name): string |
716 | 716 | { |
717 | 717 | $name = str_replace('-', '_', strtoupper($name)); |
718 | - if (! in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
718 | + if (!in_array($name, ['CONTENT_LENGTH', 'CONTENT_TYPE'], true)) { |
|
719 | 719 | $name = 'HTTP_' . $name; |
720 | 720 | } |
721 | 721 | |
@@ -900,8 +900,8 @@ discard block |
||
900 | 900 | $new = clone $this; |
901 | 901 | |
902 | 902 | if ( |
903 | - ! is_string($method) |
|
904 | - || ! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method) |
|
903 | + !is_string($method) |
|
904 | + || !preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method) |
|
905 | 905 | ) { |
906 | 906 | throw new InvalidArgumentException(sprintf( |
907 | 907 | 'Unsupported HTTP method "%s" provided', |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | } |
1146 | 1146 | } |
1147 | 1147 | |
1148 | - if (! isset($accept[$prefValue])) { |
|
1148 | + if (!isset($accept[$prefValue])) { |
|
1149 | 1149 | $accept[$prefValue] = []; |
1150 | 1150 | } |
1151 | 1151 | if ($prefValue) { |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | if ($name === null) { |
1224 | 1224 | return $this->data; |
1225 | 1225 | } |
1226 | - if (! is_array($this->data) && $name) { |
|
1226 | + if (!is_array($this->data) && $name) { |
|
1227 | 1227 | return $default; |
1228 | 1228 | } |
1229 | 1229 | |
@@ -1364,7 +1364,7 @@ discard block |
||
1364 | 1364 | */ |
1365 | 1365 | public function withProtocolVersion($version): self |
1366 | 1366 | { |
1367 | - if (! preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) { |
|
1367 | + if (!preg_match('/^(1\.[01]|2(\.[0])?)$/', $version)) { |
|
1368 | 1368 | throw new InvalidArgumentException("Unsupported protocol version '{$version}' provided"); |
1369 | 1369 | } |
1370 | 1370 | $new = clone $this; |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | public function getEnv(string $key, ?string $default = null): ?string |
1387 | 1387 | { |
1388 | 1388 | $key = strtoupper($key); |
1389 | - if (! array_key_exists($key, $this->_environment)) { |
|
1389 | + if (!array_key_exists($key, $this->_environment)) { |
|
1390 | 1390 | $this->_environment[$key] = env($key); |
1391 | 1391 | } |
1392 | 1392 | |
@@ -1609,7 +1609,7 @@ discard block |
||
1609 | 1609 | $file = Arr::get($this->uploadedFiles, $path); |
1610 | 1610 | if (is_array($file)) { |
1611 | 1611 | foreach ($file as $f) { |
1612 | - if (! ($f instanceof UploadedFile)) { |
|
1612 | + if (!($f instanceof UploadedFile)) { |
|
1613 | 1613 | return null; |
1614 | 1614 | } |
1615 | 1615 | } |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | return $file; |
1618 | 1618 | } |
1619 | 1619 | |
1620 | - if (! ($file instanceof UploadedFileInterface)) { |
|
1620 | + if (!($file instanceof UploadedFileInterface)) { |
|
1621 | 1621 | return null; |
1622 | 1622 | } |
1623 | 1623 | |
@@ -1665,7 +1665,7 @@ discard block |
||
1665 | 1665 | continue; |
1666 | 1666 | } |
1667 | 1667 | |
1668 | - if (! $file instanceof UploadedFileInterface) { |
|
1668 | + if (!$file instanceof UploadedFileInterface) { |
|
1669 | 1669 | throw new InvalidArgumentException("Invalid file at '{$path}{$key}'"); |
1670 | 1670 | } |
1671 | 1671 | } |
@@ -1716,7 +1716,7 @@ discard block |
||
1716 | 1716 | } |
1717 | 1717 | |
1718 | 1718 | $host = $uri->getHost(); |
1719 | - if (! $host) { |
|
1719 | + if (!$host) { |
|
1720 | 1720 | return $new; |
1721 | 1721 | } |
1722 | 1722 | $port = $uri->getPort(); |
@@ -1824,7 +1824,7 @@ discard block |
||
1824 | 1824 | $validLocales = config('app.supported_locales'); |
1825 | 1825 | // S'il ne s'agit pas d'un paramètre régional valide, définissez-le |
1826 | 1826 | // aux paramètres régionaux par défaut du site. |
1827 | - if (! in_array($locale, $validLocales, true)) { |
|
1827 | + if (!in_array($locale, $validLocales, true)) { |
|
1828 | 1828 | $locale = config('app.language'); |
1829 | 1829 | } |
1830 | 1830 | |
@@ -1924,7 +1924,7 @@ discard block |
||
1924 | 1924 | $override = true; |
1925 | 1925 | } |
1926 | 1926 | |
1927 | - if ($override && ! in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
1927 | + if ($override && !in_array($this->_environment['REQUEST_METHOD'], ['PUT', 'POST', 'DELETE', 'PATCH'], true)) { |
|
1928 | 1928 | $data = []; |
1929 | 1929 | } |
1930 | 1930 | |
@@ -1973,7 +1973,7 @@ discard block |
||
1973 | 1973 | */ |
1974 | 1974 | protected function _processFiles(array $post, array $files): array |
1975 | 1975 | { |
1976 | - if (! is_array($files)) { |
|
1976 | + if (!is_array($files)) { |
|
1977 | 1977 | return $post; |
1978 | 1978 | } |
1979 | 1979 |
@@ -35,19 +35,19 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public static function registerHttpErrors(Run $debugger, array $config): Run |
37 | 37 | { |
38 | - return $debugger->pushHandler(static function (Throwable $exception, InspectorInterface $inspector, RunInterface $run) use($config) { |
|
38 | + return $debugger->pushHandler(static function(Throwable $exception, InspectorInterface $inspector, RunInterface $run) use($config) { |
|
39 | 39 | if (true === $config['log']) { |
40 | - if (! in_array($exception->getCode(), $config['ignore_codes'], true)) { |
|
40 | + if (!in_array($exception->getCode(), $config['ignore_codes'], true)) { |
|
41 | 41 | Services::logger()->error($exception); |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | 45 | $files = array_map(fn(SplFileInfo $file) => $file->getFilenameWithoutExtension(), Services::fs()->files($config['error_view_path'])); |
46 | 46 | |
47 | - if (in_array((string)$exception->getCode(), $files, true)) { |
|
47 | + if (in_array((string) $exception->getCode(), $files, true)) { |
|
48 | 48 | $view = new View(); |
49 | 49 | $view->setAdapter(config('view.active_adapter', 'native'), ['view_path_locator' => $config['error_view_path']]) |
50 | - ->display((string)$exception->getCode()) |
|
50 | + ->display((string) $exception->getCode()) |
|
51 | 51 | ->setData(['message' => $exception->getMessage()]) |
52 | 52 | ->render(); |
53 | 53 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | if (is_callable($handler)) { |
70 | 70 | $debugger->pushHandler($handler); |
71 | - } else if(is_string($handler) && class_exists($handler)) { |
|
71 | + } else if (is_string($handler) && class_exists($handler)) { |
|
72 | 72 | $class = Services::container()->make($handler); |
73 | 73 | if (is_callable($class) || $class instanceof HandlerInterface) { |
74 | 74 | $debugger->pushHandler($class); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $debugger->pushHandler(new PlainTextHandler()); |
89 | 89 | } |
90 | 90 | |
91 | - if (! is_online()) { |
|
91 | + if (!is_online()) { |
|
92 | 92 | if (Misc::isAjaxRequest()) { |
93 | 93 | $debugger->pushHandler(new JsonResponseHandler()); |
94 | 94 | } else { |
@@ -62,7 +62,7 @@ |
||
62 | 62 | $debugger = Ignition::make(); |
63 | 63 | |
64 | 64 | $debugger->applicationPath(ROOTPATH) |
65 | - ->shouldDisplayException(! on_prod()) |
|
65 | + ->shouldDisplayException(!on_prod()) |
|
66 | 66 | ->register(); |
67 | 67 | } |
68 | 68 | } |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | */ |
31 | 31 | private static array $loaded = []; |
32 | 32 | |
33 | - /** |
|
34 | - * Different registrars decouverts. |
|
35 | - * |
|
36 | - * Les registrars sont des mecanismes permettant aux packages externe de definir un elements de configuration |
|
37 | - */ |
|
38 | - private static array $registrars = []; |
|
33 | + /** |
|
34 | + * Different registrars decouverts. |
|
35 | + * |
|
36 | + * Les registrars sont des mecanismes permettant aux packages externe de definir un elements de configuration |
|
37 | + */ |
|
38 | + private static array $registrars = []; |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * Drapeau permettant de savoir si la config a deja ete initialiser |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $configurations = (array) require $file; |
143 | 143 | } |
144 | 144 | |
145 | - $configurations = Arr::merge(self::$registrars[$config] ?? [], $configurations); |
|
145 | + $configurations = Arr::merge(self::$registrars[$config] ?? [], $configurations); |
|
146 | 146 | |
147 | 147 | if (empty($schema)) { |
148 | 148 | $schema = self::schema($config); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return; |
224 | 224 | } |
225 | 225 | |
226 | - $this->loadRegistrar(); |
|
226 | + $this->loadRegistrar(); |
|
227 | 227 | $this->load(['app']); |
228 | 228 | |
229 | 229 | ini_set('log_errors', 1); |
@@ -236,35 +236,35 @@ discard block |
||
236 | 236 | self::$initialized = true; |
237 | 237 | } |
238 | 238 | |
239 | - /** |
|
240 | - * Charges les registrars disponible pour l'application. |
|
241 | - * Les registrars sont des mecanismes permettant aux packages externe de definir un elements de configuration |
|
242 | - */ |
|
243 | - private function loadRegistrar() |
|
244 | - { |
|
245 | - $autoloader = new Autoloader(['psr4' => [APP_NAMESPACE => APP_PATH]]); |
|
246 | - $locator = new Locator($autoloader->initialize()); |
|
247 | - |
|
248 | - $registrarsFiles = $locator->search('Config/Registrar.php'); |
|
249 | - |
|
250 | - foreach ($registrarsFiles as $file) { |
|
251 | - $class = new ReflectionClass($locator->getClassname($file)); |
|
252 | - $methods = $class->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC); |
|
253 | - |
|
254 | - foreach ($methods as $method) { |
|
255 | - if (!($method->isPublic() && $method->isStatic())) { |
|
256 | - continue; |
|
257 | - } |
|
258 | - |
|
259 | - if (!is_array($result = $method->invoke(null))) { |
|
260 | - continue; |
|
261 | - } |
|
262 | - |
|
263 | - $name = $method->getName(); |
|
264 | - self::$registrars[$name] = Arr::merge(self::$registrars[$name] ?? [], $result); |
|
265 | - } |
|
266 | - } |
|
267 | - } |
|
239 | + /** |
|
240 | + * Charges les registrars disponible pour l'application. |
|
241 | + * Les registrars sont des mecanismes permettant aux packages externe de definir un elements de configuration |
|
242 | + */ |
|
243 | + private function loadRegistrar() |
|
244 | + { |
|
245 | + $autoloader = new Autoloader(['psr4' => [APP_NAMESPACE => APP_PATH]]); |
|
246 | + $locator = new Locator($autoloader->initialize()); |
|
247 | + |
|
248 | + $registrarsFiles = $locator->search('Config/Registrar.php'); |
|
249 | + |
|
250 | + foreach ($registrarsFiles as $file) { |
|
251 | + $class = new ReflectionClass($locator->getClassname($file)); |
|
252 | + $methods = $class->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC); |
|
253 | + |
|
254 | + foreach ($methods as $method) { |
|
255 | + if (!($method->isPublic() && $method->isStatic())) { |
|
256 | + continue; |
|
257 | + } |
|
258 | + |
|
259 | + if (!is_array($result = $method->invoke(null))) { |
|
260 | + continue; |
|
261 | + } |
|
262 | + |
|
263 | + $name = $method->getName(); |
|
264 | + self::$registrars[$name] = Arr::merge(self::$registrars[$name] ?? [], $result); |
|
265 | + } |
|
266 | + } |
|
267 | + } |
|
268 | 268 | |
269 | 269 | /** |
270 | 270 | * Initialise l'URL |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function exists(string $key): bool |
57 | 57 | { |
58 | - if (! $this->configurator->exists($key)) { |
|
58 | + if (!$this->configurator->exists($key)) { |
|
59 | 59 | $config = explode('.', $key); |
60 | 60 | $this->load($config[0]); |
61 | 61 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function missing(string $key): bool |
80 | 80 | { |
81 | - return ! $this->exists($key); |
|
81 | + return !$this->exists($key); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | if (is_array($config)) { |
122 | 122 | foreach ($config as $key => $value) { |
123 | - if (! is_string($value) || empty($value)) { |
|
123 | + if (!is_string($value) || empty($value)) { |
|
124 | 124 | continue; |
125 | 125 | } |
126 | 126 | if (is_string($key)) { |
@@ -132,13 +132,13 @@ discard block |
||
132 | 132 | } |
133 | 133 | self::load($conf, $file); |
134 | 134 | } |
135 | - } elseif (is_string($config) && ! isset(self::$loaded[$config])) { |
|
135 | + } elseif (is_string($config) && !isset(self::$loaded[$config])) { |
|
136 | 136 | if (empty($file)) { |
137 | 137 | $file = self::path($config); |
138 | 138 | } |
139 | 139 | |
140 | 140 | $configurations = []; |
141 | - if (file_exists($file) && ! in_array($file, get_included_files(), true)) { |
|
141 | + if (file_exists($file) && !in_array($file, get_included_files(), true)) { |
|
142 | 142 | $configurations = (array) require $file; |
143 | 143 | } |
144 | 144 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | { |
166 | 166 | if (is_array($accepts_values)) { |
167 | 167 | $accepts_values = '(Accept values: ' . implode('/', $accepts_values) . ')'; |
168 | - } elseif (! is_string($accepts_values)) { |
|
168 | + } elseif (!is_string($accepts_values)) { |
|
169 | 169 | throw new InvalidArgumentException('Misuse of the method ' . __METHOD__); |
170 | 170 | } |
171 | 171 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $schema = require $app_schema; |
208 | 208 | } |
209 | 209 | |
210 | - if (empty($schema) || ! ($schema instanceof Schema)) { |
|
210 | + if (empty($schema) || !($schema instanceof Schema)) { |
|
211 | 211 | $schema = Expect::mixed(); |
212 | 212 | } |
213 | 213 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | |
250 | 250 | foreach ($registrarsFiles as $file) { |
251 | 251 | $class = new ReflectionClass($locator->getClassname($file)); |
252 | - $methods = $class->getMethods(ReflectionMethod::IS_STATIC | ReflectionMethod::IS_PUBLIC); |
|
252 | + $methods = $class->getMethods(ReflectionMethod::IS_STATIC|ReflectionMethod::IS_PUBLIC); |
|
253 | 253 | |
254 | 254 | foreach ($methods as $method) { |
255 | 255 | if (!($method->isPublic() && $method->isStatic())) { |
@@ -325,12 +325,12 @@ discard block |
||
325 | 325 | { |
326 | 326 | $config = $this->get('app.show_debugbar', 'auto'); |
327 | 327 | |
328 | - if (! in_array($config, ['auto', true, false], true)) { |
|
328 | + if (!in_array($config, ['auto', true, false], true)) { |
|
329 | 329 | self::exceptBadConfigValue('show_debugbar', ['auto', true, false], 'app'); |
330 | 330 | } |
331 | 331 | |
332 | 332 | if ($config === 'auto') { |
333 | - $this->set('app.show_debugbar', ! is_online()); |
|
333 | + $this->set('app.show_debugbar', !is_online()); |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | use BlitzPHP\Container\Services; |
13 | 13 | |
14 | -if (! function_exists('directory_map')) { |
|
14 | +if (!function_exists('directory_map')) { |
|
15 | 15 | /** |
16 | 16 | * Créer une carte de répertoire |
17 | 17 | * |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | -if (! function_exists('directory_mirror')) { |
|
32 | +if (!function_exists('directory_mirror')) { |
|
33 | 33 | /** |
34 | 34 | * Copie récursivement les fichiers et répertoires du répertoire d'origine |
35 | 35 | * dans le répertoire cible, c'est-à-dire "miroir" son contenu. |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | -if (! function_exists('write_file')) { |
|
45 | +if (!function_exists('write_file')) { |
|
46 | 46 | /** |
47 | 47 | * Write File |
48 | 48 | * |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | -if (! function_exists('delete_files')) { |
|
79 | +if (!function_exists('delete_files')) { |
|
80 | 80 | /** |
81 | 81 | * Delete Files |
82 | 82 | * |
@@ -101,18 +101,18 @@ discard block |
||
101 | 101 | RecursiveIteratorIterator::CHILD_FIRST |
102 | 102 | ) as $object) { |
103 | 103 | $filename = $object->getFilename(); |
104 | - if (! $hidden && $filename[0] === '.') { |
|
104 | + if (!$hidden && $filename[0] === '.') { |
|
105 | 105 | continue; |
106 | 106 | } |
107 | 107 | |
108 | - if (! $htdocs || ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { |
|
108 | + if (!$htdocs || !preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) { |
|
109 | 109 | $isDir = $object->isDir(); |
110 | 110 | if ($isDir && $delDir) { |
111 | 111 | rmdir($object->getPathname()); |
112 | 112 | |
113 | 113 | continue; |
114 | 114 | } |
115 | - if (! $isDir) { |
|
115 | + if (!$isDir) { |
|
116 | 116 | unlink($object->getPathname()); |
117 | 117 | } |
118 | 118 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
128 | -if (! function_exists('get_filenames')) { |
|
128 | +if (!function_exists('get_filenames')) { |
|
129 | 129 | /** |
130 | 130 | * Get Filenames |
131 | 131 | * |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | RecursiveIteratorIterator::SELF_FIRST |
155 | 155 | ) as $name => $object) { |
156 | 156 | $basename = pathinfo($name, PATHINFO_BASENAME); |
157 | - if (! $hidden && $basename[0] === '.') { |
|
157 | + if (!$hidden && $basename[0] === '.') { |
|
158 | 158 | continue; |
159 | 159 | } |
160 | 160 | |
161 | - if ($includeDir || ! $object->isDir()) { |
|
161 | + if ($includeDir || !$object->isDir()) { |
|
162 | 162 | if ($includePath === false) { |
163 | 163 | $files[] = $basename; |
164 | 164 | } elseif ($includePath === null) { |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
181 | -if (! function_exists('get_dir_file_info')) { |
|
181 | +if (!function_exists('get_dir_file_info')) { |
|
182 | 182 | /** |
183 | 183 | * Get Directory File Information |
184 | 184 | * |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | } |
225 | 225 | } |
226 | 226 | |
227 | -if (! function_exists('get_file_info')) { |
|
227 | +if (!function_exists('get_file_info')) { |
|
228 | 228 | /** |
229 | 229 | * Get File Info |
230 | 230 | * |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | function get_file_info(string $file, $returnedValues = ['name', 'server_path', 'size', 'date']) |
242 | 242 | { |
243 | - if (! is_file($file)) { |
|
243 | + if (!is_file($file)) { |
|
244 | 244 | return null; |
245 | 245 | } |
246 | 246 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | } |
291 | 291 | } |
292 | 292 | |
293 | -if (! function_exists('symbolic_permissions')) { |
|
293 | +if (!function_exists('symbolic_permissions')) { |
|
294 | 294 | /** |
295 | 295 | * Symbolic Permissions |
296 | 296 | * |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | } |
339 | 339 | } |
340 | 340 | |
341 | -if (! function_exists('octal_permissions')) { |
|
341 | +if (!function_exists('octal_permissions')) { |
|
342 | 342 | /** |
343 | 343 | * Octal Permissions |
344 | 344 | * |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | } |
354 | 354 | } |
355 | 355 | |
356 | -if (! function_exists('same_file')) { |
|
356 | +if (!function_exists('same_file')) { |
|
357 | 357 | /** |
358 | 358 | * Checks if two files both exist and have identical hashes |
359 | 359 | * |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | } |
366 | 366 | } |
367 | 367 | |
368 | -if (! function_exists('set_realpath')) { |
|
368 | +if (!function_exists('set_realpath')) { |
|
369 | 369 | /** |
370 | 370 | * Set Realpath |
371 | 371 | * |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | // Resolve the path |
382 | 382 | if (realpath($path) !== false) { |
383 | 383 | $path = realpath($path); |
384 | - } elseif ($checkExistence && ! is_dir($path) && ! is_file($path)) { |
|
384 | + } elseif ($checkExistence && !is_dir($path) && !is_file($path)) { |
|
385 | 385 | throw new InvalidArgumentException('Not a valid path: ' . $path); |
386 | 386 | } |
387 | 387 |