diff --git a/tests/system/CommonSingleServiceTest.php b/tests/system/CommonSingleServiceTest.php index a977eac7c88a..2a27c9b8486f 100644 --- a/tests/system/CommonSingleServiceTest.php +++ b/tests/system/CommonSingleServiceTest.php @@ -34,8 +34,8 @@ public function testSingleServiceWithNoParamsSupplied(string $service): void { Services::injectMock('security', new MockSecurity(new SecurityConfig())); - $service1 = single_service($service); - $service2 = single_service($service); + $service1 = single_service($service); // @phpstan-ignore codeigniter.unknownServiceMethod + $service2 = single_service($service); // @phpstan-ignore codeigniter.unknownServiceMethod assert($service1 !== null); @@ -62,8 +62,8 @@ public function testSingleServiceWithAtLeastOneParamSupplied(string $service): v $params[] = $method->getNumberOfParameters() === 1 ? true : $method->getParameters()[0]->getDefaultValue(); - $service1 = single_service($service, ...$params); - $service2 = single_service($service, ...$params); + $service1 = single_service($service, ...$params); // @phpstan-ignore codeigniter.unknownServiceMethod + $service2 = single_service($service, ...$params); // @phpstan-ignore codeigniter.unknownServiceMethod assert($service1 !== null); @@ -91,13 +91,16 @@ public function testSingleServiceWithAllParamsSupplied(): void public function testSingleServiceWithGibberishGiven(): void { - $this->assertNull(single_service('foo')); - $this->assertNull(single_service('bar')); - $this->assertNull(single_service('baz')); - $this->assertNull(single_service('caches')); - $this->assertNull(single_service('timers')); + $this->assertNull(single_service('foo')); // @phpstan-ignore codeigniter.unknownServiceMethod + $this->assertNull(single_service('bar')); // @phpstan-ignore codeigniter.unknownServiceMethod + $this->assertNull(single_service('baz')); // @phpstan-ignore codeigniter.unknownServiceMethod + $this->assertNull(single_service('caches')); // @phpstan-ignore codeigniter.unknownServiceMethod + $this->assertNull(single_service('timers')); // @phpstan-ignore codeigniter.unknownServiceMethod } + /** + * @return iterable + */ public static function provideServiceNames(): iterable { static $services = []; diff --git a/utils/phpstan-baseline/codeigniter.unknownServiceMethod.neon b/utils/phpstan-baseline/codeigniter.unknownServiceMethod.neon deleted file mode 100644 index 2053fa0f2bbd..000000000000 --- a/utils/phpstan-baseline/codeigniter.unknownServiceMethod.neon +++ /dev/null @@ -1,33 +0,0 @@ -# total 9 errors - -parameters: - ignoreErrors: - - - message: '#^Call to unknown service method ''bar''\.$#' - count: 1 - path: ../../tests/system/CommonSingleServiceTest.php - - - - message: '#^Call to unknown service method ''baz''\.$#' - count: 1 - path: ../../tests/system/CommonSingleServiceTest.php - - - - message: '#^Call to unknown service method ''caches''\.$#' - count: 1 - path: ../../tests/system/CommonSingleServiceTest.php - - - - message: '#^Call to unknown service method ''foo''\.$#' - count: 1 - path: ../../tests/system/CommonSingleServiceTest.php - - - - message: '#^Call to unknown service method ''timers''\.$#' - count: 1 - path: ../../tests/system/CommonSingleServiceTest.php - - - - message: '#^Call to unknown service method string\.$#' - count: 4 - path: ../../tests/system/CommonSingleServiceTest.php diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index 3ea621ad078e..49e4a76cbc9c 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 3383 errors +# total 3373 errors includes: - argument.type.neon - assign.propertyType.neon @@ -7,7 +7,6 @@ includes: - codeigniter.modelArgumentType.neon - codeigniter.superglobalAccess.neon - codeigniter.superglobalAccessAssign.neon - - codeigniter.unknownServiceMethod.neon - deadCode.unreachable.neon - empty.notAllowed.neon - method.alreadyNarrowedType.neon diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index bae7ccb51fe0..af31bfb997ff 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,4 +1,4 @@ -# total 1619 errors +# total 1618 errors parameters: ignoreErrors: @@ -6477,11 +6477,6 @@ parameters: count: 1 path: ../../tests/system/CommonHelperTest.php - - - message: '#^Method CodeIgniter\\CommonSingleServiceTest\:\:provideServiceNames\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/CommonSingleServiceTest.php - - message: '#^Method CodeIgniter\\Config\\DotEnvTest\:\:provideLoadsVars\(\) return type has no value type specified in iterable type iterable\.$#' count: 1