@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | // Incluez le fichier routesFile s'il n'existe pas. |
| 264 | 264 | // Ne conserver que pour les fins BC pour l'instant. |
| 265 | 265 | $routeFiles = $this->routeFiles; |
| 266 | - if (! in_array($routesFile, $routeFiles, true)) { |
|
| 266 | + if (!in_array($routesFile, $routeFiles, true)) { |
|
| 267 | 267 | $routeFiles[] = $routesFile; |
| 268 | 268 | } |
| 269 | 269 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $routes = $this; |
| 272 | 272 | |
| 273 | 273 | foreach ($routeFiles as $routesFile) { |
| 274 | - if (! is_file($routesFile)) { |
|
| 274 | + if (!is_file($routesFile)) { |
|
| 275 | 275 | logger()->warning(sprintf('Fichier de route introuvable : "%s"', $routesFile)); |
| 276 | 276 | |
| 277 | 277 | continue; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | public function placeholder(array|string $placeholder, ?string $pattern = null): self |
| 322 | 322 | { |
| 323 | - if (! is_array($placeholder)) { |
|
| 323 | + if (!is_array($placeholder)) { |
|
| 324 | 324 | $placeholder = [$placeholder => $pattern]; |
| 325 | 325 | } |
| 326 | 326 | |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | * |
| 1023 | 1023 | * @param array|Closure|string $to |
| 1024 | 1024 | */ |
| 1025 | - public function match(array $verbs = [], string $from = '', $to = '', ?array $options = null): self |
|
| 1025 | + public function match(array $verbs = [], string $from = '', $to = '', ?array $options = null) : self |
|
| 1026 | 1026 | { |
| 1027 | 1027 | if (empty($from) || empty($to)) { |
| 1028 | 1028 | throw new InvalidArgumentException('Vous devez fournir les paramètres : $from, $to.'); |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | $from = $route['from']; |
| 1212 | 1212 | |
| 1213 | 1213 | // on ignore les closures |
| 1214 | - if (! is_string($to)) { |
|
| 1214 | + if (!is_string($to)) { |
|
| 1215 | 1215 | continue; |
| 1216 | 1216 | } |
| 1217 | 1217 | |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | |
| 1223 | 1223 | // S'il y a une chance de correspondance, alors ce sera |
| 1224 | 1224 | // soit avec $search au début de la chaîne $to. |
| 1225 | - if (! str_starts_with($to, $search)) { |
|
| 1225 | + if (!str_starts_with($to, $search)) { |
|
| 1226 | 1226 | continue; |
| 1227 | 1227 | } |
| 1228 | 1228 | |
@@ -1298,7 +1298,7 @@ discard block |
||
| 1298 | 1298 | |
| 1299 | 1299 | // Construisez notre chaîne résultante, en insérant les $params aux endroits appropriés. |
| 1300 | 1300 | foreach ($matches[0] as $index => $placeholder) { |
| 1301 | - if (! isset($params[$index])) { |
|
| 1301 | + if (!isset($params[$index])) { |
|
| 1302 | 1302 | throw new InvalidArgumentException( |
| 1303 | 1303 | 'Argument manquant pour "' . $placeholder . '" dans la route "' . $from . '".' |
| 1304 | 1304 | ); |
@@ -1309,7 +1309,7 @@ discard block |
||
| 1309 | 1309 | // ou peut-être que $placeholder n'est pas un espace réservé, mais une regex. |
| 1310 | 1310 | $pattern = $this->placeholders[$placeholderName] ?? $placeholder; |
| 1311 | 1311 | |
| 1312 | - if (! preg_match('#^' . $pattern . '$#u', $params[$index])) { |
|
| 1312 | + if (!preg_match('#^' . $pattern . '$#u', $params[$index])) { |
|
| 1313 | 1313 | throw RouterException::invalidParameterType(); |
| 1314 | 1314 | } |
| 1315 | 1315 | |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | $from = trim($from, '/'); |
| 1367 | 1367 | } |
| 1368 | 1368 | |
| 1369 | - if (is_string($to) && ! str_contains($to, '::') && class_exists($to) && method_exists($to, '__invoke')) { |
|
| 1369 | + if (is_string($to) && !str_contains($to, '::') && class_exists($to) && method_exists($to, '__invoke')) { |
|
| 1370 | 1370 | $to = [$to, '__invoke']; |
| 1371 | 1371 | } |
| 1372 | 1372 | |
@@ -1378,7 +1378,7 @@ discard block |
||
| 1378 | 1378 | $options = array_merge($this->currentOptions ?? [], $options ?? []); |
| 1379 | 1379 | |
| 1380 | 1380 | if (isset($options['middleware'])) { |
| 1381 | - if (! isset($options['middlewares'])) { |
|
| 1381 | + if (!isset($options['middlewares'])) { |
|
| 1382 | 1382 | $options['middlewares'] = (array) $options['middleware']; |
| 1383 | 1383 | } |
| 1384 | 1384 | unset($options['middleware']); |
@@ -1399,9 +1399,9 @@ discard block |
||
| 1399 | 1399 | } |
| 1400 | 1400 | |
| 1401 | 1401 | // Limitation du nom d'hôte ? |
| 1402 | - if (! empty($options['hostname'])) { |
|
| 1402 | + if (!empty($options['hostname'])) { |
|
| 1403 | 1403 | // @todo déterminer s'il existe un moyen de mettre les hôtes sur liste blanche ? |
| 1404 | - if (! $this->checkHostname($options['hostname'])) { |
|
| 1404 | + if (!$this->checkHostname($options['hostname'])) { |
|
| 1405 | 1405 | return; |
| 1406 | 1406 | } |
| 1407 | 1407 | |
@@ -1409,10 +1409,10 @@ discard block |
||
| 1409 | 1409 | } |
| 1410 | 1410 | |
| 1411 | 1411 | // Limitation du nom sous-domaine ? |
| 1412 | - elseif (! empty($options['subdomain'])) { |
|
| 1412 | + elseif (!empty($options['subdomain'])) { |
|
| 1413 | 1413 | // Si nous ne correspondons pas au sous-domaine actuel, alors |
| 1414 | 1414 | // nous n'avons pas besoin d'ajouter la route. |
| 1415 | - if (! $this->checkSubdomains($options['subdomain'])) { |
|
| 1415 | + if (!$this->checkSubdomains($options['subdomain'])) { |
|
| 1416 | 1416 | return; |
| 1417 | 1417 | } |
| 1418 | 1418 | |
@@ -1445,9 +1445,9 @@ discard block |
||
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | 1447 | // S'il s'agit d'une redirection, aucun traitement |
| 1448 | - if (! isset($options['redirect']) && is_string($to)) { |
|
| 1448 | + if (!isset($options['redirect']) && is_string($to)) { |
|
| 1449 | 1449 | // Si aucun espace de noms n'est trouvé, ajouter l'espace de noms par défaut |
| 1450 | - if (! str_contains($to, '\\') || strpos($to, '\\') > 0) { |
|
| 1450 | + if (!str_contains($to, '\\') || strpos($to, '\\') > 0) { |
|
| 1451 | 1451 | $namespace = $options['namespace'] ?? $this->defaultNamespace; |
| 1452 | 1452 | $to = trim($namespace, '\\') . '\\' . $to; |
| 1453 | 1453 | } |
@@ -1464,7 +1464,7 @@ discard block |
||
| 1464 | 1464 | // cela ne fonctionne que parce que les routes découvertes sont ajoutées juste avant |
| 1465 | 1465 | // pour tenter de router la requête. |
| 1466 | 1466 | $routeKeyExists = isset($this->routes[$verb][$routeKey]); |
| 1467 | - if ((isset($this->routesNames[$verb][$name]) || $routeKeyExists) && ! $overwrite) { |
|
| 1467 | + if ((isset($this->routesNames[$verb][$name]) || $routeKeyExists) && !$overwrite) { |
|
| 1468 | 1468 | return; |
| 1469 | 1469 | } |
| 1470 | 1470 | |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | private function checkHostname(string $hostname): bool |
| 1491 | 1491 | { |
| 1492 | 1492 | // Les appels CLI ne peuvent pas être sur le nom d'hôte. |
| 1493 | - if (! isset($this->httpHost) || is_cli()) { |
|
| 1493 | + if (!isset($this->httpHost) || is_cli()) { |
|
| 1494 | 1494 | return false; |
| 1495 | 1495 | } |
| 1496 | 1496 | |
@@ -1506,7 +1506,7 @@ discard block |
||
| 1506 | 1506 | private function checkSubdomains($subdomains): bool |
| 1507 | 1507 | { |
| 1508 | 1508 | // Les appels CLI ne peuvent pas être sur le sous-domaine. |
| 1509 | - if (! isset($this->httpHost)) { |
|
| 1509 | + if (!isset($this->httpHost)) { |
|
| 1510 | 1510 | return false; |
| 1511 | 1511 | } |
| 1512 | 1512 | |
@@ -1514,13 +1514,13 @@ discard block |
||
| 1514 | 1514 | $this->currentSubdomain = $this->determineCurrentSubdomain(); |
| 1515 | 1515 | } |
| 1516 | 1516 | |
| 1517 | - if (! is_array($subdomains)) { |
|
| 1517 | + if (!is_array($subdomains)) { |
|
| 1518 | 1518 | $subdomains = [$subdomains]; |
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | 1521 | // Les routes peuvent être limitées à n'importe quel sous-domaine. Dans ce cas, cependant, |
| 1522 | 1522 | // il nécessite la présence d'un sous-domaine. |
| 1523 | - if (! empty($this->currentSubdomain) && in_array('*', $subdomains, true)) { |
|
| 1523 | + if (!empty($this->currentSubdomain) && in_array('*', $subdomains, true)) { |
|
| 1524 | 1524 | return true; |
| 1525 | 1525 | } |
| 1526 | 1526 | |
@@ -1542,7 +1542,7 @@ discard block |
||
| 1542 | 1542 | // sur l'URL sinon parse_url sera mal interprété |
| 1543 | 1543 | // 'hôte' comme 'chemin'. |
| 1544 | 1544 | $url = $this->httpHost; |
| 1545 | - if (! str_starts_with($url, 'http')) { |
|
| 1545 | + if (!str_starts_with($url, 'http')) { |
|
| 1546 | 1546 | $url = 'http://' . $url; |
| 1547 | 1547 | } |
| 1548 | 1548 | |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | |
| 1584 | 1584 | private function getControllerName(Closure|string $handler): ?string |
| 1585 | 1585 | { |
| 1586 | - if (! is_string($handler)) { |
|
| 1586 | + if (!is_string($handler)) { |
|
| 1587 | 1587 | return null; |
| 1588 | 1588 | } |
| 1589 | 1589 | |
@@ -1642,13 +1642,13 @@ discard block |
||
| 1642 | 1642 | */ |
| 1643 | 1643 | private function replaceLocale(string $route, ?string $locale = null): string |
| 1644 | 1644 | { |
| 1645 | - if (! str_contains($route, '{locale}')) { |
|
| 1645 | + if (!str_contains($route, '{locale}')) { |
|
| 1646 | 1646 | return $route; |
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | 1649 | // Vérifier les paramètres régionaux non valides |
| 1650 | 1650 | if ($locale !== null) { |
| 1651 | - if (! in_array($locale, config('app.supported_locales'), true)) { |
|
| 1651 | + if (!in_array($locale, config('app.supported_locales'), true)) { |
|
| 1652 | 1652 | $locale = null; |
| 1653 | 1653 | } |
| 1654 | 1654 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | helper('assets'); |
| 72 | 72 | |
| 73 | - if (! empty($viewPathLocator)) { |
|
| 73 | + if (!empty($viewPathLocator)) { |
|
| 74 | 74 | if (is_string($viewPathLocator)) { |
| 75 | 75 | $this->viewPath = rtrim($viewPathLocator, '\\/ ') . DS; |
| 76 | 76 | } elseif ($viewPathLocator instanceof LocatorInterface) { |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $options = (array) $options; |
| 236 | 236 | |
| 237 | 237 | $viewPath = $options['viewPath'] ?? $this->viewPath; |
| 238 | - if (! empty($viewPath)) { |
|
| 238 | + if (!empty($viewPath)) { |
|
| 239 | 239 | $file = str_replace('/', DS, rtrim($viewPath, '/\\') . DS . ltrim($view, '/\\')); |
| 240 | 240 | } else { |
| 241 | 241 | $file = $view; |
@@ -243,14 +243,14 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | $file = Helpers::ensureExt($file, $ext); |
| 245 | 245 | |
| 246 | - if (! is_file($file) && $this->locator instanceof LocatorInterface) { |
|
| 246 | + if (!is_file($file) && $this->locator instanceof LocatorInterface) { |
|
| 247 | 247 | $file = $this->locator->locateFile($view, 'Views', empty($ext) ? 'php' : $ext); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | $file = realpath($file); |
| 251 | 251 | |
| 252 | 252 | // locateFile renverra une chaîne vide si le fichier est introuvable. |
| 253 | - if (! is_file($file)) { |
|
| 253 | + if (!is_file($file)) { |
|
| 254 | 254 | throw ViewException::invalidFile($view); |
| 255 | 255 | } |
| 256 | 256 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $controller = $routes->getDefaultController(); |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - if (! $fullName && is_string($controller)) { |
|
| 182 | + if (!$fullName && is_string($controller)) { |
|
| 183 | 183 | $controller = str_replace($routes->getDefaultNamespace(), '', $controller); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -324,14 +324,14 @@ discard block |
||
| 324 | 324 | return; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - if (is_cli() && ! on_test()) { |
|
| 327 | + if (is_cli() && !on_test()) { |
|
| 328 | 328 | // @codeCoverageIgnoreStart |
| 329 | 329 | // $this->request = Services::clirequest($this->config); |
| 330 | 330 | // @codeCoverageIgnoreEnd |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | $version = $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1'; |
| 334 | - if (! is_numeric($version)) { |
|
| 334 | + if (!is_numeric($version)) { |
|
| 335 | 335 | $version = substr($version, strpos($version, '/') + 1); |
| 336 | 336 | } |
| 337 | 337 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | // Supposons le succès jusqu'à preuve du contraire. |
| 351 | 351 | $this->response = Services::response()->withStatus(200); |
| 352 | 352 | |
| 353 | - if (! is_cli() || on_test()) { |
|
| 353 | + if (!is_cli() || on_test()) { |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | $this->response = $this->response->withProtocolVersion($this->request->getProtocolVersion()); |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | */ |
| 465 | 465 | protected function determinePath(): string |
| 466 | 466 | { |
| 467 | - if (! empty($this->path)) { |
|
| 467 | + if (!empty($this->path)) { |
|
| 468 | 468 | return $this->path; |
| 469 | 469 | } |
| 470 | 470 | |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | // Essayez de charger automatiquement la classe |
| 508 | - if (! class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) { |
|
| 508 | + if (!class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) { |
|
| 509 | 509 | throw PageNotFoundException::controllerNotFound($this->controller, $this->method); |
| 510 | 510 | } |
| 511 | 511 | |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | |
| 598 | 598 | $this->outputBufferingEnd(); |
| 599 | 599 | |
| 600 | - throw PageNotFoundException::pageNotFound(! on_prod() || is_cli() ? $e->getMessage() : ''); |
|
| 600 | + throw PageNotFoundException::pageNotFound(!on_prod() || is_cli() ? $e->getMessage() : ''); |
|
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | /** |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | public function storePreviousURL($uri) |
| 640 | 640 | { |
| 641 | 641 | // Ignorer les requêtes CLI |
| 642 | - if (is_cli() && ! on_test()) { |
|
| 642 | + if (is_cli() && !on_test()) { |
|
| 643 | 643 | return; // @codeCoverageIgnore |
| 644 | 644 | } |
| 645 | 645 | |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | // Ignorer les reponses non-HTML |
| 652 | - if (! str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) { |
|
| 652 | + if (!str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) { |
|
| 653 | 653 | return; |
| 654 | 654 | } |
| 655 | 655 | |
@@ -761,11 +761,11 @@ discard block |
||
| 761 | 761 | */ |
| 762 | 762 | private function spoofRequestMethod(): callable |
| 763 | 763 | { |
| 764 | - return static function (ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
| 764 | + return static function(ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
| 765 | 765 | $post = $request->getParsedBody(); |
| 766 | 766 | |
| 767 | 767 | // Ne fonctionne qu'avec les formulaires POST |
| 768 | - if (strtoupper($request->getMethod()) === 'POST' && ! empty($post['_method'])) { |
|
| 768 | + if (strtoupper($request->getMethod()) === 'POST' && !empty($post['_method'])) { |
|
| 769 | 769 | // Accepte seulement PUT, PATCH, DELETE |
| 770 | 770 | if (in_array(strtoupper($post['_method']), ['PUT', 'PATCH', 'DELETE'], true)) { |
| 771 | 771 | $request = $request->withMethod($post['_method']); |
@@ -778,15 +778,15 @@ discard block |
||
| 778 | 778 | |
| 779 | 779 | private function bootApp(): callable |
| 780 | 780 | { |
| 781 | - return function (ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { |
|
| 781 | + return function(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { |
|
| 782 | 782 | try { |
| 783 | 783 | $returned = $this->startController($request, $response); |
| 784 | 784 | |
| 785 | 785 | // Closure controller has run in startController(). |
| 786 | - if (! is_callable($this->controller)) { |
|
| 786 | + if (!is_callable($this->controller)) { |
|
| 787 | 787 | $controller = $this->createController($request, $response); |
| 788 | 788 | |
| 789 | - if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) { |
|
| 789 | + if (!method_exists($controller, '_remap') && !is_callable([$controller, $this->method], false)) { |
|
| 790 | 790 | throw PageNotFoundException::methodNotFound($this->method); |
| 791 | 791 | } |
| 792 | 792 | |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | foreach (EventManager::getPerformanceLogs() as $row) { |
| 74 | 74 | $key = $row['event']; |
| 75 | 75 | |
| 76 | - if (! array_key_exists($key, $data['events'])) { |
|
| 76 | + if (!array_key_exists($key, $data['events'])) { |
|
| 77 | 77 | $data['events'][$key] = [ |
| 78 | 78 | 'event' => $key, |
| 79 | 79 | 'duration' => ($row['end'] - $row['start']) * 1000, |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | // Enregistrer les variables actuelles |
| 127 | 127 | $renderVars = $this->renderVars; |
| 128 | 128 | |
| 129 | - $output = (function (): string { |
|
| 129 | + $output = (function(): string { |
|
| 130 | 130 | extract($this->tempData); |
| 131 | 131 | ob_start(); |
| 132 | 132 | include $this->renderVars['file']; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $this->logPerformance($this->renderVars['start'], microtime(true), $this->renderVars['view']); |
| 149 | 149 | |
| 150 | - if (($this->debug && (! isset($options['debug']) || $options['debug'] === true))) { |
|
| 150 | + if (($this->debug && (!isset($options['debug']) || $options['debug'] === true))) { |
|
| 151 | 151 | if (in_array(ViewsCollector::class, config('toolbar.collectors'), true)) { |
| 152 | 152 | // Nettoyer nos noms de chemins pour les rendre un peu plus propres |
| 153 | 153 | $this->renderVars['file'] = clean_path($this->renderVars['file']); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $saveData ??= $this->saveData; |
| 182 | 182 | $this->prepareTemplateData($saveData); |
| 183 | 183 | |
| 184 | - $output = (function (string $view): string { |
|
| 184 | + $output = (function(string $view): string { |
|
| 185 | 185 | extract($this->tempData); |
| 186 | 186 | ob_start(); |
| 187 | 187 | eval('?>' . $view); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | $section = array_pop($this->sectionStack); |
| 314 | 314 | |
| 315 | 315 | // Assurez-vous qu'un tableau existe afin que nous puissions stocker plusieurs entrées pour cela. |
| 316 | - if (! array_key_exists($section, $this->sections)) { |
|
| 316 | + if (!array_key_exists($section, $this->sections)) { |
|
| 317 | 317 | $this->sections[$section] = []; |
| 318 | 318 | } |
| 319 | 319 | |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | public function show(string $sectionName, bool $preserve = false) |
| 351 | 351 | { |
| 352 | - if (! isset($this->sections[$sectionName])) { |
|
| 352 | + if (!isset($this->sections[$sectionName])) { |
|
| 353 | 353 | echo ''; |
| 354 | 354 | |
| 355 | 355 | return; |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | * |
| 411 | 411 | * @param mixed $saveData |
| 412 | 412 | */ |
| 413 | - public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true): string |
|
| 413 | + public function include(string $view, ?array $data = [], ?array $options = null, $saveData = true) : string |
|
| 414 | 414 | { |
| 415 | 415 | return $this->insert($view, $data, $options, $saveData); |
| 416 | 416 | } |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | public function addLibCss(string ...$src): self |
| 511 | 511 | { |
| 512 | 512 | foreach ($src as $var) { |
| 513 | - if (! in_array($var, $this->_lib_styles, true)) { |
|
| 513 | + if (!in_array($var, $this->_lib_styles, true)) { |
|
| 514 | 514 | $this->_lib_styles[] = $var; |
| 515 | 515 | } |
| 516 | 516 | } |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | public function addCss(string ...$src): self |
| 525 | 525 | { |
| 526 | 526 | foreach ($src as $var) { |
| 527 | - if (! in_array($var, $this->_styles, true)) { |
|
| 527 | + if (!in_array($var, $this->_styles, true)) { |
|
| 528 | 528 | $this->_styles[] = $var; |
| 529 | 529 | } |
| 530 | 530 | } |
@@ -553,10 +553,10 @@ discard block |
||
| 553 | 553 | ); |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | - if (! empty($lib_styles)) { |
|
| 556 | + if (!empty($lib_styles)) { |
|
| 557 | 557 | lib_styles(array_unique($lib_styles)); |
| 558 | 558 | } |
| 559 | - if (! empty($styles)) { |
|
| 559 | + if (!empty($styles)) { |
|
| 560 | 560 | styles(array_unique($styles)); |
| 561 | 561 | } |
| 562 | 562 | |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | public function addLibJs(string ...$src): self |
| 570 | 570 | { |
| 571 | 571 | foreach ($src as $var) { |
| 572 | - if (! in_array($var, $this->_lib_scripts, true)) { |
|
| 572 | + if (!in_array($var, $this->_lib_scripts, true)) { |
|
| 573 | 573 | $this->_lib_scripts[] = $var; |
| 574 | 574 | } |
| 575 | 575 | } |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | public function addJs(string ...$src): self |
| 584 | 584 | { |
| 585 | 585 | foreach ($src as $var) { |
| 586 | - if (! in_array($var, $this->_scripts, true)) { |
|
| 586 | + if (!in_array($var, $this->_scripts, true)) { |
|
| 587 | 587 | $this->_scripts[] = $var; |
| 588 | 588 | } |
| 589 | 589 | } |
@@ -612,10 +612,10 @@ discard block |
||
| 612 | 612 | ); |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | - if (! empty($lib_scripts)) { |
|
| 615 | + if (!empty($lib_scripts)) { |
|
| 616 | 616 | lib_scripts(array_unique($lib_scripts)); |
| 617 | 617 | } |
| 618 | - if (! empty($scripts)) { |
|
| 618 | + if (!empty($scripts)) { |
|
| 619 | 619 | scripts(array_unique($scripts)); |
| 620 | 620 | } |
| 621 | 621 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | $force = array_key_exists('force', $params) || $this->option('force'); |
| 49 | 49 | |
| 50 | - if (! $force && ! $this->confirm('Êtes-vous sûr de vouloir supprimer les logs?')) { |
|
| 50 | + if (!$force && !$this->confirm('Êtes-vous sûr de vouloir supprimer les logs?')) { |
|
| 51 | 51 | // @codeCoverageIgnoreStart |
| 52 | 52 | $this->fail('Suppression des logs interrompue.'); |
| 53 | 53 | $this->fail('Si vous le souhaitez, utilisez l\'option "-force" pour forcer la suppression de tous les fichiers de log.'); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | helper('filesystem'); |
| 61 | 61 | |
| 62 | - if (! delete_files(STORAGE_PATH . 'logs', false, true)) { |
|
| 62 | + if (!delete_files(STORAGE_PATH . 'logs', false, true)) { |
|
| 63 | 63 | // @codeCoverageIgnoreStart |
| 64 | 64 | $this->error('Erreur lors de la suppression des fichiers de logs.')->eol(); |
| 65 | 65 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | { |
| 41 | 41 | helper('filesystem'); |
| 42 | 42 | |
| 43 | - if (! delete_files(FRAMEWORK_STORAGE_PATH . 'debugbar')) { |
|
| 43 | + if (!delete_files(FRAMEWORK_STORAGE_PATH . 'debugbar')) { |
|
| 44 | 44 | // @codeCoverageIgnoreStart |
| 45 | 45 | $this->error('Erreur lors de la suppression des fichiers de la debugbar.')->eol(); |
| 46 | 46 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | public static function setUpBeforeClass(): void |
| 26 | 26 | { |
| 27 | - if (! is_dir($dirname = pathinfo(static::$ou, PATHINFO_DIRNAME))) { |
|
| 27 | + if (!is_dir($dirname = pathinfo(static::$ou, PATHINFO_DIRNAME))) { |
|
| 28 | 28 | mkdir($dirname, 0o777, true); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | 'Sodium' => extension_loaded('sodium') && version_compare(SODIUM_LIBRARY_VERSION, '1.0.14', '>='), |
| 83 | 83 | ]; |
| 84 | 84 | |
| 85 | - if (! in_array($this->driver, $this->drivers, true) || (array_key_exists($this->driver, $this->handlers) && ! $this->handlers[$this->driver])) { |
|
| 85 | + if (!in_array($this->driver, $this->drivers, true) || (array_key_exists($this->driver, $this->handlers) && !$this->handlers[$this->driver])) { |
|
| 86 | 86 | throw EncryptionException::noHandlerAvailable($this->driver); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | throw EncryptionException::noDriverRequested(); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (! in_array($this->driver, $this->drivers, true)) { |
|
| 123 | + if (!in_array($this->driver, $this->drivers, true)) { |
|
| 124 | 124 | throw EncryptionException::unKnownHandler($this->driver); |
| 125 | 125 | } |
| 126 | 126 | |