From b26809f66eac8be9cf6c5acb83ad48fa4b629130 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 12 Oct 2023 11:39:07 +0900 Subject: [PATCH 1/2] chore: update for phpstan-codeigniter v1.4.0 --- phpstan.neon.dist | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4041710fb703..eb85c8131723 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -38,3 +38,8 @@ parameters: booleansInConditions: true disallowedConstructs: true matchingInheritedMethodNames: true + ignoreErrors: + - '#^Call to function config with Config\\.+\:\:class is discouraged\.$#' + codeigniter: + additionalConfigNamespaces: + - CodeIgniter\Config\ From 65b01f61c94628ddc1af6959d2036a84709af194 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 12 Oct 2023 11:39:35 +0900 Subject: [PATCH 2/2] fix: incorrect class name If we specifies FQCN, Config\Factory is not loaded since CI v4.4.0. --- system/Config/Factories.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Config/Factories.php b/system/Config/Factories.php index b455969049e2..a32df02725ac 100644 --- a/system/Config/Factories.php +++ b/system/Config/Factories.php @@ -377,7 +377,7 @@ public static function getOptions(string $component): array // Handle Config as a special case to prevent logic loops ? self::$configOptions // Load values from the best Factory configuration (will include Registrars) - : config(Factory::class)->{$component} ?? []; + : config('Factory')->{$component} ?? []; // The setOptions() reset the component. So getOptions() may reset // the component.