From 16778cc07c955bb583a86f6509b7dc642a750288 Mon Sep 17 00:00:00 2001 From: dimtrovich <37987162+dimtrovich@users.noreply.github.com> Date: Tue, 25 Aug 2026 18:06:18 +0000 Subject: [PATCH 1/3] Fix styling --- .php-cs-fixer.dist.php | 2 +- rector.php | 2 +- src/Cli/Commands/Generators/Command.php | 2 +- src/Cli/Commands/Generators/Component.php | 2 +- src/Cli/Commands/Generators/Controller.php | 2 +- src/Cli/Commands/Generators/Middleware.php | 2 +- .../Commands/Routes/AutoRouteCollector.php | 4 +-- .../Routes/ControllerMethodReader.php | 4 +-- src/Cli/Commands/Routes/Routes.php | 10 +++--- src/Cli/Commands/Server/rewrite.php | 2 +- .../Translation/TranslationsFinder.php | 4 +-- src/Cli/Commands/Utilities/About.php | 2 +- src/Cli/Commands/Utilities/ConfigCheck.php | 4 +-- src/Cli/Commands/Utilities/Optimize.php | 2 +- src/Cli/Console/Console.php | 4 +-- src/Config/Config.php | 2 +- src/Container/Services.php | 2 +- src/Debug/Logger.php | 14 ++++---- src/Debug/Toolbar.php | 6 ++-- .../Toolbar/Collectors/RoutesCollector.php | 2 +- src/Debug/Toolbar/Views/toolbar.tpl.php | 36 ++++++++++--------- src/Enums/Method.php | 2 +- src/Event/EventDiscover.php | 2 +- src/Exceptions/FrameworkException.php | 2 +- src/Exceptions/RedirectException.php | 4 +-- src/Helpers/assets.php | 4 +-- src/Helpers/common.php | 5 +-- src/Helpers/date.php | 2 +- src/Helpers/filesystem.php | 6 ++-- src/Helpers/inflector.php | 2 +- src/Helpers/url.php | 2 +- src/Http/Concerns/InteractsWithFlashData.php | 4 +-- src/Http/Concerns/InteractsWithInput.php | 2 +- src/Http/MiddlewareQueue.php | 2 +- src/Http/Negotiator.php | 2 +- src/Http/Response.php | 2 +- src/Http/ResponseEmitter.php | 8 ++--- src/Http/ServerRequest.php | 6 ++-- src/Http/ServerRequestFactory.php | 2 +- src/Http/UploadedFileFactory.php | 14 ++++---- src/Http/Uri.php | 4 +-- src/Http/UrlGenerator.php | 6 ++-- src/Mail/Adapters/PHPMailer.php | 23 ++++++------ src/Mail/Adapters/SymfonyMailer.php | 2 +- src/Mail/Mail.php | 2 +- src/Middlewares/BodyParser.php | 4 +-- src/Middlewares/EncryptCookies.php | 2 +- src/Middlewares/PerformanceMetrics.php | 2 +- src/Middlewares/ShareErrorsFromSession.php | 2 +- src/Publisher/Publisher.php | 3 +- src/Router/AutoRouter.php | 34 +++++++++--------- src/Router/Dispatcher.php | 4 +-- src/Router/RouteCollection.php | 4 +-- src/Router/Router.php | 12 +++---- src/Validation/Validation.php | 2 +- src/View/Adapters/BladeAdapter.php | 2 +- src/View/Components/Component.php | 4 +-- src/View/Parser.php | 6 ++-- src/View/View.php | 4 +-- 59 files changed, 156 insertions(+), 149 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 6d88ccd9..473af1dc 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -44,5 +44,5 @@ 'Blitz PHP framework', 'Dimitri Sitchet Tomkeu', 'devcode.dst@gmail.com', - 2022 + 2022, ); diff --git a/rector.php b/rector.php index cbd01855..c06abb89 100644 --- a/rector.php +++ b/rector.php @@ -62,7 +62,7 @@ ->withCache( // Github action cache or local is_dir('/tmp') ? '/tmp/rector' : null, - FileCacheStorage::class + FileCacheStorage::class, ) // paths to refactor; solid alternative to CLI arguments ->withPaths([ diff --git a/src/Cli/Commands/Generators/Command.php b/src/Cli/Commands/Generators/Command.php index dbec074e..0fd20bfb 100644 --- a/src/Cli/Commands/Generators/Command.php +++ b/src/Cli/Commands/Generators/Command.php @@ -99,7 +99,7 @@ protected function prepare(string $class): string $class, ['{group}', '{command}'], [$group, $command], - ['type' => $type] + ['type' => $type], ); } } diff --git a/src/Cli/Commands/Generators/Component.php b/src/Cli/Commands/Generators/Component.php index c86b7278..708fe922 100644 --- a/src/Cli/Commands/Generators/Component.php +++ b/src/Cli/Commands/Generators/Component.php @@ -81,7 +81,7 @@ public function execute(array $params) $viewName = preg_replace( '/([a-z][a-z0-9_\/\\\\]+)(-component)$/i', '$1', - $viewName + $viewName, ) ?? $viewName; $namespace = substr($className, 0, strrpos($className, '\\') + 1); diff --git a/src/Cli/Commands/Generators/Controller.php b/src/Cli/Commands/Generators/Controller.php index cf840ceb..6c917d0c 100644 --- a/src/Cli/Commands/Generators/Controller.php +++ b/src/Cli/Commands/Generators/Controller.php @@ -121,7 +121,7 @@ protected function prepare(string $class): string [ 'type' => $rest, 'invokable' => $this->option('invokable'), - ] + ], ); } } diff --git a/src/Cli/Commands/Generators/Middleware.php b/src/Cli/Commands/Generators/Middleware.php index 4e6d3bb9..952afc83 100644 --- a/src/Cli/Commands/Generators/Middleware.php +++ b/src/Cli/Commands/Generators/Middleware.php @@ -89,7 +89,7 @@ protected function prepare(string $class): string $class, [], [], - ['standard' => $standard] + ['standard' => $standard], ); } } diff --git a/src/Cli/Commands/Routes/AutoRouteCollector.php b/src/Cli/Commands/Routes/AutoRouteCollector.php index f6adce99..28020546 100644 --- a/src/Cli/Commands/Routes/AutoRouteCollector.php +++ b/src/Cli/Commands/Routes/AutoRouteCollector.php @@ -29,7 +29,7 @@ public function __construct( private readonly string $defaultMethod, private readonly array $httpMethods, private readonly array $protectedControllers, - private readonly string $prefix = '' + private readonly string $prefix = '', ) { } @@ -53,7 +53,7 @@ public function get(): array $routes = $reader->read( $class, $this->defaultController, - $this->defaultMethod + $this->defaultMethod, ); if ($routes === []) { diff --git a/src/Cli/Commands/Routes/ControllerMethodReader.php b/src/Cli/Commands/Routes/ControllerMethodReader.php index 8e885671..46c013f0 100644 --- a/src/Cli/Commands/Routes/ControllerMethodReader.php +++ b/src/Cli/Commands/Routes/ControllerMethodReader.php @@ -63,7 +63,7 @@ public function read(string $class, string $defaultController = 'Home', string $ $classname, $methodName, $httpVerb, - $method + $method, ); if ($routeForDefaultController !== []) { @@ -170,7 +170,7 @@ private function getRouteForDefaultController( string $classname, string $methodName, string $httpVerb, - ReflectionMethod $method + ReflectionMethod $method, ): array { $output = []; diff --git a/src/Cli/Commands/Routes/Routes.php b/src/Cli/Commands/Routes/Routes.php index 77f1216c..f8352da4 100644 --- a/src/Cli/Commands/Routes/Routes.php +++ b/src/Cli/Commands/Routes/Routes.php @@ -136,7 +136,7 @@ protected function collectRoutes(RouteCollection $collection): array $collection->getDefaultController(), $collection->getDefaultMethod(), $methods, - $collection->getRegisteredControllers('*') + $collection->getRegisteredControllers('*'), ); $autoRoutes = $autoRouteCollector->get(); @@ -150,7 +150,7 @@ protected function collectRoutes(RouteCollection $collection): array $collection->getDefaultMethod(), $methods, $collection->getRegisteredControllers('*'), - $uri + $uri, ); $autoRoutes = [...$autoRoutes, ...$autoRouteCollector->get()]; @@ -340,8 +340,8 @@ protected function displayRoutes(array $routes, int $total): void $this->write( $this->color->line( sprintf('%s⇂ %s', str_repeat(' ', $maxMethodLength), $middleware), - ['fg' => Color::fg256(60)] - ) + ['fg' => Color::fg256(60)], + ), )->eol(); } } @@ -370,7 +370,7 @@ protected function displayStats(Collection $routes, int $total): void $this->justify( $method, (string) $routes->where('method', $method)->count(), - $options + $options, ); } } diff --git a/src/Cli/Commands/Server/rewrite.php b/src/Cli/Commands/Server/rewrite.php index 9f007d01..d3017ab4 100644 --- a/src/Cli/Commands/Server/rewrite.php +++ b/src/Cli/Commands/Server/rewrite.php @@ -25,7 +25,7 @@ } $uri = urldecode( - parse_url('https://blitz-php.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '' + parse_url('https://blitz-php.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '', ); // Toutes les requêtes sont gérées par index.php fichier. diff --git a/src/Cli/Commands/Translation/TranslationsFinder.php b/src/Cli/Commands/Translation/TranslationsFinder.php index f8574776..79422c89 100644 --- a/src/Cli/Commands/Translation/TranslationsFinder.php +++ b/src/Cli/Commands/Translation/TranslationsFinder.php @@ -68,7 +68,7 @@ public function execute(array $params) if (! in_array($optionLocale, config('app.supported_locales'), true)) { $this->error( $this->color->error('"' . $optionLocale . '" n\'est pas supporté. Les langues supportées sont: ' - . implode(', ', config('app.supported_locales'))) + . implode(', ', config('app.supported_locales'))), ); return EXIT_USER_INPUT; @@ -114,7 +114,7 @@ private function process(string $currentDir, string $currentLocale): void [ 'foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys, - 'countFiles' => $countFiles + 'countFiles' => $countFiles, ] = $this->findLanguageKeysInFiles($files); ksort($foundLanguageKeys); diff --git a/src/Cli/Commands/Utilities/About.php b/src/Cli/Commands/Utilities/About.php index 274f70b5..5bc05910 100644 --- a/src/Cli/Commands/Utilities/About.php +++ b/src/Cli/Commands/Utilities/About.php @@ -92,7 +92,7 @@ public function execute(array $params) ->map(static fn ($value, $key) => [$key, $value]) ->values() ->all(); - })->flatten(1) + })->flatten(1), ) ->sortBy(static function ($data, $key): int { $index = array_search($key, ['Environnement', 'Cache', 'Gestionnaires'], true); diff --git a/src/Cli/Commands/Utilities/ConfigCheck.php b/src/Cli/Commands/Utilities/ConfigCheck.php index 2a98386c..d71828ae 100644 --- a/src/Cli/Commands/Utilities/ConfigCheck.php +++ b/src/Cli/Commands/Utilities/ConfigCheck.php @@ -115,7 +115,7 @@ public function execute(array $params) $this->write($this->getKintDump($others)); } else { $this->write( - $this->color->line($this->getVarDump($others), ['fg' => Color::CYAN]) + $this->color->line($this->getVarDump($others), ['fg' => Color::CYAN]), ); } } @@ -153,7 +153,7 @@ private function getVarDump(array $config): string return preg_replace( '!.*Commands/Utilities/ConfigCheck.php.*\n!u', '', - $output + $output, ); } } diff --git a/src/Cli/Commands/Utilities/Optimize.php b/src/Cli/Commands/Utilities/Optimize.php index 2ef067cd..98d48bb1 100644 --- a/src/Cli/Commands/Utilities/Optimize.php +++ b/src/Cli/Commands/Utilities/Optimize.php @@ -97,7 +97,7 @@ private function enableCaching(): void [ "'config_cache_enabled' => false," => "'config_cache_enabled' => true,", "'locator_cache_enabled' => false," => "'locator_cache_enabled' => true,", - ] + ], ); if ($result) { diff --git a/src/Cli/Console/Console.php b/src/Cli/Console/Console.php index a9ed9ef7..87349b75 100644 --- a/src/Cli/Console/Console.php +++ b/src/Cli/Console/Console.php @@ -182,7 +182,7 @@ protected function files(LocatorInterface $locator): array { $files = array_merge( $locator->listFiles('Commands/'), // Commandes de l'application ou des fournisseurs - $locator->listFiles('Cli/Commands/') // Commandes internes du framework + $locator->listFiles('Cli/Commands/'), // Commandes internes du framework ); return array_unique($files); @@ -244,7 +244,7 @@ private function addCommand(string $className, ?Logger $logger = null) $instance->name, $instance->description, false, - $this + $this, ); // Defini le groupe auquel appartient la commande diff --git a/src/Config/Config.php b/src/Config/Config.php index 46269092..14e9d616 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -297,7 +297,7 @@ private function loadRegistrar() throw new ConfigException( 'Pendant la découverte automatique des Registrars,' . ' "' . static::class . '" a été re-éxecuté.' - . ' "' . clean_path(static::$registrarFile) . '" doit avoir un mauvais code.' + . ' "' . clean_path(static::$registrarFile) . '" doit avoir un mauvais code.', ); } diff --git a/src/Container/Services.php b/src/Container/Services.php index 56050fde..e97d39ab 100644 --- a/src/Container/Services.php +++ b/src/Container/Services.php @@ -205,7 +205,7 @@ public static function cookie(bool $shared = true): CookieManagerInterface $config->domain ?: '', $config->secure ?: false, $config->httponly ?: true, - $config->samesite ?: 'Lax' + $config->samesite ?: 'Lax', ); } diff --git a/src/Debug/Logger.php b/src/Debug/Logger.php index 9bcea8cb..b8359e6b 100644 --- a/src/Debug/Logger.php +++ b/src/Debug/Logger.php @@ -197,7 +197,7 @@ private function pushFileHandler(stdClass $options): void } $this->monolog->pushHandler( - $this->setFormatter($handler, ['json', 'line', 'scalar', 'normalizer'], $options->format) + $this->setFormatter($handler, ['json', 'line', 'scalar', 'normalizer'], $options->format), ); } @@ -211,7 +211,7 @@ private function pushErrorHandler(stdClass $options): void $handler = new ErrorLogHandler($options->type ?: ErrorLogHandler::OPERATING_SYSTEM, $options->level ?: LogLevel::DEBUG); $this->monolog->pushHandler( - $this->setFormatter($handler, ['json', 'line'], $options->format) + $this->setFormatter($handler, ['json', 'line'], $options->format), ); } @@ -225,7 +225,7 @@ private function pushEmailHandler(stdClass $options): void $handler = new NativeMailerHandler($options->to, $options->subject, $options->from, $options->level ?: LogLevel::ERROR); $this->monolog->pushHandler( - $this->setFormatter($handler, ['html', 'json', 'line'], $options->format) + $this->setFormatter($handler, ['html', 'json', 'line'], $options->format), ); } @@ -234,7 +234,7 @@ private function pushTelegramHandler(stdClass $options): void $handler = new TelegramBotHandler($options->api_key, $options->channel, $options->level ?: LogLevel::DEBUG); $this->monolog->pushHandler( - $this->setFormatter($handler, [], $options->format) + $this->setFormatter($handler, [], $options->format), ); } @@ -248,7 +248,7 @@ private function pushChromeHandler(stdClass $options): void $handler = new ChromePHPHandler($options->level ?: LogLevel::DEBUG); $this->monolog->pushHandler( - $this->setFormatter($handler, [], $options->format) + $this->setFormatter($handler, [], $options->format), ); } @@ -262,7 +262,7 @@ private function pushFirebugHandler(stdClass $options): void $handler = new FirePHPHandler(); $this->monolog->pushHandler( - $this->setFormatter($handler, [], $options->format) + $this->setFormatter($handler, [], $options->format), ); } @@ -276,7 +276,7 @@ private function pushBrowserHandler(stdClass $options): void $handler = new BrowserConsoleHandler(); $this->monolog->pushHandler( - $this->setFormatter($handler, [], $options->format) + $this->setFormatter($handler, [], $options->format), ); } diff --git a/src/Debug/Toolbar.php b/src/Debug/Toolbar.php index b422a35b..d8498664 100644 --- a/src/Debug/Toolbar.php +++ b/src/Debug/Toolbar.php @@ -67,7 +67,7 @@ public function __construct(?stdClass $config = null) if (! class_exists($collector)) { logger()->critical( 'Le collecteur de la barre d\'outils n\'existe pas (' . $collector . ').' - . ' Veuillez vérifier $collectors dans le fichier app/Config/toolbar.php.' + . ' Veuillez vérifier $collectors dans le fichier app/Config/toolbar.php.', ); continue; @@ -402,7 +402,7 @@ public function prepare(array $stats, ?ServerRequestInterface $request = null, ? $stats['startTime'], $stats['totalTime'], $request, - $response + $response, ); // Mise à jour vers microtime() pour que nous puissions obtenir l'historique @@ -515,7 +515,7 @@ protected function format($debugbar_time, string $data, string $format = 'html') $history = new HistoryCollector(); $history->setFiles( $debugbarTime[0], - $this->config->max_history + $this->config->max_history, ); $data['collectors'][] = $history->getAsArray(); diff --git a/src/Debug/Toolbar/Collectors/RoutesCollector.php b/src/Debug/Toolbar/Collectors/RoutesCollector.php index a58f8548..15b3bcc0 100644 --- a/src/Debug/Toolbar/Collectors/RoutesCollector.php +++ b/src/Debug/Toolbar/Collectors/RoutesCollector.php @@ -102,7 +102,7 @@ public function display(): array ' | default: ' . var_export( $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, - true + true, ), ]; } diff --git a/src/Debug/Toolbar/Views/toolbar.tpl.php b/src/Debug/Toolbar/Views/toolbar.tpl.php index 5593e8f0..a2ea9e54 100644 --- a/src/Debug/Toolbar/Views/toolbar.tpl.php +++ b/src/Debug/Toolbar/Views/toolbar.tpl.php @@ -1,21 +1,25 @@ diff --git a/src/Enums/Method.php b/src/Enums/Method.php index a6cdb579..b61beeda 100644 --- a/src/Enums/Method.php +++ b/src/Enums/Method.php @@ -111,7 +111,7 @@ public static function fromName(string $name): string 'post' => self::POST, 'put' => self::PUT, 'trace' => self::TRACE, - default => throw new InvalidArgumentException('Nom de methode inconnu') + default => throw new InvalidArgumentException('Nom de methode inconnu'), }; } diff --git a/src/Event/EventDiscover.php b/src/Event/EventDiscover.php index e1a469bc..20ba8bb1 100644 --- a/src/Event/EventDiscover.php +++ b/src/Event/EventDiscover.php @@ -31,7 +31,7 @@ public function discove() { $files = array_merge( $this->locator->listFiles('Events/'), // @deprecated just use for compatibility - $this->locator->listFiles('Listeners/') + $this->locator->listFiles('Listeners/'), ); foreach ($files as $file) { diff --git a/src/Exceptions/FrameworkException.php b/src/Exceptions/FrameworkException.php index 570cd99c..a8f3cbc8 100644 --- a/src/Exceptions/FrameworkException.php +++ b/src/Exceptions/FrameworkException.php @@ -49,7 +49,7 @@ public static function missingExtension(string $extension) // @codeCoverageIgnoreStart $message = sprintf( 'The framework needs the following extension(s) installed and loaded: %s.', - $extension + $extension, ); // @codeCoverageIgnoreEnd } else { diff --git a/src/Exceptions/RedirectException.php b/src/Exceptions/RedirectException.php index ee0e7c44..d0f57da0 100644 --- a/src/Exceptions/RedirectException.php +++ b/src/Exceptions/RedirectException.php @@ -44,7 +44,7 @@ public function __construct(ResponseInterface|string $message = '', int $code = if ($this->response->getHeaderLine('Location') === '' && $this->response->getHeaderLine('Refresh') === '') { throw new LogicException( - 'The Response object passed to RedirectException does not contain a redirect address.' + 'The Response object passed to RedirectException does not contain a redirect address.', ); } @@ -65,7 +65,7 @@ public function getResponse(): ResponseInterface service('logger')->info( 'REDIRECTED ROUTE at ' - . ($this->response->getHeaderLine('Location') ?: substr($this->response->getHeaderLine('Refresh'), 6)) + . ($this->response->getHeaderLine('Location') ?: substr($this->response->getHeaderLine('Refresh'), 6)), ); return $this->response; diff --git a/src/Helpers/assets.php b/src/Helpers/assets.php index 3f87bd97..43ccf8b3 100644 --- a/src/Helpers/assets.php +++ b/src/Helpers/assets.php @@ -72,7 +72,7 @@ function lib_css_url(string $name): string $name = str_replace( [$site_url . 'lib/', $site_url . 'vendor/', $site_url . 'plugins/'], '', - htmlspecialchars($name) + htmlspecialchars($name), ); if (is_localfile($name)) { @@ -109,7 +109,7 @@ function lib_js_url(string $name): string $name = str_replace( [$site_url . 'lib/', $site_url . 'vendor/', $site_url . 'plugins/'], '', - htmlspecialchars($name) + htmlspecialchars($name), ); if (is_localfile($name)) { diff --git a/src/Helpers/common.php b/src/Helpers/common.php index 22c4d3ca..3f5181f9 100644 --- a/src/Helpers/common.php +++ b/src/Helpers/common.php @@ -27,6 +27,7 @@ use BlitzPHP\Utilities\Helpers; use BlitzPHP\Utilities\Iterable\Collection; use BlitzPHP\Utilities\Support\Invader; +use BlitzPHP\View\View; use GuzzleHttp\Psr7\Utils; use Psr\Http\Message\StreamInterface; @@ -171,7 +172,7 @@ function command(string $command) // @codeCoverageIgnoreStart throw new InvalidArgumentException(sprintf( 'Impossible d\'analyser l\'entrée à proximité "... %s ...".', - substr($command, $cursor, 10) + substr($command, $cursor, 10), )); // @codeCoverageIgnoreEnd } @@ -971,7 +972,7 @@ function view_exist(string $name, ?string $ext = null, array $options = []): boo * * NOTE : Ne fournit pas d'échappement des données, ce qui doit être géré manuellement par le développeur. * - * @return BlitzPHP\View\View + * @return View */ function view(string $view, array $data = [], array $options = []) { diff --git a/src/Helpers/date.php b/src/Helpers/date.php index 9c7f962a..2e933b94 100644 --- a/src/Helpers/date.php +++ b/src/Helpers/date.php @@ -46,7 +46,7 @@ function now(?string $timezone = null, bool $returnObject = true) $year, $hour, $minute, - $second + $second, ); return mktime($hour, $minute, $second, $month, $day, $year); diff --git a/src/Helpers/filesystem.php b/src/Helpers/filesystem.php index 72bf1f69..618778d9 100644 --- a/src/Helpers/filesystem.php +++ b/src/Helpers/filesystem.php @@ -125,7 +125,7 @@ function delete_files(string $path, bool $delDir = false, bool $htdocs = false, try { foreach (new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS), - RecursiveIteratorIterator::CHILD_FIRST + RecursiveIteratorIterator::CHILD_FIRST, ) as $object) { $filename = $object->getFilename(); if (! $hidden && $filename[0] === '.') { @@ -168,7 +168,7 @@ function get_filenames( string $sourceDir, ?bool $includePath = false, bool $hidden = false, - bool $includeDir = true + bool $includeDir = true, ): array { $files = []; @@ -178,7 +178,7 @@ function get_filenames( try { foreach (new RecursiveIteratorIterator( new RecursiveDirectoryIterator($sourceDir, RecursiveDirectoryIterator::SKIP_DOTS), - RecursiveIteratorIterator::SELF_FIRST + RecursiveIteratorIterator::SELF_FIRST, ) as $name => $object) { $basename = pathinfo($name, PATHINFO_BASENAME); if (! $hidden && $basename[0] === '.') { diff --git a/src/Helpers/inflector.php b/src/Helpers/inflector.php index de74d07b..aa80e551 100644 --- a/src/Helpers/inflector.php +++ b/src/Helpers/inflector.php @@ -372,7 +372,7 @@ function is_pluralizable(string $word): bool 'wisdom', 'work', ], - true + true, ); } } diff --git a/src/Helpers/url.php b/src/Helpers/url.php index 5c4d1051..9f8ee7de 100644 --- a/src/Helpers/url.php +++ b/src/Helpers/url.php @@ -62,7 +62,7 @@ function site_url($relativePath = '', ?string $scheme = null): string $uri->getAuthority(), $uri->getPath(), $uri->getQuery(), - $uri->getFragment() + $uri->getFragment(), ); } } diff --git a/src/Http/Concerns/InteractsWithFlashData.php b/src/Http/Concerns/InteractsWithFlashData.php index 8be573b5..7750a824 100644 --- a/src/Http/Concerns/InteractsWithFlashData.php +++ b/src/Http/Concerns/InteractsWithFlashData.php @@ -54,7 +54,7 @@ public function flash(): void public function flashOnly($keys): void { $this->session()->flashInput( - $this->only(is_array($keys) ? $keys : func_get_args()) + $this->only(is_array($keys) ? $keys : func_get_args()), ); } @@ -66,7 +66,7 @@ public function flashOnly($keys): void public function flashExcept($keys): void { $this->session()->flashInput( - $this->except(is_array($keys) ? $keys : func_get_args()) + $this->except(is_array($keys) ? $keys : func_get_args()), ); } diff --git a/src/Http/Concerns/InteractsWithInput.php b/src/Http/Concerns/InteractsWithInput.php index 1633859e..08992e3f 100644 --- a/src/Http/Concerns/InteractsWithInput.php +++ b/src/Http/Concerns/InteractsWithInput.php @@ -267,7 +267,7 @@ public function input(?string $key = null, mixed $default = null): mixed return Arr::dataGet( $this->data + $this->query, $key, - $default + $default, ); } diff --git a/src/Http/MiddlewareQueue.php b/src/Http/MiddlewareQueue.php index 21458274..f0e30d59 100644 --- a/src/Http/MiddlewareQueue.php +++ b/src/Http/MiddlewareQueue.php @@ -380,7 +380,7 @@ protected function resolve(Closure|MiddlewareInterface|string $middleware): Midd } else { throw new InvalidArgumentException(sprintf( 'Middleware, `%s` n\'a pas été trouvé.', - $middleware + $middleware, )); } diff --git a/src/Http/Negotiator.php b/src/Http/Negotiator.php index 80854625..3e19fc6d 100644 --- a/src/Http/Negotiator.php +++ b/src/Http/Negotiator.php @@ -184,7 +184,7 @@ public function parseHeader(string $header): array preg_match( '/^(?P.+?)=(?P"|\')?(?P.*?)(?:\k)?$/', $pair, - $param + $param, ); $parameters[trim($param['name'])] = trim($param['value']); } diff --git a/src/Http/Response.php b/src/Http/Response.php index 51c76254..3403d0a3 100644 --- a/src/Http/Response.php +++ b/src/Http/Response.php @@ -769,7 +769,7 @@ public function withCache($since, $time = '+1 day'): static $time = strtotime($time); if ($time === false) { throw new InvalidArgumentException( - 'Invalid time parameter. Ensure your time value can be parsed by strtotime' + 'Invalid time parameter. Ensure your time value can be parsed by strtotime', ); } } diff --git a/src/Http/ResponseEmitter.php b/src/Http/ResponseEmitter.php index 6ed717aa..4bec2410 100644 --- a/src/Http/ResponseEmitter.php +++ b/src/Http/ResponseEmitter.php @@ -89,7 +89,7 @@ public function emitHeaders(ResponseInterface $response) header(sprintf( '%s: %s', $name, - $value + $value, ), $first); $first = false; } @@ -177,7 +177,7 @@ protected function emitStatusLine(ResponseInterface $response) 'HTTP/%s %d%s', $response->getProtocolVersion(), $response->getStatusCode(), - ($reasonPhrase !== '' && $reasonPhrase !== '0' ? ' ' . $reasonPhrase : '') + ($reasonPhrase !== '' && $reasonPhrase !== '0' ? ' ' . $reasonPhrase : ''), )); } @@ -195,7 +195,7 @@ protected function emitCookies(array $cookies) setcookie( $cookie['name'], $cookie['value'], - ['expires' => $cookie['expires'], 'path' => $cookie['path'], 'domain' => $cookie['domain'], 'secure' => $cookie['secure'], 'httponly' => $cookie['httponly']] + ['expires' => $cookie['expires'], 'path' => $cookie['path'], 'domain' => $cookie['domain'], 'secure' => $cookie['secure'], 'httponly' => $cookie['httponly']], ); continue; @@ -236,7 +236,7 @@ protected function emitCookies(array $cookies) setcookie( $data['name'], $data['value'], - ['expires' => $data['expires'], 'path' => $data['path'], 'domain' => $data['domain'], 'secure' => $data['secure'], 'httponly' => $data['httponly']] + ['expires' => $data['expires'], 'path' => $data['path'], 'domain' => $data['domain'], 'secure' => $data['secure'], 'httponly' => $data['httponly']], ); } } diff --git a/src/Http/ServerRequest.php b/src/Http/ServerRequest.php index 8c2bb2a7..132f527f 100644 --- a/src/Http/ServerRequest.php +++ b/src/Http/ServerRequest.php @@ -265,7 +265,7 @@ protected function _setConfig(array $config): void if (! (is_array($post) || is_object($post) || $post === null)) { throw new InvalidArgumentException(sprintf( 'La clé `post` doit être un tableau, un objet ou null. On a obtenu `%s` à la place.', - get_debug_type($post) + get_debug_type($post), )); } $this->data = $post; @@ -890,7 +890,7 @@ public function withMethod(string $method): static if (! preg_match('/^[!#$%&\'*+.^_`\|~0-9a-z-]+$/i', $method)) { throw new InvalidArgumentException(sprintf( 'Méthode HTTP non prise en charge "%s" fournie', - $method + $method, )); } $new->_environment['REQUEST_METHOD'] = $method; @@ -1534,7 +1534,7 @@ public function withoutAttribute(string $name): static $new = clone $this; if (in_array($name, $this->emulatedAttributes, true)) { throw new InvalidArgumentException( - "Vous ne pouvez pas supprimer '{$name}'. C'est un attribut BlitzPHP obligatoire." + "Vous ne pouvez pas supprimer '{$name}'. C'est un attribut BlitzPHP obligatoire.", ); } unset($new->attributes[$name]); diff --git a/src/Http/ServerRequestFactory.php b/src/Http/ServerRequestFactory.php index 03f36f76..b351338c 100644 --- a/src/Http/ServerRequestFactory.php +++ b/src/Http/ServerRequestFactory.php @@ -46,7 +46,7 @@ public static function fromGlobals( ?array $query = null, ?array $parsedBody = null, ?array $cookies = null, - ?array $files = null + ?array $files = null, ): Request { $server = self::normalizeServer($server ?? $_SERVER); diff --git a/src/Http/UploadedFileFactory.php b/src/Http/UploadedFileFactory.php index 13b80897..53689abe 100644 --- a/src/Http/UploadedFileFactory.php +++ b/src/Http/UploadedFileFactory.php @@ -45,7 +45,7 @@ public function createUploadedFile( ?int $size = null, int $error = UPLOAD_ERR_OK, ?string $clientFilename = null, - ?string $clientMediaType = null + ?string $clientMediaType = null, ): UploadedFileInterface { if ($size === null) { $size = $stream->getSize() ?? 0; @@ -66,7 +66,7 @@ public static function makeUploadedFile(array $spec): UploadedFile if (! isset($spec['tmp_name']) || ! isset($spec['size']) || ! isset($spec['error'])) { throw new InvalidArgumentException(sprintf( '$spec fourni à %s DOIT contenir chacune des clés "tmp_name", "size", et "error" ; une ou plusieurs étaient manquantes', - __FUNCTION__ + __FUNCTION__, )); } @@ -75,7 +75,7 @@ public static function makeUploadedFile(array $spec): UploadedFile (int) $spec['size'], $spec['error'], $spec['name'] ?? null, - $spec['type'] ?? null + $spec['type'] ?? null, ); } @@ -108,7 +108,7 @@ public static function normalizeUploadedFiles(array $files): array array $sizeTree, array $errorTree, ?array $nameTree = null, - ?array $typeTree = null + ?array $typeTree = null, ) use (&$recursiveNormalize): array { $normalized = []; @@ -120,7 +120,7 @@ public static function normalizeUploadedFiles(array $files): array $sizeTree[$key], $errorTree[$key], $nameTree[$key] ?? null, - $typeTree[$key] ?? null + $typeTree[$key] ?? null, ); continue; @@ -157,7 +157,7 @@ public static function normalizeUploadedFiles(array $files): array 'Les fichiers fournis à %s DOIVENT contenir chacune des clés "tmp_name", "size" et "error", chacune étant représentée sous la forme d\'un tableau ; une ou plusieurs valeurs manquaient ou n\'étaient pas des tableaux.', - __FUNCTION__ + __FUNCTION__, )); } @@ -166,7 +166,7 @@ public static function normalizeUploadedFiles(array $files): array $files['size'], $files['error'], $files['name'] ?? null, - $files['type'] ?? null + $files['type'] ?? null, ); }; diff --git a/src/Http/Uri.php b/src/Http/Uri.php index 914f203e..6af6ef1b 100644 --- a/src/Http/Uri.php +++ b/src/Http/Uri.php @@ -332,7 +332,7 @@ public function __toString(): string $this->getAuthority(), $path, // Les URI absolus doivent utiliser un "/" pour un chemin vide $this->getQuery(), - $this->getFragment() + $this->getFragment(), ); } @@ -687,7 +687,7 @@ protected function filterPath(?string $path = null): string $path = preg_replace_callback( '/(?:[^' . static::CHAR_UNRESERVED . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', static fn (array $matches) => rawurlencode($matches[0]), - $path + $path, ); return $path; diff --git a/src/Http/UrlGenerator.php b/src/Http/UrlGenerator.php index 3b43149e..8044a19a 100644 --- a/src/Http/UrlGenerator.php +++ b/src/Http/UrlGenerator.php @@ -155,8 +155,8 @@ public function to(string $path, mixed $extra = [], ?bool $secure = null): strin '/', array_map( 'rawurlencode', - $this->formatParameters($extra) - ) + $this->formatParameters($extra), + ), ); // Once we have the scheme we will compile the "tail" by collapsing the values @@ -168,7 +168,7 @@ public function to(string $path, mixed $extra = [], ?bool $secure = null): strin return $this->format( $root, - '/' . trim($path . '/' . $tail, '/') + '/' . trim($path . '/' . $tail, '/'), ) . $query; } diff --git a/src/Mail/Adapters/PHPMailer.php b/src/Mail/Adapters/PHPMailer.php index 01d44abf..58eec7d7 100644 --- a/src/Mail/Adapters/PHPMailer.php +++ b/src/Mail/Adapters/PHPMailer.php @@ -11,6 +11,7 @@ namespace BlitzPHP\Mail\Adapters; +use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\PHPMailer as Mailer; use PHPMailer\PHPMailer\SMTP; @@ -192,7 +193,7 @@ public function alt(string $content): static /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function attach(array|string $path, string $name = '', string $type = '', string $encoding = self::ENCODING_BASE64, string $disposition = 'attachment'): static { @@ -210,7 +211,7 @@ public function attach(array|string $path, string $name = '', string $type = '', /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function attachBinary($binary, string $name, string $type = '', string $encoding = self::ENCODING_BASE64, string $disposition = 'attachment'): static { @@ -222,7 +223,7 @@ public function attachBinary($binary, string $name, string $type = '', string $e /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function bcc(array|string $address, bool|string $name = '', bool $set = false): static { @@ -242,7 +243,7 @@ public function bcc(array|string $address, bool|string $name = '', bool $set = f /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function cc(array|string $address, bool|string $name = '', bool $set = false): static { @@ -276,7 +277,7 @@ public function dkim(string $pk, string $passphrase = '', string $selector = '', /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function embedded(string $path, string $cid, string $name = '', string $type = '', string $encoding = self::ENCODING_BASE64, string $disposition = 'inline'): static { @@ -288,7 +289,7 @@ public function embedded(string $path, string $cid, string $name = '', string $t /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function embeddedBinary($binary, string $cid, string $name = '', string $type = '', string $encoding = self::ENCODING_BASE64, string $disposition = 'inline'): static { @@ -300,7 +301,7 @@ public function embeddedBinary($binary, string $cid, string $name = '', string $ /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function from(string $address, string $name = ''): static { @@ -312,7 +313,7 @@ public function from(string $address, string $name = ''): static /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function header(array|string $name, ?string $value = null): static { @@ -358,7 +359,7 @@ public function message(string $message): static /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function replyTo(array|string $address, bool|string $name = '', bool $set = false): static { @@ -378,7 +379,7 @@ public function replyTo(array|string $address, bool|string $name = '', bool $set /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function send(): bool { @@ -418,7 +419,7 @@ public function text(string $content): static /** * {@inheritDoc} * - * @throws \PHPMailer\PHPMailer\Exception + * @throws Exception */ public function to(array|string $address, bool|string $name = '', bool $set = false): static { diff --git a/src/Mail/Adapters/SymfonyMailer.php b/src/Mail/Adapters/SymfonyMailer.php index 441d407f..f738ad61 100644 --- a/src/Mail/Adapters/SymfonyMailer.php +++ b/src/Mail/Adapters/SymfonyMailer.php @@ -428,7 +428,7 @@ private function transporter(): Mailer } return $this->transporter = new Mailer( - Transport::fromDsn($this->buildDsn()) + Transport::fromDsn($this->buildDsn()), ); } diff --git a/src/Mail/Mail.php b/src/Mail/Mail.php index e8358385..ccfdf210 100644 --- a/src/Mail/Mail.php +++ b/src/Mail/Mail.php @@ -282,7 +282,7 @@ public function message(string $message): static return match ($this->config['mailType']) { 'html' => $this->html($message), 'text' => $this->text($message), - default => $this + default => $this, }; } diff --git a/src/Middlewares/BodyParser.php b/src/Middlewares/BodyParser.php index 7ca7bfe5..5a7b0e8b 100644 --- a/src/Middlewares/BodyParser.php +++ b/src/Middlewares/BodyParser.php @@ -62,13 +62,13 @@ public function __construct(array $options = []) if ($options['json']) { $this->addParser( ['application/json', 'text/json'], - $this->decodeJson(...) + $this->decodeJson(...), ); } if ($options['xml']) { $this->addParser( ['application/xml', 'text/xml'], - $this->decodeXml(...) + $this->decodeXml(...), ); } if ($options['methods']) { diff --git a/src/Middlewares/EncryptCookies.php b/src/Middlewares/EncryptCookies.php index 2cd448ae..59fa7392 100644 --- a/src/Middlewares/EncryptCookies.php +++ b/src/Middlewares/EncryptCookies.php @@ -156,7 +156,7 @@ protected function encrypt(ResponseInterface $response): Response $cookie, $this->encrypter->encrypt( CookieValuePrefix::create($cookie->getName(), $this->encrypter->getKey()) . $cookie->getValue(), - ) + ), )); } diff --git a/src/Middlewares/PerformanceMetrics.php b/src/Middlewares/PerformanceMetrics.php index 40a45390..6dbbbbf4 100644 --- a/src/Middlewares/PerformanceMetrics.php +++ b/src/Middlewares/PerformanceMetrics.php @@ -38,7 +38,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface (string) $benchmark->getElapsedTime('total_execution'), number_format(memory_get_peak_usage() / 1024 / 1024, 3), ], - $body + $body, ); $response = $response->withBody(to_stream($output)); diff --git a/src/Middlewares/ShareErrorsFromSession.php b/src/Middlewares/ShareErrorsFromSession.php index 38914f7b..780996d1 100644 --- a/src/Middlewares/ShareErrorsFromSession.php +++ b/src/Middlewares/ShareErrorsFromSession.php @@ -40,7 +40,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface // Un sac vide est défini lorsqu'il n'y a pas d'erreurs. $this->view->share( 'errors', - new ErrorBag($request->session()->getFlashdata('errors') ?: []) + new ErrorBag($request->session()->getFlashdata('errors') ?: []), ); // Le fait de placer les erreurs dans la vue pour chaque vue permet au développeur de supposer que certaines erreurs sont toujours disponibles, diff --git a/src/Publisher/Publisher.php b/src/Publisher/Publisher.php index c165f668..f7f6de9f 100644 --- a/src/Publisher/Publisher.php +++ b/src/Publisher/Publisher.php @@ -11,6 +11,7 @@ namespace BlitzPHP\Publisher; +use BlitzPHP\Contracts\Autoloader\LocatorInterface; use BlitzPHP\Exceptions\PublisherException; use BlitzPHP\Filesystem\Files\FileCollection; use BlitzPHP\Http\Uri; @@ -99,7 +100,7 @@ final public static function discover(string $directory = 'Publishers', string $ self::$discovered[$key] = []; - /** @var \BlitzPHP\Contracts\Autoloader\LocatorInterface */ + /** @var LocatorInterface */ $locator = service('locator'); $files = $namespace === '' diff --git a/src/Router/AutoRouter.php b/src/Router/AutoRouter.php index e9d94495..111b848c 100644 --- a/src/Router/AutoRouter.php +++ b/src/Router/AutoRouter.php @@ -117,7 +117,7 @@ public function __construct( string $namespace, private readonly string $defaultController, private readonly string $defaultMethod, - private readonly bool $translateURIDashes + private readonly bool $translateURIDashes, ) { $this->namespace = rtrim($namespace, '\\'); @@ -206,7 +206,7 @@ private function searchLastDefaultController(): bool $namespaces = array_map( fn ($segment) => $this->translateURI($segment), - $segments + $segments, ); $controller = '\\' . $this->namespace @@ -277,7 +277,7 @@ public function getRoute(string $uri, string $httpVerb): array // Empêcher l'accès au chemin de contrôleur par défaut if (strtolower($baseControllerName) === strtolower($this->defaultController)) { throw new PageNotFoundException( - 'Impossible d\'accéder au contrôleur par défaut "' . $this->controller . '" avec le nom du contrôleur comme chemin de l\'URI.' + 'Impossible d\'accéder au contrôleur par défaut "' . $this->controller . '" avec le nom du contrôleur comme chemin de l\'URI.', ); } } elseif ($this->searchLastDefaultController()) { @@ -318,14 +318,14 @@ public function getRoute(string $uri, string $httpVerb): array // Empêcher l'accès à la méthode du contrôleur par défaut if (strtolower($baseControllerName) === strtolower($this->defaultController)) { throw new PageNotFoundException( - 'Impossible d\'accéder au contrôleur par défaut "' . $this->controller . '::' . $this->method . '"' + 'Impossible d\'accéder au contrôleur par défaut "' . $this->controller . '::' . $this->method . '"', ); } // Empêcher l'accès au chemin de méthode par défaut if (strtolower($this->method) === strtolower($defaultMethod)) { throw new PageNotFoundException( - 'Impossible d\'accéder à la méthode par défaut "' . $this->method . '" avec le nom de méthode comme chemin d\'URI.' + 'Impossible d\'accéder à la méthode par défaut "' . $this->method . '" avec le nom de méthode comme chemin d\'URI.', ); } } elseif (method_exists($this->controller, $defaultMethod)) { @@ -395,7 +395,7 @@ private function checkParameters(): void throw new PageNotFoundException( 'Le nombre de param dans l\'URI est supérieur aux paramètres de la méthode du contrôleur.' . ' Handler:' . $this->controller . '::' . $this->method - . ', URI:' . $this->uri + . ', URI:' . $this->uri, ); } } @@ -408,7 +408,7 @@ private function checkRemap(): void throw new PageNotFoundException( 'AutoRouterImproved ne prend pas en charge la methode `_remap()`.' - . ' Contrôleur:' . $this->controller + . ' Contrôleur:' . $this->controller, ); } catch (ReflectionException) { // Ne rien faire @@ -431,7 +431,7 @@ private function checkUnderscore(): void . ' quand $translate_uri_dashes est activé.' . ' Veuillez utiliser les tiret.' . ' Handler:' . $this->controller . '::' . $this->method - . ', URI:' . $this->uri + . ', URI:' . $this->uri, ); } } @@ -451,7 +451,7 @@ private function checkUriForController(string $classname): void if (! in_array(ltrim($classname, '\\'), get_declared_classes(), true)) { throw new PageNotFoundException( - '"' . $classname . '" n\'a pas été trouvé.' + '"' . $classname . '" n\'a pas été trouvé.', ); } } @@ -476,7 +476,7 @@ private function checkUriForMethod(string $method): void && ! in_array($method, get_class_methods($this->controller), true) ) { throw new PageNotFoundException( - '"' . $this->controller . '::' . $method . '()" n\'a pas été trouvé.' + '"' . $this->controller . '::' . $method . '()" n\'a pas été trouvé.', ); } } @@ -500,7 +500,7 @@ private function translateURI(string $segment): string . ' contenant des lettres majuscules ("' . $segment . '")' . ' lorsque $translateUriToCamelCase est activé.' . ' Veuillez utiliser le tiret.' - . ' URI:' . $this->uri + . ' URI:' . $this->uri, ); } @@ -510,7 +510,7 @@ private function translateURI(string $segment): string . ' contenant un double tiret ("' . $segment . '")' . ' lorsque $translateUriToCamelCase est activé.' . ' Veuillez utiliser le tiret simple.' - . ' URI:' . $this->uri + . ' URI:' . $this->uri, ); } @@ -518,8 +518,8 @@ private function translateURI(string $segment): string ' ', '', ucwords( - preg_replace('/[\-]+/', ' ', $segment) - ) + preg_replace('/[\-]+/', ' ', $segment), + ), ); } @@ -547,7 +547,7 @@ private function setDirectory(): void $dir = str_replace( '\\', '/', - ltrim(substr($namespaces, strlen($this->namespace)), '\\') + ltrim(substr($namespaces, strlen($this->namespace)), '\\'), ); if ($dir !== '') { @@ -564,7 +564,7 @@ private function protectDefinedRoutes(): void if ($routeLowerCase === $controller) { throw new PageNotFoundException( - 'Impossible d\'accéder à un contrôleur définie dans les routes. Contrôleur : ' . $controllerInRoutes + 'Impossible d\'accéder à un contrôleur définie dans les routes. Contrôleur : ' . $controllerInRoutes, ); } } @@ -609,7 +609,7 @@ public function makeController(string $name): string return preg_replace( ['#(\_)?Controller$#i', '#' . config('app.url_suffix') . '$#i'], '', - ucfirst($name) + ucfirst($name), ) . 'Controller'; } } diff --git a/src/Router/Dispatcher.php b/src/Router/Dispatcher.php index 28e39f41..91c3841f 100644 --- a/src/Router/Dispatcher.php +++ b/src/Router/Dispatcher.php @@ -565,7 +565,7 @@ public function storePreviousURL($uri) $uri->getAuthority(), $uri->getPath(), $uri->getQuery(), - $uri->getFragment() + $uri->getFragment(), )); } @@ -579,7 +579,7 @@ protected function sendResponse() $this->response = service('toolbar')->process( $this->getPerformanceStats(), $this->request, - $this->response + $this->response, ); } diff --git a/src/Router/RouteCollection.php b/src/Router/RouteCollection.php index fad1769b..1de5e05d 100644 --- a/src/Router/RouteCollection.php +++ b/src/Router/RouteCollection.php @@ -1317,7 +1317,7 @@ protected function buildReverseRoute(string $from, array $params, array $queries foreach ($matches[0] as $index => $placeholder) { if (! isset($params[$index])) { throw new InvalidArgumentException( - 'Argument manquant pour "' . $placeholder . '" dans la route "' . $from . '".' + 'Argument manquant pour "' . $placeholder . '" dans la route "' . $from . '".', ); } @@ -1461,7 +1461,7 @@ protected function create(string $verb, string $from, $to, ?array $options = nul '/\$X/', static fn ($m) => '$' . $i, $to, - 1 + 1, ); } } diff --git a/src/Router/Router.php b/src/Router/Router.php index 54cbb8c0..8b27b818 100644 --- a/src/Router/Router.php +++ b/src/Router/Router.php @@ -147,7 +147,7 @@ public function __construct(RouteCollectionInterface $routes, ServerRequestInter $this->collection->getDefaultNamespace(), $this->collection->getDefaultController(), $this->collection->getDefaultMethod(), - $this->translateURIDashes + $this->translateURIDashes, ); } } @@ -229,7 +229,7 @@ public function controllerName() $controller = preg_replace( ['#(\_)?Controller$#i', '#' . /** @scrutinizer ignore-type */ config('app.url_suffix') . '$#i'], '', - ucfirst($controller) + ucfirst($controller), ); $controller = trim($controller, '/\\'); @@ -397,7 +397,7 @@ protected function checkRoutes(string $uri): bool throw new RedirectException( preg_replace('#\A' . $routeKey . '\z#u', $redirectTo, $uri), - $this->collection->getRedirectCode($routeKey) + $this->collection->getRedirectCode($routeKey), ); } // Stocke nos paramètres régionaux afin que l'objet CodeIgniter puisse l'affecter à la requête. @@ -405,7 +405,7 @@ protected function checkRoutes(string $uri): bool preg_match( '#^' . str_replace('{locale}', '(?[^/]+)', $matchedKey) . '$#u', $uri, - $matched + $matched, ); if ($this->collection->shouldUseSupportedLocalesOnly() @@ -503,7 +503,7 @@ static function ($match) use ($matches) { return $matches[$index] ?? ''; }, - $input + $input, ); } @@ -595,7 +595,7 @@ private function checkDisallowedChars(string $uri): void && preg_match('/\A[' . $this->permittedURIChars . ']+\z/iu', $segment) !== 1 ) { throw new BadRequestException( - 'L\'URI que vous avez soumis contient des caractères non autorisés : "' . $segment . '"' + 'L\'URI que vous avez soumis contient des caractères non autorisés : "' . $segment . '"', ); } } diff --git a/src/Validation/Validation.php b/src/Validation/Validation.php index e87a5d62..307ec0b8 100644 --- a/src/Validation/Validation.php +++ b/src/Validation/Validation.php @@ -61,7 +61,7 @@ protected function files(LocatorInterface $locator): array { $files = array_merge( $locator->listFiles('Rules/'), // Regles de l'application ou des fournisseurs - $locator->listFiles('Validation/Rules/') // Regles internes du framework + $locator->listFiles('Validation/Rules/'), // Regles internes du framework ); return array_unique($files); diff --git a/src/View/Adapters/BladeAdapter.php b/src/View/Adapters/BladeAdapter.php index 743f6f15..016065b9 100644 --- a/src/View/Adapters/BladeAdapter.php +++ b/src/View/Adapters/BladeAdapter.php @@ -36,7 +36,7 @@ public function __construct(protected array $config, $viewPath = null, protected $this->engine = new Blade( $this->viewPath ?: VIEW_PATH, - $this->config['cache_path'] ?? VIEW_CACHE_PATH . 'blade' . DIRECTORY_SEPARATOR + $this->config['cache_path'] ?? VIEW_CACHE_PATH . 'blade' . DIRECTORY_SEPARATOR, ); $this->configure(); diff --git a/src/View/Components/Component.php b/src/View/Components/Component.php index 69effdb1..81e1aea4 100644 --- a/src/View/Components/Component.php +++ b/src/View/Components/Component.php @@ -87,13 +87,13 @@ final protected function view(?string $view, array $data = []): string $candidateViews = array_filter( [$view, $possibleView1 ?? '', $possibleView2 ?? ''], - static fn (string $path): bool => $path !== '' && is_file($path) + static fn (string $path): bool => $path !== '' && is_file($path), ); if ($candidateViews === []) { throw new LogicException(sprintf( 'Impossible de localiser le fichier de vue pour le composant "%s".', - static::class + static::class, )); } diff --git a/src/View/Parser.php b/src/View/Parser.php index c7a6de84..ad008541 100644 --- a/src/View/Parser.php +++ b/src/View/Parser.php @@ -289,7 +289,7 @@ protected function parsePair(string $variable, array $data, string $template): a $this->leftDelimiter . '\s*/' . preg_quote($variable, '#') . '\s*' . $this->rightDelimiter . '#us', $template, $matches, - PREG_SET_ORDER + PREG_SET_ORDER, ); /* @@ -444,12 +444,12 @@ protected function parseConditionals(string $template): string $template = preg_replace( '/' . $leftDelimiter . '\s*else\s*' . $rightDelimiter . '/ums', '', - $template + $template, ); $template = preg_replace( '/' . $leftDelimiter . '\s*endif\s*' . $rightDelimiter . '/ums', '', - $template + $template, ); // Parse the PHP itself, or insert an error so they can debug diff --git a/src/View/View.php b/src/View/View.php index a03b4c2b..215d0980 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -261,7 +261,7 @@ public function withErrors(array|ErrorBag|string $errors): static if (isset(self::$shared['errors']) && self::$shared['errors'] instanceof ErrorBag) { $messages = array_merge( self::$shared['errors']->toArray(), - $errors->toArray() + $errors->toArray(), ); $errors = new ErrorBag($messages); } @@ -370,7 +370,7 @@ public function setAdapter(string $adapter, array $config = []): static $this->adapter = new self::$validAdapters[$adapter]( $config, $config['view_path'] ?? null, - $debug + $debug, ); return $this; From cb1dd2cb82b6c26a7c01ae9617f8ae32ea26e6c8 Mon Sep 17 00:00:00 2001 From: Dimitri Sitchet Tomkeu Date: Tue, 25 Aug 2026 19:31:13 +0100 Subject: [PATCH 2/3] chore: blocage des dependances sur des version legacy --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 708ec39e..7adaf71b 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,9 @@ "blitz-php/annotations": "^1.0", "blitz-php/autoloader": "^1.1", "blitz-php/cache": "^1.3 <1.4", + "blitz-php/contracts": "^1.13 <1.14", "blitz-php/filesystem": "^1.0", - "blitz-php/session": "^1.0", + "blitz-php/session": "^1.4 <1.5", "blitz-php/traits": "^1.6 <1.7", "blitz-php/translator": "^0.1", "dflydev/dot-access-data": "^3.0.1", From 1c237f399d0e27b2854b71308b19a00803e058c6 Mon Sep 17 00:00:00 2001 From: Dimitri Sitchet Tomkeu Date: Tue, 25 Aug 2026 19:34:54 +0100 Subject: [PATCH 3/3] Merge branch 'devs' of https://github.com/blitz-php/framework into devs