diff --git a/system/DataConverter/DataConverter.php b/system/DataConverter/DataConverter.php index 4895ec4127d2..a1b5db4f0ef9 100644 --- a/system/DataConverter/DataConverter.php +++ b/system/DataConverter/DataConverter.php @@ -71,6 +71,8 @@ public function __construct( * * @param array $data DataSource data * + * @return array + * * @internal */ public function fromDataSource(array $data): array @@ -89,6 +91,8 @@ public function fromDataSource(array $data): array * * @param array $phpData PHP data * + * @return array + * * @internal */ public function toDataSource(array $phpData): array diff --git a/tests/system/DataConverter/DataConverterTest.php b/tests/system/DataConverter/DataConverterTest.php index 6686618a181b..4ee4a8078217 100644 --- a/tests/system/DataConverter/DataConverterTest.php +++ b/tests/system/DataConverter/DataConverterTest.php @@ -44,6 +44,11 @@ public function testInstantiate(): void $this->assertInstanceOf(DataConverter::class, $converter); } + /** + * @param array $types + * @param array $dbData + * @param array $expected + */ #[DataProvider('provideConvertDataFromDB')] public function testConvertDataFromDB(array $types, array $dbData, array $expected): void { @@ -54,6 +59,9 @@ public function testConvertDataFromDB(array $types, array $dbData, array $expect $this->assertSame($expected, $data); } + /** + * @return iterable, array, array}> + */ public static function provideConvertDataFromDB(): iterable { yield from [ @@ -270,6 +278,11 @@ public static function provideConvertDataFromDB(): iterable ]; } + /** + * @param array $types + * @param array $phpData + * @param array $expected + */ #[DataProvider('provideConvertDataToDB')] public function testConvertDataToDB(array $types, array $phpData, array $expected): void { @@ -280,6 +293,9 @@ public function testConvertDataToDB(array $types, array $phpData, array $expecte $this->assertSame($expected, $data); } + /** + * @return iterable, array, array}> + */ public static function provideConvertDataToDB(): iterable { yield from [ @@ -706,6 +722,8 @@ public function testNotNullable(): void } /** + * @param array $types + * @param array $handlers * @param (Closure(array): object)|string|null $reconstructor * @param (Closure(object, bool, bool): array)|string|null $extractor */ diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index d9cf5a7deb6d..8cfa166d48df 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 124 errors +# total 112 errors includes: - argument.type.neon diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index ff0cd8e18d33..b426389b6a68 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,4 +1,4 @@ -# total 80 errors +# total 68 errors parameters: ignoreErrors: @@ -72,16 +72,6 @@ parameters: count: 1 path: ../../system/Cookie/CookieStore.php - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverter\:\:fromDataSource\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/DataConverter/DataConverter.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverter\:\:toDataSource\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/DataConverter/DataConverter.php - - message: '#^Method CodeIgniter\\Exceptions\\PageNotFoundException\:\:lang\(\) has parameter \$args with no value type specified in iterable type array\.$#' count: 1 @@ -307,56 +297,6 @@ parameters: count: 1 path: ../../tests/system/Cookie/CookieTest.php - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:createDataConverter\(\) has parameter \$handlers with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:createDataConverter\(\) has parameter \$types with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:provideConvertDataFromDB\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:provideConvertDataToDB\(\) return type has no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:testConvertDataFromDB\(\) has parameter \$dbData with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:testConvertDataFromDB\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:testConvertDataFromDB\(\) has parameter \$types with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:testConvertDataToDB\(\) has parameter \$expected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:testConvertDataToDB\(\) has parameter \$phpData with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - - - message: '#^Method CodeIgniter\\DataConverter\\DataConverterTest\:\:testConvertDataToDB\(\) has parameter \$types with no value type specified in iterable type array\.$#' - count: 1 - path: ../../tests/system/DataConverter/DataConverterTest.php - - message: '#^Method CodeIgniter\\Models\\FindModelTest\:\:provideAggregateAndGroupBy\(\) return type has no value type specified in iterable type iterable\.$#' count: 1