From 59a97201a7ef0779eca907bc73fe13d9f3347c33 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Mon, 24 Aug 2026 18:36:21 +0800 Subject: [PATCH] refactor: fix phpstan errors in `Config` --- system/Config/BaseConfig.php | 5 +- system/Config/BaseService.php | 6 +- system/Config/DotEnv.php | 4 + system/Config/Factories.php | 33 ++-- system/Config/Factory.php | 4 +- system/Config/Services.php | 11 +- tests/system/Config/DotEnvTest.php | 3 + tests/system/Config/FactoriesTest.php | 40 +++-- tests/system/Config/MimesTest.php | 6 + tests/system/Config/ServicesTest.php | 5 +- utils/phpstan-baseline/argument.type.neon | 12 +- .../codeigniter.modelArgumentType.neon | 8 - utils/phpstan-baseline/loader.neon | 3 +- .../missingType.iterableValue.neon | 162 +----------------- .../missingType.parameter.neon | 7 +- .../staticMethod.notFound.neon | 22 +-- 16 files changed, 86 insertions(+), 245 deletions(-) delete mode 100644 utils/phpstan-baseline/codeigniter.modelArgumentType.neon diff --git a/system/Config/BaseConfig.php b/system/Config/BaseConfig.php index baa030ed7b5c..208797ce6d1c 100644 --- a/system/Config/BaseConfig.php +++ b/system/Config/BaseConfig.php @@ -37,7 +37,7 @@ class BaseConfig * An optional array of classes that will act as Registrars * for rapidly setting config class properties. * - * @var array + * @var list */ public static $registrars = []; @@ -70,6 +70,9 @@ class BaseConfig */ protected static $moduleConfig; + /** + * @param array $array + */ public static function __set_state(array $array) { static::$override = false; diff --git a/system/Config/BaseService.php b/system/Config/BaseService.php index d59332b392ef..e5f46586a305 100644 --- a/system/Config/BaseService.php +++ b/system/Config/BaseService.php @@ -134,7 +134,7 @@ * @method static Security security(App $config = null, $getShared = true) * @method static Session session(ConfigSession $config = null, $getShared = true) * @method static SiteURIFactory siteurifactory(App $config = null, Superglobals $superglobals = null, $getShared = true) - * @method static Superglobals superglobals(array $server = null, array $get = null, bool $getShared = true) + * @method static Superglobals superglobals(array $server = null, array $get = null, bool $getShared = true) * @method static Throttler throttler($getShared = true) * @method static Timer timer($getShared = true) * @method static Toolbar toolbar(ConfigToolbar $config = null, $getShared = true) @@ -178,7 +178,7 @@ class BaseService /** * A cache of other service classes we've found. * - * @var array + * @var array{} * * @deprecated 4.5.0 No longer used. */ @@ -317,6 +317,8 @@ public static function locator(bool $getShared = true) * Provides the ability to perform case-insensitive calling of service * names. * + * @param array $arguments + * * @return object|null */ public static function __callStatic(string $name, array $arguments) diff --git a/system/Config/DotEnv.php b/system/Config/DotEnv.php index 17c74d380c5c..a2f15e7c4850 100644 --- a/system/Config/DotEnv.php +++ b/system/Config/DotEnv.php @@ -51,6 +51,8 @@ public function load(): bool /** * Parse the .env file into an array of key => value + * + * @return array|null */ public function parse(): ?array { @@ -119,6 +121,8 @@ protected function setVariable(string $name, string $value = '') /** * Parses for assignment, cleans the $name and $value, and ensures * that nested variables are handled. + * + * @return array{string, string} */ public function normaliseVariable(string $name, string $value = ''): array { diff --git a/system/Config/Factories.php b/system/Config/Factories.php index ab5343d15fb8..98f15264a40f 100644 --- a/system/Config/Factories.php +++ b/system/Config/Factories.php @@ -27,7 +27,7 @@ * instantiation checks. * * @method static BaseConfig|null config(...$arguments) - * @method static Model|null models(string $alias, array $options = [], ?ConnectionInterface &$conn = null) + * @method static Model|null models(string $alias, array $options = [], ?ConnectionInterface &$conn = null) * @see \CodeIgniter\Config\FactoriesTest */ final class Factories @@ -127,6 +127,8 @@ public static function define(string $component, string $alias, string $classnam * Loads instances based on the method component name. Either * creates a new instance or returns an existing shared instance. * + * @param array $arguments + * * @return object|null */ public static function __callStatic(string $component, array $arguments) @@ -140,7 +142,7 @@ public static function __callStatic(string $component, array $arguments) // Determine the component-specific options $options = array_merge(self::getOptions($component), $options); - if (! $options['getShared']) { + if (! (bool) $options['getShared']) { if (isset(self::$aliases[$options['component']][$alias])) { $class = self::$aliases[$options['component']][$alias]; @@ -192,6 +194,9 @@ public static function get(string $component, string $alias): ?object /** * Gets the defined instance. If not exists, creates new one. * + * @param array $options + * @param array $arguments + * * @return object|null */ private static function getDefinedInstance(array $options, string $alias, array $arguments) @@ -230,6 +235,8 @@ private static function getDefinedInstance(array $options, string $alias, array /** * Creates the shared instance. + * + * @param array $arguments */ private static function createInstance(string $component, string $class, array $arguments): void { @@ -264,8 +271,8 @@ private static function isConfig(string $component): bool /** * Finds a component class * - * @param array $options The array of component-specific directives - * @param string $alias Class alias. See the $aliases property. + * @param array $options The array of component-specific directives + * @param string $alias Class alias. See the $aliases property. */ private static function locateClass(array $options, string $alias): ?string { @@ -341,8 +348,8 @@ private static function isNamespaced(string $alias): bool /** * Verifies that a class & config satisfy the "preferApp" option * - * @param array $options The array of component-specific directives - * @param string $alias Class alias. See the $aliases property. + * @param array $options The array of component-specific directives + * @param string $alias Class alias. See the $aliases property. */ private static function verifyPreferApp(array $options, string $alias): bool { @@ -362,8 +369,8 @@ private static function verifyPreferApp(array $options, string $alias): bool /** * Verifies that a class & config satisfy the "instanceOf" option * - * @param array $options The array of component-specific directives - * @param string $alias Class alias. See the $aliases property. + * @param array $options The array of component-specific directives + * @param string $alias Class alias. See the $aliases property. */ private static function verifyInstanceOf(array $options, string $alias): bool { @@ -408,8 +415,8 @@ public static function getOptions(string $component): array /** * Normalizes, stores, and returns the configuration for a specific component * - * @param string $component Lowercase, plural component name - * @param array $values option values + * @param string $component Lowercase, plural component name + * @param array $values Option values * * @return array The result after applying defaults and normalization */ @@ -541,6 +548,12 @@ public static function getComponentInstances(string $component): array /** * Sets component data * + * @param array{ + * options: array, + * aliases: array, + * instances: array, + * } $data + * * @internal For caching only */ public static function setComponentInstances(string $component, array $data): void diff --git a/system/Config/Factory.php b/system/Config/Factory.php index b25267791beb..9203af73ff09 100644 --- a/system/Config/Factory.php +++ b/system/Config/Factory.php @@ -28,7 +28,7 @@ class Factory extends BaseConfig * Supplies a default set of options to merge for * all unspecified factory components. * - * @var array + * @var array */ public static $default = [ 'component' => null, @@ -42,7 +42,7 @@ class Factory extends BaseConfig * Specifies that Models should always favor child * classes to allow easy extension of module Models. * - * @var array + * @var array */ public $models = [ 'preferApp' => true, diff --git a/system/Config/Services.php b/system/Config/Services.php index b465857905a1..f5a11ac19a80 100644 --- a/system/Config/Services.php +++ b/system/Config/Services.php @@ -198,6 +198,8 @@ public static function csp(?CSPConfig $config = null, bool $getShared = true) * The CURL Request class acts as a simple HTTP client for interacting * with other servers, typically through APIs. * + * @param array $options + * * @return CURLRequest */ public static function curlrequest(array $options = [], ?ResponseInterface $response = null, ?App $config = null, bool $getShared = true) @@ -220,7 +222,7 @@ public static function curlrequest(array $options = [], ?ResponseInterface $resp /** * The Email class allows you to send email via mail, sendmail, SMTP. * - * @param array|EmailConfig|null $config + * @param array|EmailConfig|null $config * * @return Email */ @@ -739,6 +741,13 @@ public static function siteurifactory( /** * Superglobals. * + * @param array|null $server + * @param array|null $get + * @param array|null $post + * @param array|null $cookie + * @param array|null $files + * @param array|null $request + * * @return Superglobals */ public static function superglobals( diff --git a/tests/system/Config/DotEnvTest.php b/tests/system/Config/DotEnvTest.php index 58e66d412e9e..732fbeac1cdc 100644 --- a/tests/system/Config/DotEnvTest.php +++ b/tests/system/Config/DotEnvTest.php @@ -73,6 +73,9 @@ public function testLoadsVars(string $expected, string $varname): void $this->assertSame($expected, getenv($varname)); } + /** + * @return iterable + */ public static function provideLoadsVars(): iterable { yield from [ diff --git a/tests/system/Config/FactoriesTest.php b/tests/system/Config/FactoriesTest.php index c87e4a135e2a..434211e638a5 100644 --- a/tests/system/Config/FactoriesTest.php +++ b/tests/system/Config/FactoriesTest.php @@ -41,7 +41,7 @@ protected function setUp(): void Factories::reset(); } - protected function getFactoriesStaticProperty(...$params): mixed + protected function getFactoriesStaticProperty(string ...$params): mixed { // First parameter is the actual property $name = array_shift($params); @@ -158,14 +158,14 @@ public function testGetsBasenameInvalid(): void public function testCreatesByBasename(): void { - $result = Factories::widgets('SomeWidget', ['getShared' => false]); + $result = Factories::widgets('SomeWidget', ['getShared' => false]); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf(SomeWidget::class, $result); } public function testCreatesByClassname(): void { - $result = Factories::widgets(SomeWidget::class, ['getShared' => false]); + $result = Factories::widgets(SomeWidget::class, ['getShared' => false]); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf(SomeWidget::class, $result); } @@ -179,22 +179,22 @@ public function testCreatesByAbsoluteClassname(): void public function testCreatesInvalid(): void { - $result = Factories::widgets('gfnusvjai', ['getShared' => false]); + $result = Factories::widgets('gfnusvjai', ['getShared' => false]); // @phpstan-ignore staticMethod.notFound $this->assertNull($result); } public function testIgnoresNonClass(): void { - $result = Factories::widgets('NopeWidget', ['getShared' => false]); + $result = Factories::widgets('NopeWidget', ['getShared' => false]); // @phpstan-ignore staticMethod.notFound $this->assertNull($result); } public function testReturnsSharedInstance(): void { - $widget1 = Factories::widgets('SomeWidget'); - $widget2 = Factories::widgets(SomeWidget::class); + $widget1 = Factories::widgets('SomeWidget'); // @phpstan-ignore staticMethod.notFound + $widget2 = Factories::widgets(SomeWidget::class); // @phpstan-ignore staticMethod.notFound $this->assertSame($widget1, $widget2); } @@ -203,7 +203,7 @@ public function testInjection(): void { Factories::injectMock('widgets', 'Banana', new stdClass()); - $result = Factories::widgets('Banana'); + $result = Factories::widgets('Banana'); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf('stdClass', $result); } @@ -212,7 +212,7 @@ public function testRespectsComponentAlias(): void { Factories::setOptions('tedwigs', ['component' => 'widgets']); - $result = Factories::tedwigs('SomeWidget'); + $result = Factories::tedwigs('SomeWidget'); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf(SomeWidget::class, $result); } @@ -228,10 +228,10 @@ public function testRespectsInstanceOf(): void { Factories::setOptions('widgets', ['instanceOf' => 'stdClass']); - $result = Factories::widgets('SomeWidget'); + $result = Factories::widgets('SomeWidget'); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf(SomeWidget::class, $result); - $result = Factories::widgets('OtherWidget'); + $result = Factories::widgets('OtherWidget'); // @phpstan-ignore staticMethod.notFound $this->assertNull($result); } @@ -239,7 +239,7 @@ public function testSharedRespectsInstanceOf(): void { Factories::injectMock('widgets', 'SomeWidget', new OtherWidget()); - $result = Factories::widgets('SomeWidget', ['instanceOf' => 'stdClass']); + $result = Factories::widgets('SomeWidget', ['instanceOf' => 'stdClass']); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf(SomeWidget::class, $result); } @@ -247,7 +247,7 @@ public function testPrioritizesParameterOptions(): void { Factories::setOptions('widgets', ['instanceOf' => 'stdClass']); - $result = Factories::widgets(OtherWidget::class, ['instanceOf' => null]); + $result = Factories::widgets(OtherWidget::class, ['instanceOf' => null]); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf(OtherWidget::class, $result); } @@ -259,7 +259,7 @@ public function testFindsAppFirst(): void class_alias(SomeWidget::class, $class); } - $result = Factories::widgets('OtherWidget'); + $result = Factories::widgets('OtherWidget'); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf(SomeWidget::class, $result); } @@ -277,6 +277,7 @@ class TestRegistrar $result = Factories::config('TestRegistrar'); + // @phpstan-ignore argument.type (Config\TestRegistrar is created at runtime by this test) $this->assertInstanceOf('Config\TestRegistrar', $result); // Delete the config class in App @@ -317,14 +318,14 @@ public function testPreferAppIsIgnored(): void class_alias(SomeWidget::class, $class); } - $result = Factories::widgets(OtherWidget::class); + $result = Factories::widgets(OtherWidget::class); // @phpstan-ignore staticMethod.notFound $this->assertInstanceOf(OtherWidget::class, $result); } public function testCanLoadTwoCellsWithSameShortName(): void { - $cell1 = Factories::cells('\\' . SampleClass::class); - $cell2 = Factories::cells('\\' . \Tests\Support\View\OtherCells\SampleClass::class); + $cell1 = Factories::cells('\\' . SampleClass::class); // @phpstan-ignore staticMethod.notFound + $cell2 = Factories::cells('\\' . \Tests\Support\View\OtherCells\SampleClass::class); // @phpstan-ignore staticMethod.notFound $this->assertNotSame($cell1, $cell2); } @@ -369,6 +370,7 @@ public function testDefineSameAliasAndSameClassTwice(): void UserModel::class, ); + // @phpstan-ignore codeigniter.modelArgumentType (aliased to Tests\Support\Models\UserModel above) $model = model('CodeIgniter\Shield\Models\UserModel'); $this->assertInstanceOf(UserModel::class, $model); @@ -382,7 +384,7 @@ public function testDefineNonExistentClass(): void Factories::define( 'models', 'CodeIgniter\Shield\Models\UserModel', - 'App\Models\UserModel', + 'App\Models\UserModel', // @phpstan-ignore argument.type (deliberately does not exist) ); } @@ -398,7 +400,7 @@ public function testDefineAfterLoading(): void Factories::define( 'models', UserModel::class, - 'App\Models\UserModel', + 'App\Models\UserModel', // @phpstan-ignore argument.type (deliberately does not exist) ); } diff --git a/tests/system/Config/MimesTest.php b/tests/system/Config/MimesTest.php index 0b22a45e5735..af6839c9da98 100644 --- a/tests/system/Config/MimesTest.php +++ b/tests/system/Config/MimesTest.php @@ -30,6 +30,9 @@ public function testGuessExtensionFromType(?string $expected, string $mime): voi $this->assertSame($expected, Mimes::guessExtensionFromType($mime)); } + /** + * @return iterable + */ public static function provideGuessExtensionFromType(): iterable { return [ @@ -62,6 +65,9 @@ public function testGuessTypeFromExtension(?string $expected, string $ext): void $this->assertSame($expected, Mimes::guessTypeFromExtension($ext)); } + /** + * @return iterable + */ public static function provideGuessTypeFromExtension(): iterable { return [ diff --git a/tests/system/Config/ServicesTest.php b/tests/system/Config/ServicesTest.php index 86228dfadd3f..66c9158e67ab 100644 --- a/tests/system/Config/ServicesTest.php +++ b/tests/system/Config/ServicesTest.php @@ -66,6 +66,9 @@ #[Group('SeparateProcess')] final class ServicesTest extends CIUnitTestCase { + /** + * @var array + */ private array $original; #[WithoutErrorHandler] @@ -459,7 +462,7 @@ public function testParser(): void public function testRedirectResponse(): void { - $result = Services::redirectResponse(); + $result = Services::redirectresponse(); $this->assertInstanceOf(RedirectResponse::class, $result); } diff --git a/utils/phpstan-baseline/argument.type.neon b/utils/phpstan-baseline/argument.type.neon index bd5919d3f762..3c70bd498fba 100644 --- a/utils/phpstan-baseline/argument.type.neon +++ b/utils/phpstan-baseline/argument.type.neon @@ -1,4 +1,4 @@ -# total 24 errors +# total 21 errors parameters: ignoreErrors: @@ -22,16 +22,6 @@ parameters: count: 1 path: ../../tests/system/CodeIgniterTest.php - - - message: '#^Parameter \#1 \$expected of method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) expects class\-string\, string given\.$#' - count: 1 - path: ../../tests/system/Config/FactoriesTest.php - - - - message: '#^Parameter \#3 \$classname of static method CodeIgniter\\Config\\Factories\:\:define\(\) expects class\-string, string given\.$#' - count: 2 - path: ../../tests/system/Config/FactoriesTest.php - - message: '#^Parameter \#1 \$db of class CodeIgniter\\Database\\SQLite3\\Table constructor expects CodeIgniter\\Database\\SQLite3\\Connection, CodeIgniter\\Database\\BaseConnection given\.$#' count: 1 diff --git a/utils/phpstan-baseline/codeigniter.modelArgumentType.neon b/utils/phpstan-baseline/codeigniter.modelArgumentType.neon deleted file mode 100644 index 0bf0d63faeb2..000000000000 --- a/utils/phpstan-baseline/codeigniter.modelArgumentType.neon +++ /dev/null @@ -1,8 +0,0 @@ -# total 1 error - -parameters: - ignoreErrors: - - - message: '#^Parameter \#1 \$name of function model expects a valid class string, ''CodeIgniter\\\\Shield\\\\Models\\\\UserModel'' given\.$#' - count: 1 - path: ../../tests/system/Config/FactoriesTest.php diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index 9954e15ad7a3..d591b6fcf902 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,10 +1,9 @@ -# total 366 errors +# total 312 errors includes: - argument.type.neon - arguments.count.neon - assign.propertyType.neon - - codeigniter.modelArgumentType.neon - deadCode.unreachable.neon - function.resultUnused.neon - method.childParameterType.neon diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index a91013e3788b..bd603a4178a1 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,4 +1,4 @@ -# total 236 errors +# total 204 errors parameters: ignoreErrors: @@ -127,146 +127,6 @@ parameters: count: 1 path: ../../system/Common.php - - - message: '#^Method CodeIgniter\\Config\\BaseConfig\:\:__set_state\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/BaseConfig.php - - - - message: '#^Property CodeIgniter\\Config\\BaseConfig\:\:\$registrars type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/BaseConfig.php - - - - message: '#^Class CodeIgniter\\Config\\BaseService has PHPDoc tag @method for method superglobals\(\) parameter \#1 \$server with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/BaseService.php - - - - message: '#^Class CodeIgniter\\Config\\BaseService has PHPDoc tag @method for method superglobals\(\) parameter \#2 \$get with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/BaseService.php - - - - message: '#^Method CodeIgniter\\Config\\BaseService\:\:__callStatic\(\) has parameter \$arguments with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/BaseService.php - - - - message: '#^Property CodeIgniter\\Config\\BaseService\:\:\$services type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/BaseService.php - - - - message: '#^Method CodeIgniter\\Config\\DotEnv\:\:normaliseVariable\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/DotEnv.php - - - - message: '#^Method CodeIgniter\\Config\\DotEnv\:\:parse\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/DotEnv.php - - - - message: '#^Class CodeIgniter\\Config\\Factories has PHPDoc tag @method for method models\(\) parameter \#2 \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:__callStatic\(\) has parameter \$arguments with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:createInstance\(\) has parameter \$arguments with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:getDefinedInstance\(\) has parameter \$arguments with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:getDefinedInstance\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:locateClass\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:setComponentInstances\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:setOptions\(\) has parameter \$values with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:verifyInstanceOf\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Method CodeIgniter\\Config\\Factories\:\:verifyPreferApp\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factories.php - - - - message: '#^Property CodeIgniter\\Config\\Factory\:\:\$default type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factory.php - - - - message: '#^Property CodeIgniter\\Config\\Factory\:\:\$models type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Factory.php - - - - message: '#^Method CodeIgniter\\Config\\Services\:\:curlrequest\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Services.php - - - - message: '#^Method CodeIgniter\\Config\\Services\:\:email\(\) has parameter \$config with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Services.php - - - - message: '#^Method CodeIgniter\\Config\\Services\:\:superglobals\(\) has parameter \$cookie with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Services.php - - - - message: '#^Method CodeIgniter\\Config\\Services\:\:superglobals\(\) has parameter \$files with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Services.php - - - - message: '#^Method CodeIgniter\\Config\\Services\:\:superglobals\(\) has parameter \$get with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Services.php - - - - message: '#^Method CodeIgniter\\Config\\Services\:\:superglobals\(\) has parameter \$post with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Services.php - - - - message: '#^Method CodeIgniter\\Config\\Services\:\:superglobals\(\) has parameter \$request with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Services.php - - - - message: '#^Method CodeIgniter\\Config\\Services\:\:superglobals\(\) has parameter \$server with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Config/Services.php - - message: '#^Method CodeIgniter\\Controller\:\:setValidator\(\) has parameter \$messages with no value type specified in iterable type array\.$#' count: 1 @@ -817,26 +677,6 @@ parameters: count: 1 path: ../../tests/system/CommonHelperTest.php - - - message: '#^Method CodeIgniter\\Config\\DotEnvTest\:\:provideLoadsVars\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Config/DotEnvTest.php - - - - message: '#^Method CodeIgniter\\Config\\MimesTest\:\:provideGuessExtensionFromType\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Config/MimesTest.php - - - - message: '#^Method CodeIgniter\\Config\\MimesTest\:\:provideGuessTypeFromExtension\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Config/MimesTest.php - - - - message: '#^Property CodeIgniter\\Config\\ServicesTest\:\:\$original type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Config/ServicesTest.php - - message: '#^Property CodeIgniter\\Cookie\\CookieStoreTest\:\:\$defaults type has no value type specified in iterable type array\.$#' count: 1 diff --git a/utils/phpstan-baseline/missingType.parameter.neon b/utils/phpstan-baseline/missingType.parameter.neon index 87eecd560077..bc058735997d 100644 --- a/utils/phpstan-baseline/missingType.parameter.neon +++ b/utils/phpstan-baseline/missingType.parameter.neon @@ -1,4 +1,4 @@ -# total 9 errors +# total 8 errors parameters: ignoreErrors: @@ -22,11 +22,6 @@ parameters: count: 1 path: ../../tests/system/Commands/Utilities/Routes/AutoRouterImproved/Controllers/SubDir/BlogController.php - - - message: '#^Method CodeIgniter\\Config\\FactoriesTest\:\:getFactoriesStaticProperty\(\) has parameter \$params with no type specified\.$#' - count: 1 - path: ../../tests/system/Config/FactoriesTest.php - - message: '#^Method CodeIgniter\\Entity\\EntityTest\:\:getCastEntity\(\) has parameter \$data with no type specified\.$#' count: 1 diff --git a/utils/phpstan-baseline/staticMethod.notFound.neon b/utils/phpstan-baseline/staticMethod.notFound.neon index 3ad7dfbbd356..09b088e3c84f 100644 --- a/utils/phpstan-baseline/staticMethod.notFound.neon +++ b/utils/phpstan-baseline/staticMethod.notFound.neon @@ -1,4 +1,4 @@ -# total 18 errors +# total 1 error parameters: ignoreErrors: @@ -6,23 +6,3 @@ parameters: message: '#^Call to an undefined static method CodeIgniter\\Config\\Factories\:\:cells\(\)\.$#' count: 1 path: ../../system/View/Cell.php - - - - message: '#^Call to an undefined static method CodeIgniter\\Config\\Factories\:\:cells\(\)\.$#' - count: 2 - path: ../../tests/system/Config/FactoriesTest.php - - - - message: '#^Call to an undefined static method CodeIgniter\\Config\\Factories\:\:tedwigs\(\)\.$#' - count: 1 - path: ../../tests/system/Config/FactoriesTest.php - - - - message: '#^Call to an undefined static method CodeIgniter\\Config\\Factories\:\:widgets\(\)\.$#' - count: 13 - path: ../../tests/system/Config/FactoriesTest.php - - - - message: '#^Call to an undefined static method Tests\\Support\\Config\\Services\:\:redirectResponse\(\)\.$#' - count: 1 - path: ../../tests/system/Config/ServicesTest.php