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\ 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.