@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $controller = $routes->getDefaultController(); |
176 | 176 | } |
177 | 177 | |
178 | - if (! $fullName && is_string($controller)) { |
|
178 | + if (!$fullName && is_string($controller)) { |
|
179 | 179 | $controller = str_replace($routes->getDefaultNamespace(), '', $controller); |
180 | 180 | } |
181 | 181 | |
@@ -298,14 +298,14 @@ discard block |
||
298 | 298 | return; |
299 | 299 | } |
300 | 300 | |
301 | - if (is_cli() && ! on_test()) { |
|
301 | + if (is_cli() && !on_test()) { |
|
302 | 302 | // @codeCoverageIgnoreStart |
303 | 303 | // $this->request = Services::clirequest($this->config); |
304 | 304 | // @codeCoverageIgnoreEnd |
305 | 305 | } |
306 | 306 | |
307 | 307 | $version = $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.1'; |
308 | - if (! is_numeric($version)) { |
|
308 | + if (!is_numeric($version)) { |
|
309 | 309 | $version = substr($version, strpos($version, '/') + 1); |
310 | 310 | } |
311 | 311 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | // Supposons le succès jusqu'à preuve du contraire. |
325 | 325 | $this->response = service('response')->withStatus(200); |
326 | 326 | |
327 | - if (! is_cli() || on_test()) { |
|
327 | + if (!is_cli() || on_test()) { |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | $this->response = $this->response->withProtocolVersion($this->request->getProtocolVersion()); |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | } |
409 | 409 | |
410 | 410 | // Essayez de charger automatiquement la classe |
411 | - if (! class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) { |
|
411 | + if (!class_exists($this->controller, true) || ($this->method[0] === '_' && $this->method !== '__invoke')) { |
|
412 | 412 | throw PageNotFoundException::controllerNotFound($this->controller, $this->method); |
413 | 413 | } |
414 | 414 | |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | |
500 | 500 | $this->outputBufferingEnd(); |
501 | 501 | |
502 | - throw PageNotFoundException::pageNotFound(! on_prod() || is_cli() ? $e->getMessage() : ''); |
|
502 | + throw PageNotFoundException::pageNotFound(!on_prod() || is_cli() ? $e->getMessage() : ''); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | /** |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | public function storePreviousURL($uri) |
542 | 542 | { |
543 | 543 | // Ignorer les requêtes CLI |
544 | - if (is_cli() && ! on_test()) { |
|
544 | + if (is_cli() && !on_test()) { |
|
545 | 545 | return; // @codeCoverageIgnore |
546 | 546 | } |
547 | 547 | |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | } |
552 | 552 | |
553 | 553 | // Ignorer les reponses non-HTML |
554 | - if (! str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) { |
|
554 | + if (!str_contains($this->response->getHeaderLine('Content-Type'), 'text/html')) { |
|
555 | 555 | return; |
556 | 556 | } |
557 | 557 | |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | */ |
576 | 576 | protected function sendResponse() |
577 | 577 | { |
578 | - if (! $this->isAjaxRequest()) { |
|
578 | + if (!$this->isAjaxRequest()) { |
|
579 | 579 | $this->response = service('toolbar')->process( |
580 | 580 | $this->getPerformanceStats(), |
581 | 581 | $this->request, |
@@ -672,12 +672,12 @@ discard block |
||
672 | 672 | */ |
673 | 673 | private function spoofRequestMethod(): callable |
674 | 674 | { |
675 | - return static function (ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
675 | + return static function(ServerRequestInterface $request, ResponseInterface $response, callable $next) { |
|
676 | 676 | $post = $request->getParsedBody(); |
677 | 677 | |
678 | 678 | // Ne fonctionne qu'avec les formulaires POST |
679 | 679 | // Accepte seulement PUT, PATCH, DELETE |
680 | - if ($request->getMethod() === Method::POST && ! empty($post['_method']) && in_array($post['_method'], [Method::PUT, Method::PATCH, Method::DELETE], true)) { |
|
680 | + if ($request->getMethod() === Method::POST && !empty($post['_method']) && in_array($post['_method'], [Method::PUT, Method::PATCH, Method::DELETE], true)) { |
|
681 | 681 | $request = $request->withMethod($post['_method']); |
682 | 682 | } |
683 | 683 | |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | */ |
694 | 694 | private function bootApp(): callable |
695 | 695 | { |
696 | - return function (ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { |
|
696 | + return function(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { |
|
697 | 697 | Services::set(Request::class, $request); |
698 | 698 | Services::set(Response::class, $response); |
699 | 699 | |
@@ -701,10 +701,10 @@ discard block |
||
701 | 701 | $returned = $this->startController(); |
702 | 702 | |
703 | 703 | // Les controleur sous forme de Closure sont executes dans startController(). |
704 | - if (! is_callable($this->controller)) { |
|
704 | + if (!is_callable($this->controller)) { |
|
705 | 705 | $controller = $this->createController($request, $response); |
706 | 706 | |
707 | - if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) { |
|
707 | + if (!method_exists($controller, '_remap') && !is_callable([$controller, $this->method], false)) { |
|
708 | 708 | throw PageNotFoundException::methodNotFound($this->method); |
709 | 709 | } |
710 | 710 |
@@ -54,13 +54,13 @@ |
||
54 | 54 | */ |
55 | 55 | public function __construct(array|CSPBuilder $csp, array $config = []) |
56 | 56 | { |
57 | - if (! class_exists(CSPBuilder::class)) { |
|
57 | + if (!class_exists(CSPBuilder::class)) { |
|
58 | 58 | throw new FrameworkException('Vous devez installer paragonie/csp-builder pour utiliser le middleware Csp.'); |
59 | 59 | } |
60 | 60 | |
61 | 61 | $this->setConfig($config); |
62 | 62 | |
63 | - if (! $csp instanceof CSPBuilder) { |
|
63 | + if (!$csp instanceof CSPBuilder) { |
|
64 | 64 | $csp = new CSPBuilder($csp); |
65 | 65 | } |
66 | 66 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $file = $this->viewPath . $view; |
100 | 100 | |
101 | - if (! is_file($file)) { |
|
101 | + if (!is_file($file)) { |
|
102 | 102 | $fileOrig = $file; |
103 | 103 | $file = $this->locator->locateFile($view, 'Views', $ext); |
104 | 104 | |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | foreach ($matches as $match) { |
302 | 302 | // Loop over each piece of $data, replacing |
303 | 303 | // its contents so that we know what to replace in parse() |
304 | - $str = ''; // holds the new contents for this tag pair. |
|
304 | + $str = ''; // holds the new contents for this tag pair. |
|
305 | 305 | |
306 | 306 | foreach ($data as $row) { |
307 | 307 | // Objects that have a `toArray()` method should be |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | |
344 | 344 | // Now replace our placeholders with the new content. |
345 | 345 | foreach ($temp as $pattern => $content) { |
346 | - $out = $this->replaceSingle($pattern, $content, $out, ! isset($pairs[$pattern])); |
|
346 | + $out = $this->replaceSingle($pattern, $content, $out, !isset($pairs[$pattern])); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | $str .= $out; |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | protected function replaceSingle(array|string $pattern, string $content, string $template, bool $escape = false): string |
502 | 502 | { |
503 | 503 | // Replace the content in the template |
504 | - return preg_replace_callback($pattern, function ($matches) use ($content, $escape): string { |
|
504 | + return preg_replace_callback($pattern, function($matches) use ($content, $escape): string { |
|
505 | 505 | // Check for {! !} syntax to not escape this one. |
506 | 506 | if ( |
507 | 507 | str_starts_with($matches[0], $this->leftDelimiter . '!') |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | |
524 | 524 | // Our regex earlier will leave all chained values on a single line |
525 | 525 | // so we need to break them apart so we can apply them all. |
526 | - $filters = ! empty($matches[1]) ? explode('|', $matches[1]) : []; |
|
526 | + $filters = !empty($matches[1]) ? explode('|', $matches[1]) : []; |
|
527 | 527 | |
528 | 528 | if ($escape && $filters === [] && ($context = $this->shouldAddEscaping($orig))) { |
529 | 529 | $filters[] = "esc({$context})"; |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | } |
552 | 552 | } |
553 | 553 | // No pipes, then we know we need to escape |
554 | - elseif (! str_contains($key, '|')) { |
|
554 | + elseif (!str_contains($key, '|')) { |
|
555 | 555 | $escape = 'html'; |
556 | 556 | } |
557 | 557 | // If there's a `noescape` then we're definitely false. |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | $escape = false; |
560 | 560 | } |
561 | 561 | // If no `esc` filter is found, then we'll need to add one. |
562 | - elseif (! preg_match('/\s+esc/u', $key)) { |
|
562 | + elseif (!preg_match('/\s+esc/u', $key)) { |
|
563 | 563 | $escape = 'html'; |
564 | 564 | } |
565 | 565 | |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | $filter = $param !== [] ? trim(strtolower(substr($filter, 0, strpos($filter, '(')))) : trim($filter); |
597 | 597 | |
598 | 598 | $this->config['filters'] ??= []; |
599 | - if (! array_key_exists($filter, $this->config['filters'])) { |
|
599 | + if (!array_key_exists($filter, $this->config['filters'])) { |
|
600 | 600 | continue; |
601 | 601 | } |
602 | 602 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * $matches[1] = all parameters string in opening tag |
634 | 634 | * $matches[2] = content between the tags to send to the plugin. |
635 | 635 | */ |
636 | - if (! preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) { |
|
636 | + if (!preg_match_all($pattern, $template, $matches, PREG_SET_ORDER)) { |
|
637 | 637 | continue; |
638 | 638 | } |
639 | 639 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | unset($params['help'], $params['version'], $params['verbosity']); |
48 | 48 | $params = array_values(array_filter($params)); |
49 | 49 | |
50 | - if (isset($params[0]) && ! in_array($params[0], array_keys($this->arguments), true)) { |
|
50 | + if (isset($params[0]) && !in_array($params[0], array_keys($this->arguments), true)) { |
|
51 | 51 | $this->fail('Vous devez indiquer un argument correct.')->eol(); |
52 | 52 | $this->fail(' Example: phpini:check opcache')->eol(); |
53 | 53 | $this->fail('Arguments:')->eol(); |
@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | public function hashDirectory(string $path): string |
61 | 61 | { |
62 | - if (! is_dir($path)) { |
|
62 | + if (!is_dir($path)) { |
|
63 | 63 | throw FrameworkException::invalidDirectory($path); |
64 | 64 | } |
65 | 65 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function accept(): bool |
39 | 39 | { |
40 | - if (! $this->current()->isFile()) { |
|
40 | + if (!$this->current()->isFile()) { |
|
41 | 41 | return true; |
42 | 42 | } |
43 | 43 |