From a22f96d6dab372f9d4d9e2893dc9d8b9a3cf5c8c Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Mon, 24 Aug 2026 03:45:40 +0800 Subject: [PATCH] refactor: fix remaining errors in `Helpers`' tests --- system/Helpers/number_helper.php | 6 +- .../Array/ArrayHelperDotKeyExistsTest.php | 3 + .../Array/ArrayHelperRecursiveDiffTest.php | 3 + .../ArrayHelperSortValuesByNaturalTest.php | 7 + tests/system/Helpers/ArrayHelperTest.php | 49 +++- tests/system/Helpers/CookieHelperTest.php | 8 +- tests/system/Helpers/FilesystemHelperTest.php | 8 +- tests/system/Helpers/HTMLHelperTest.php | 3 + tests/system/Helpers/InflectorHelperTest.php | 3 + .../Helpers/URLHelper/CurrentUrlTest.php | 5 +- .../system/Helpers/URLHelper/MiscUrlTest.php | 44 +++- .../Helpers/URLHelper/SiteUrlCliTest.php | 3 + .../system/Helpers/URLHelper/SiteUrlTest.php | 5 +- utils/phpstan-baseline/argument.type.neon | 7 +- .../phpstan-baseline/assign.propertyType.neon | 7 +- utils/phpstan-baseline/loader.neon | 2 +- utils/phpstan-baseline/method.notFound.neon | 7 +- .../missingType.iterableValue.neon | 232 +----------------- .../missingType.parameter.neon | 17 +- 19 files changed, 139 insertions(+), 280 deletions(-) diff --git a/system/Helpers/number_helper.php b/system/Helpers/number_helper.php index 120e33d795cd..a737428706bd 100644 --- a/system/Helpers/number_helper.php +++ b/system/Helpers/number_helper.php @@ -19,16 +19,16 @@ /** * Formats a numbers as bytes, based on size, and adds the appropriate suffix * - * @param int|string $num Will be cast as int + * @param float|int|string $num Will be cast as int * @param non-empty-string|null $locale [optional] * * @return bool|string */ function number_to_size($num, int $precision = 1, ?string $locale = null) { - // Strip any formatting & ensure numeric input try { - // @phpstan-ignore-next-line + // Strip any formatting & ensure numeric input + // @phpstan-ignore binaryOp.invalid $num = 0 + str_replace(',', '', (string) $num); } catch (ErrorException) { // Catch "Warning: A non-numeric value encountered" diff --git a/tests/system/Helpers/Array/ArrayHelperDotKeyExistsTest.php b/tests/system/Helpers/Array/ArrayHelperDotKeyExistsTest.php index 0641c41b2bd0..432fafcf1a0c 100644 --- a/tests/system/Helpers/Array/ArrayHelperDotKeyExistsTest.php +++ b/tests/system/Helpers/Array/ArrayHelperDotKeyExistsTest.php @@ -23,6 +23,9 @@ #[Group('Others')] final class ArrayHelperDotKeyExistsTest extends CIUnitTestCase { + /** + * @var array>>> + */ private array $array = [ 'contacts' => [ 'friends' => [ diff --git a/tests/system/Helpers/Array/ArrayHelperRecursiveDiffTest.php b/tests/system/Helpers/Array/ArrayHelperRecursiveDiffTest.php index 2bb1c594def1..9c3e6f943604 100644 --- a/tests/system/Helpers/Array/ArrayHelperRecursiveDiffTest.php +++ b/tests/system/Helpers/Array/ArrayHelperRecursiveDiffTest.php @@ -22,6 +22,9 @@ #[Group('Others')] final class ArrayHelperRecursiveDiffTest extends CIUnitTestCase { + /** + * @var array + */ private array $compareWith; protected function setUp(): void diff --git a/tests/system/Helpers/Array/ArrayHelperSortValuesByNaturalTest.php b/tests/system/Helpers/Array/ArrayHelperSortValuesByNaturalTest.php index 4529b4da6918..e3c38c9030fa 100644 --- a/tests/system/Helpers/Array/ArrayHelperSortValuesByNaturalTest.php +++ b/tests/system/Helpers/Array/ArrayHelperSortValuesByNaturalTest.php @@ -22,6 +22,9 @@ #[Group('Others')] final class ArrayHelperSortValuesByNaturalTest extends CIUnitTestCase { + /** + * @var list + */ private array $arrayWithStringValues = [ 'apple10', 'banana', @@ -37,6 +40,10 @@ final class ArrayHelperSortValuesByNaturalTest extends CIUnitTestCase 'Яблоко', 'apple', ]; + + /** + * @var list> + */ private array $arrayWithArrayValues = [ ['apple', 'Banana'], ['apple10', 'Apple'], diff --git a/tests/system/Helpers/ArrayHelperTest.php b/tests/system/Helpers/ArrayHelperTest.php index 0293cc6c826e..e91d8e56cc8e 100644 --- a/tests/system/Helpers/ArrayHelperTest.php +++ b/tests/system/Helpers/ArrayHelperTest.php @@ -211,11 +211,10 @@ public function testArrayDotIgnoresLastWildcard(): void } /** - * @param int|string $key - * @param array|string|null $expected + * @param array|string|null $expected */ #[DataProvider('provideArrayDeepSearch')] - public function testArrayDeepSearch($key, $expected): void + public function testArrayDeepSearch(int|string $key, array|string|null $expected): void { $data = [ 'key1' => 'Value 1', @@ -241,6 +240,9 @@ public function testArrayDeepSearch($key, $expected): void $this->assertSame($expected, $result); } + /** + * @return iterable|string|null}> + */ public static function provideArrayDeepSearch(): iterable { return [ @@ -274,6 +276,11 @@ public function testArrayDeepSearchReturnNullEmptyArray(): void $this->assertNull(array_deep_search('key644', $data)); } + /** + * @param list $data + * @param array $sortColumns + * @param list $expected + */ #[DataProvider('provideSortByMultipleKeys')] public function testArraySortByMultipleKeysWithArray(array $data, array $sortColumns, array $expected): void { @@ -283,6 +290,11 @@ public function testArraySortByMultipleKeysWithArray(array $data, array $sortCol $this->assertSame($expected, array_column($data, 'name')); } + /** + * @param list $data + * @param array $sortColumns + * @param list $expected + */ #[DataProvider('provideSortByMultipleKeys')] public function testArraySortByMultipleKeysWithObjects(array $data, array $sortColumns, array $expected): void { @@ -297,6 +309,11 @@ public function testArraySortByMultipleKeysWithObjects(array $data, array $sortC $this->assertSame($expected, array_column($data, 'name')); } + /** + * @param list $data + * @param array $sortColumns + * @param list $expected + */ #[DataProvider('provideSortByMultipleKeys')] public function testArraySortByMultipleKeysFailsEmptyParameter(array $data, array $sortColumns, array $expected): void { @@ -334,6 +351,9 @@ public function testArraySortByMultipleKeysFailsInconsistentArraySizes($data): v array_sort_by_multiple_keys($data, $sortColumns); } + /** + * @return iterable, array, list}> + */ public static function provideSortByMultipleKeys(): iterable { $seed = [ @@ -387,12 +407,19 @@ public static function provideSortByMultipleKeys(): iterable ]; } + /** + * @param array $input + * @param array $expected + */ #[DataProvider('provideArrayFlattening')] public function testArrayFlattening(array $input, array $expected): void { $this->assertSame($expected, array_flatten_with_dots($input)); } + /** + * @return iterable, array}> + */ public static function provideArrayFlattening(): iterable { yield 'normal' => [ @@ -485,6 +512,11 @@ public static function provideArrayFlattening(): iterable ]; } + /** + * @param list $indexes + * @param array $data + * @param array $expected + */ #[DataProvider('provideArrayGroupByIncludeEmpty')] public function testArrayGroupByIncludeEmpty(array $indexes, array $data, array $expected): void { @@ -493,6 +525,9 @@ public function testArrayGroupByIncludeEmpty(array $indexes, array $data, array $this->assertSame($expected, $actual, 'array including empty not the same'); } + /** + * @return iterable, array, array}> + */ public static function provideArrayGroupByIncludeEmpty(): iterable { yield 'simple group-by test' => [ @@ -904,6 +939,11 @@ public static function provideArrayGroupByIncludeEmpty(): iterable ]; } + /** + * @param list $indexes + * @param array $data + * @param array $expected + */ #[DataProvider('provideArrayGroupByExcludeEmpty')] public function testArrayGroupByExcludeEmpty(array $indexes, array $data, array $expected): void { @@ -912,6 +952,9 @@ public function testArrayGroupByExcludeEmpty(array $indexes, array $data, array $this->assertSame($expected, $actual, 'array excluding empty not the same'); } + /** + * @return iterable, array, array}> + */ public static function provideArrayGroupByExcludeEmpty(): iterable { yield 'simple group-by test' => [ diff --git a/tests/system/Helpers/CookieHelperTest.php b/tests/system/Helpers/CookieHelperTest.php index 9b79e8d61dbc..f853d8ec7820 100644 --- a/tests/system/Helpers/CookieHelperTest.php +++ b/tests/system/Helpers/CookieHelperTest.php @@ -51,9 +51,11 @@ protected function setUp(): void $this->value = 'hello world'; $this->expire = 9999; - Services::injectMock('response', new MockResponse(new App())); - $this->response = service('response'); - $request = new IncomingRequest(new App(), new SiteURI(new App()), null, new UserAgent()); + $response = new MockResponse(new App()); + Services::injectMock('response', $response); + $this->response = $response; + + $request = new IncomingRequest(new App(), new SiteURI(new App()), null, new UserAgent()); Services::injectMock('request', $request); helper('cookie'); diff --git a/tests/system/Helpers/FilesystemHelperTest.php b/tests/system/Helpers/FilesystemHelperTest.php index 9d4bf74eb4e5..f264864ebf9a 100644 --- a/tests/system/Helpers/FilesystemHelperTest.php +++ b/tests/system/Helpers/FilesystemHelperTest.php @@ -188,13 +188,17 @@ public function testDirectoryMirrorSkipExistingFolder(): void // skips the existing folder directory_mirror($root . 'src', $root . 'dest'); - $structure = vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure(); + $visitor = vfsStream::inspect(new vfsStreamStructureVisitor()); + $this->assertInstanceOf(vfsStreamStructureVisitor::class, $visitor); + $structure = $visitor->getStructure(); $this->assertSame([], $structure['root']['dest']['AnEmptyFolder']); // skips the existing folder (the same as overwrite = true) directory_mirror($root . 'src', $root . 'dest', false); - $structure = vfsStream::inspect(new vfsStreamStructureVisitor())->getStructure(); + $visitor = vfsStream::inspect(new vfsStreamStructureVisitor()); + $this->assertInstanceOf(vfsStreamStructureVisitor::class, $visitor); + $structure = $visitor->getStructure(); $this->assertSame([], $structure['root']['dest']['AnEmptyFolder']); } diff --git a/tests/system/Helpers/HTMLHelperTest.php b/tests/system/Helpers/HTMLHelperTest.php index dcce366474b9..787b100bbf2b 100644 --- a/tests/system/Helpers/HTMLHelperTest.php +++ b/tests/system/Helpers/HTMLHelperTest.php @@ -26,6 +26,9 @@ #[Group('Others')] final class HTMLHelperTest extends CIUnitTestCase { + /** + * @var list + */ private array $tracks; /** diff --git a/tests/system/Helpers/InflectorHelperTest.php b/tests/system/Helpers/InflectorHelperTest.php index 59068b8bf751..3d3079ec0880 100644 --- a/tests/system/Helpers/InflectorHelperTest.php +++ b/tests/system/Helpers/InflectorHelperTest.php @@ -252,6 +252,9 @@ public function testOrdinal(string $suffix, int $number): void $this->assertSame($suffix, ordinal($number)); } + /** + * @return iterable + */ public static function provideOrdinal(): iterable { return [ diff --git a/tests/system/Helpers/URLHelper/CurrentUrlTest.php b/tests/system/Helpers/URLHelper/CurrentUrlTest.php index 54ac56bb6a54..6058ba1698d2 100644 --- a/tests/system/Helpers/URLHelper/CurrentUrlTest.php +++ b/tests/system/Helpers/URLHelper/CurrentUrlTest.php @@ -89,7 +89,7 @@ public function testCurrentURLReturnsAllowedHostname(): void $this->assertSame('http://www.example.jp/public/index.php/', current_url()); } - private function createRequest(?App $config = null, $body = null, ?string $path = null): void + private function createRequest(?App $config = null, ?string $body = null, ?string $path = null): void { $config ??= new App(); @@ -281,6 +281,9 @@ public function testUrlIsWithSubfolder(string $currentPath, string $testPath, bo $this->assertSame($expected, url_is($testPath)); } + /** + * @return iterable + */ public static function provideUrlIs(): iterable { return [ diff --git a/tests/system/Helpers/URLHelper/MiscUrlTest.php b/tests/system/Helpers/URLHelper/MiscUrlTest.php index 422b2e01cea6..c8cefbda9c8b 100644 --- a/tests/system/Helpers/URLHelper/MiscUrlTest.php +++ b/tests/system/Helpers/URLHelper/MiscUrlTest.php @@ -146,6 +146,9 @@ public function testAnchor($expected = '', $uri = '', $title = '', $attributes = // Test anchor + /** + * @return iterable> + */ public static function provideAnchor(): iterable { return [ @@ -206,6 +209,9 @@ public function testAnchorNoindex($expected = '', $uri = '', $title = '', $attri $this->assertSame($expected, anchor($uri, $title, $attributes, $this->config)); } + /** + * @return iterable> + */ public static function provideAnchorNoindex(): iterable { return [ @@ -272,6 +278,9 @@ public function testAnchorTargetted($expected = '', $uri = '', $title = '', $att $this->assertSame($expected, anchor($uri, $title, $attributes, $this->config)); } + /** + * @return iterable> + */ public static function provideAnchorTargetted(): iterable { return [ @@ -326,6 +335,9 @@ public function testAnchorExamples($expected = '', $uri = '', $title = '', $attr $this->assertSame($expected, anchor($uri, $title, $attributes, $this->config)); } + /** + * @return iterable> + */ public static function provideAnchorExamples(): iterable { return [ @@ -371,6 +383,9 @@ public function testAnchorPopup($expected = '', $uri = '', $title = '', $attribu // Test anchor_popup + /** + * @return iterable> + */ public static function provideAnchorPopup(): iterable { return [ @@ -428,6 +443,9 @@ public function testMailto($expected = '', $email = '', $title = '', $attributes // Test mailto + /** + * @return iterable> + */ public static function provideMailto(): iterable { return [ @@ -466,6 +484,9 @@ public function testSafeMailto($expected = '', $email = '', $title = '', $attrib // Test safe_mailto + /** + * @return iterable> + */ public static function provideSafeMailto(): iterable { return [ @@ -509,6 +530,9 @@ public function testAutoLinkUrl($in, $out): void // Test auto_link + /** + * @return iterable + */ public static function provideAutoLinkUrl(): iterable { return [ @@ -561,6 +585,9 @@ public function testAutoLinkEmail($in, $out): void $this->assertSame($out, auto_link($in, 'email')); } + /** + * @return iterable + */ public static function provideAutoLinkEmail(): iterable { return [ @@ -609,6 +636,9 @@ public function testAutolinkBoth($in, $out): void $this->assertSame($out, auto_link($in)); } + /** + * @return iterable + */ public static function provideAutolinkBoth(): iterable { return [ @@ -661,6 +691,9 @@ public function testAutoLinkPopup($in, $out): void $this->assertSame($out, auto_link($in, 'url', true)); } + /** + * @return iterable + */ public static function provideAutoLinkPopup(): iterable { return [ @@ -707,6 +740,9 @@ public function testPrepUrl(string $input, string $expected, bool $secure): void // Test prep_url + /** + * @return iterable + */ public static function providePrepUrl(): iterable { // input, expected, secure @@ -843,7 +879,7 @@ public function testMbUrlTitleExtraDashes(): void } #[DataProvider('provideUrlTo')] - public function testUrlTo(string $expected, string $input, ...$args): void + public function testUrlTo(string $expected, string $input, int|string ...$args): void { service('superglobals')->setServer('HTTP_HOST', 'example.com'); @@ -856,6 +892,9 @@ public function testUrlTo(string $expected, string $input, ...$args): void $this->assertSame($expected, url_to($input, ...$args)); } + /** + * @return iterable + */ public static function provideUrlTo(): iterable { $page = config('App')->indexPage !== '' ? config('App')->indexPage . '/' : ''; @@ -884,6 +923,9 @@ public function testUrlToThrowsOnEmptyOrMissingRoute(string $route): void url_to($route); } + /** + * @return iterable + */ public static function provideUrlToThrowsOnEmptyOrMissingRoute(): iterable { return [ diff --git a/tests/system/Helpers/URLHelper/SiteUrlCliTest.php b/tests/system/Helpers/URLHelper/SiteUrlCliTest.php index ad99f46a8b2a..0d9d9b114dd8 100644 --- a/tests/system/Helpers/URLHelper/SiteUrlCliTest.php +++ b/tests/system/Helpers/URLHelper/SiteUrlCliTest.php @@ -94,6 +94,9 @@ public function testUrls( $this->assertSame($expectedBaseUrl, base_url($path, $scheme)); } + /** + * @return iterable + */ public static function provideUrls(): iterable { // baseURL, indexPage, scheme, secure, path, expectedSiteUrl, expectedBaseUrl diff --git a/tests/system/Helpers/URLHelper/SiteUrlTest.php b/tests/system/Helpers/URLHelper/SiteUrlTest.php index c8a07758e3bd..a095cf703a86 100644 --- a/tests/system/Helpers/URLHelper/SiteUrlTest.php +++ b/tests/system/Helpers/URLHelper/SiteUrlTest.php @@ -55,7 +55,7 @@ protected function tearDown(): void service('superglobals')->setServerArray([]); } - private function createRequest(?App $config = null, $body = null, ?string $path = null): void + private function createRequest(?App $config = null, ?string $body = null, ?string $path = null): void { $config ??= new App(); @@ -105,6 +105,9 @@ public function testUrls( $this->assertSame($expectedBaseUrl, base_url($path, $scheme)); } + /** + * @return iterable + */ public static function provideUrls(): iterable { // baseURL, indexPage, scheme, secure, path, expectedSiteUrl, expectedBaseUrl diff --git a/utils/phpstan-baseline/argument.type.neon b/utils/phpstan-baseline/argument.type.neon index 4451b62f6419..bd5919d3f762 100644 --- a/utils/phpstan-baseline/argument.type.neon +++ b/utils/phpstan-baseline/argument.type.neon @@ -1,4 +1,4 @@ -# total 25 errors +# total 24 errors parameters: ignoreErrors: @@ -52,11 +52,6 @@ parameters: count: 2 path: ../../tests/system/Database/Live/UpsertTest.php - - - message: '#^Parameter \#1 \$num of function number_to_size expects int\|string, float given\.$#' - count: 1 - path: ../../tests/system/Helpers/NumberHelperTest.php - - message: '#^Parameter \#2 \$message of method CodeIgniter\\Log\\Handlers\\ChromeLoggerHandler\:\:handle\(\) expects string, stdClass given\.$#' count: 1 diff --git a/utils/phpstan-baseline/assign.propertyType.neon b/utils/phpstan-baseline/assign.propertyType.neon index a2a5ca34cc63..f783f8da680e 100644 --- a/utils/phpstan-baseline/assign.propertyType.neon +++ b/utils/phpstan-baseline/assign.propertyType.neon @@ -1,4 +1,4 @@ -# total 20 errors +# total 19 errors parameters: ignoreErrors: @@ -42,11 +42,6 @@ parameters: count: 4 path: ../../tests/system/Filters/HoneypotTest.php - - - message: '#^Property CodeIgniter\\Helpers\\CookieHelperTest\:\:\$response \(CodeIgniter\\HTTP\\Response\) does not accept CodeIgniter\\HTTP\\ResponseInterface\.$#' - count: 1 - path: ../../tests/system/Helpers/CookieHelperTest.php - - message: '#^Property CodeIgniter\\Honeypot\\HoneypotTest\:\:\$response \(CodeIgniter\\HTTP\\Response\) does not accept CodeIgniter\\HTTP\\RequestInterface\|CodeIgniter\\HTTP\\ResponseInterface\|string\|null\.$#' count: 1 diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index 61ebc04982b4..9954e15ad7a3 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 419 errors +# total 366 errors includes: - argument.type.neon diff --git a/utils/phpstan-baseline/method.notFound.neon b/utils/phpstan-baseline/method.notFound.neon index 67fac4e02b49..9443f439a180 100644 --- a/utils/phpstan-baseline/method.notFound.neon +++ b/utils/phpstan-baseline/method.notFound.neon @@ -1,4 +1,4 @@ -# total 20 errors +# total 18 errors parameters: ignoreErrors: @@ -12,11 +12,6 @@ parameters: count: 2 path: ../../tests/system/Commands/Utilities/Routes/FilterFinderTest.php - - - message: '#^Call to an undefined method org\\bovigo\\vfs\\visitor\\vfsStreamVisitor\:\:getStructure\(\)\.$#' - count: 2 - path: ../../tests/system/Helpers/FilesystemHelperTest.php - - message: '#^Call to an undefined method CodeIgniter\\Images\\Handlers\\BaseHandler\:\:getPathname\(\)\.$#' count: 1 diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index 333eaa92ae2e..a91013e3788b 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,4 +1,4 @@ -# total 282 errors +# total 236 errors parameters: ignoreErrors: @@ -1022,236 +1022,6 @@ parameters: count: 1 path: ../../tests/system/Filters/InvalidCharsTest.php - - - message: '#^Property CodeIgniter\\Helpers\\Array\\ArrayHelperDotKeyExistsTest\:\:\$array type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/Array/ArrayHelperDotKeyExistsTest.php - - - - message: '#^Property CodeIgniter\\Helpers\\Array\\ArrayHelperRecursiveDiffTest\:\:\$compareWith type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/Array/ArrayHelperRecursiveDiffTest.php - - - - message: '#^Property CodeIgniter\\Helpers\\Array\\ArrayHelperSortValuesByNaturalTest\:\:\$arrayWithArrayValues type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/Array/ArrayHelperSortValuesByNaturalTest.php - - - - message: '#^Property CodeIgniter\\Helpers\\Array\\ArrayHelperSortValuesByNaturalTest\:\:\$arrayWithStringValues type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/Array/ArrayHelperSortValuesByNaturalTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:provideArrayDeepSearch\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:provideArrayFlattening\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:provideArrayGroupByExcludeEmpty\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:provideArrayGroupByIncludeEmpty\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:provideSortByMultipleKeys\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayDeepSearch\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayFlattening\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayFlattening\(\) has parameter \$input with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayGroupByExcludeEmpty\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayGroupByExcludeEmpty\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayGroupByExcludeEmpty\(\) has parameter \$indexes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayGroupByIncludeEmpty\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayGroupByIncludeEmpty\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArrayGroupByIncludeEmpty\(\) has parameter \$indexes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysFailsEmptyParameter\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysFailsEmptyParameter\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysFailsEmptyParameter\(\) has parameter \$sortColumns with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysWithArray\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysWithArray\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysWithArray\(\) has parameter \$sortColumns with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysWithObjects\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysWithObjects\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\ArrayHelperTest\:\:testArraySortByMultipleKeysWithObjects\(\) has parameter \$sortColumns with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/ArrayHelperTest.php - - - - message: '#^Property CodeIgniter\\Helpers\\HTMLHelperTest\:\:\$tracks type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/Helpers/HTMLHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\InflectorHelperTest\:\:provideOrdinal\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/InflectorHelperTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\CurrentUrlTest\:\:provideUrlIs\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/CurrentUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAnchorExamples\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAnchorNoindex\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAnchorPopup\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAnchorTargetted\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAnchor\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAutoLinkEmail\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAutoLinkPopup\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAutoLinkUrl\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideAutolinkBoth\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideMailto\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:providePrepUrl\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideSafeMailto\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideUrlToThrowsOnEmptyOrMissingRoute\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:provideUrlTo\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\SiteUrlCliTest\:\:provideUrls\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/SiteUrlCliTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\SiteUrlTest\:\:provideUrls\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/SiteUrlTest.php - - message: '#^Method CodeIgniter\\I18n\\TimeLegacyTest\:\:provideToStringDoesNotDependOnLocale\(\) return type has no value type specified in iterable type iterable\.$#' count: 1 diff --git a/utils/phpstan-baseline/missingType.parameter.neon b/utils/phpstan-baseline/missingType.parameter.neon index 54d2e4a72c64..87eecd560077 100644 --- a/utils/phpstan-baseline/missingType.parameter.neon +++ b/utils/phpstan-baseline/missingType.parameter.neon @@ -1,4 +1,4 @@ -# total 12 errors +# total 9 errors parameters: ignoreErrors: @@ -37,21 +37,6 @@ parameters: count: 1 path: ../../tests/system/Filters/FiltersTest.php - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\CurrentUrlTest\:\:createRequest\(\) has parameter \$body with no type specified\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/CurrentUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\MiscUrlTest\:\:testUrlTo\(\) has parameter \$args with no type specified\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/MiscUrlTest.php - - - - message: '#^Method CodeIgniter\\Helpers\\URLHelper\\SiteUrlTest\:\:createRequest\(\) has parameter \$body with no type specified\.$#' - count: 1 - path: ../../tests/system/Helpers/URLHelper/SiteUrlTest.php - - message: '#^Method CodeIgniter\\Security\\SecurityCSRFSessionRandomizeTokenTest\:\:createSession\(\) has parameter \$options with no type specified\.$#' count: 1