From fbf8c9ad103db26db04a74bd0cd33cdca155877c Mon Sep 17 00:00:00 2001 From: neznaika0 Date: Sat, 9 Nov 2024 13:00:38 +0300 Subject: [PATCH] fix: Restore check helpers --- phpstan-baseline.php | 6 ++++++ system/Autoloader/Autoloader.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index e95919ee79aa..b5b4960491a6 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -7,6 +7,12 @@ 'count' => 1, 'path' => __DIR__ . '/app/Config/Filters.php', ]; +$ignoreErrors[] = [ + // identifier: isset.property + 'message' => '#^Property Config\\\\Autoload\\:\\:\\$helpers \\(array\\\\) in isset\\(\\) is not nullable\\.$#', + 'count' => 1, + 'path' => __DIR__ . '/system/Autoloader/Autoloader.php', +]; $ignoreErrors[] = [ // identifier: missingType.iterableValue 'message' => '#^Method CodeIgniter\\\\BaseModel\\:\\:__call\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#', diff --git a/system/Autoloader/Autoloader.php b/system/Autoloader/Autoloader.php index 96b7ef20aa27..b338027c9c8a 100644 --- a/system/Autoloader/Autoloader.php +++ b/system/Autoloader/Autoloader.php @@ -123,7 +123,7 @@ public function initialize(Autoload $config, Modules $modules) $this->files = $config->files; } - if ($config->helpers !== []) { + if (isset($config->helpers)) { $this->helpers = [...$this->helpers, ...$config->helpers]; }