diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 198d44818f..417f1aa628 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -17325,16 +17325,10 @@ parameters: count: 2 path: tests/unit/Display/ResultsTest.php - - - message: '#^Method PhpMyAdmin\\Tests\\Display\\ResultsTest\:\:dataProviderForTestGetDataCellForNonNumericColumns\(\) return type has no value type specified in iterable type array\.$#' - identifier: missingType.iterableValue - count: 3 - path: tests/unit/Display/ResultsTest.php - - message: '#^Method PhpMyAdmin\\Tests\\Display\\ResultsTest\:\:dataProviderForTestHandleNonPrintableContents\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue - count: 2 + count: 1 path: tests/unit/Display/ResultsTest.php - @@ -18999,6 +18993,12 @@ parameters: count: 1 path: tests/unit/Utils/ForeignKeyTest.php + - + message: '#^Method PhpMyAdmin\\Tests\\Utils\\FormatConverterTest\:\:providerBinaryToIp\(\) should return array\ but returns array\{array\{''10\.11\.12\.13'', ''0x0a0b0c0d'', false\}, array\{''my ip'', ''my ip'', false\}, array\{''10\.11\.12\.13'', ''0x0a0b0c0d'', true\}, array\{''6d79206970'', ''my ip'', true\}, array\{''10\.11\.12\.13'', ''0x0a0b0c0d'', true\}, array\{''666566'', ''fef'', true\}, array\{''0ded'', string\|false, true\}, array\{''127\.0\.0\.1'', string\|false, true\}\}\.$#' + identifier: return.type + count: 1 + path: tests/unit/Utils/FormatConverterTest.php + - message: '#^Binary operation "\." between ''Not supported in…'' and mixed results in an error\.$#' identifier: binaryOp.invalid diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 01831e5927..fc5673463a 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -10463,11 +10463,6 @@ config->debug->sql]]> config->debug->sql]]> - - - - - @@ -10550,8 +10545,6 @@ - - @@ -10578,11 +10571,6 @@ - - - - - @@ -10773,9 +10761,6 @@ - - - settings]]> @@ -10814,10 +10799,6 @@ settings]]> - - - - @@ -10921,25 +10902,16 @@ - - - + + + + + + settings['TrustedProxies']]]> - - - - - - - - - - - - @@ -11014,11 +10986,6 @@ settings]]> - - - - - getPDFData()]]> @@ -11107,10 +11074,6 @@ selectedServer]]> - - - - settings]]> settings]]> @@ -11265,14 +11228,6 @@ selectedServer]]> - - - - - - - - @@ -11361,13 +11316,6 @@ - - - - - - - @@ -11480,11 +11428,6 @@ - - - - - result, 1, 0)]]> @@ -11538,23 +11481,11 @@ - - - - - - - - - - - - @@ -11570,9 +11501,11 @@ selectedServer]]> selectedServer]]> - - - + + + + + @@ -11587,13 +11520,6 @@ - - - - - - - @@ -11731,22 +11657,6 @@ - - - - - - - - - - - - - - - - @@ -11757,9 +11667,6 @@ - - - @@ -11769,13 +11676,6 @@ - - - - - - - @@ -11864,8 +11764,5 @@ - - - diff --git a/src/Dbal/Warning.php b/src/Dbal/Warning.php index 3c123d4d0d..cf3a41c7b6 100644 --- a/src/Dbal/Warning.php +++ b/src/Dbal/Warning.php @@ -8,7 +8,6 @@ use Stringable; use function in_array; use function is_numeric; -use function is_string; /** * @see https://mariadb.com/kb/en/show-warnings/ @@ -30,14 +29,14 @@ final class Warning implements Stringable $this->code = $code >= 1 ? $code : 0; } - /** @param mixed[] $row */ + /** @param array $row */ public static function fromArray(array $row): self { $level = ''; $code = 0; $message = ''; - if (isset($row['Level']) && is_string($row['Level'])) { + if (isset($row['Level'])) { $level = $row['Level']; } @@ -45,7 +44,7 @@ final class Warning implements Stringable $code = (int) $row['Code']; } - if (isset($row['Message']) && is_string($row['Message'])) { + if (isset($row['Message'])) { $message = $row['Message']; } diff --git a/tests/unit/Advisory/AdvisorTest.php b/tests/unit/Advisory/AdvisorTest.php index 5c93067477..e24b4943da 100644 --- a/tests/unit/Advisory/AdvisorTest.php +++ b/tests/unit/Advisory/AdvisorTest.php @@ -53,9 +53,9 @@ class AdvisorTest extends AbstractTestCase /** * Test for adding rule * - * @param mixed[] $rule Rule to test - * @param mixed[] $expected Expected rendered rule in fired/errors list - * @param string|null $error Expected error string (null if none error expected) + * @param array $rule Rule to test + * @param array $expected Expected rendered rule in fired/errors list + * @param string|null $error Expected error string (null if none error expected) * @psalm-param RuleType $rule * @psalm-param RuleType|array $expected */ diff --git a/tests/unit/Config/Forms/FormListTest.php b/tests/unit/Config/Forms/FormListTest.php index 7f5614e7ee..4689926229 100644 --- a/tests/unit/Config/Forms/FormListTest.php +++ b/tests/unit/Config/Forms/FormListTest.php @@ -64,7 +64,7 @@ class FormListTest extends AbstractTestCase self::assertSame('', $forms->displayErrors()); } - /** @psalm-return array, class-string}> */ + /** @return array, class-string}> */ public static function formObjects(): array { return [ diff --git a/tests/unit/Config/SettingsTest.php b/tests/unit/Config/SettingsTest.php index fa757dfd59..ee6afbd68f 100644 --- a/tests/unit/Config/SettingsTest.php +++ b/tests/unit/Config/SettingsTest.php @@ -1434,7 +1434,7 @@ class SettingsTest extends TestCase yield 'valid value with type coercion' => [0, false]; } - /** @param mixed[] $expected */ + /** @param array $expected */ #[DataProvider('valuesForDebugProvider')] public function testDebug(mixed $actual, array $expected): void { @@ -1445,7 +1445,7 @@ class SettingsTest extends TestCase self::assertSame($expectedDebug->asArray(), $settingsArray['DBG']); } - /** @return iterable */ + /** @return iterable}> */ public static function valuesForDebugProvider(): iterable { yield 'null value' => [null, []]; diff --git a/tests/unit/ConfigStorage/RelationParametersTest.php b/tests/unit/ConfigStorage/RelationParametersTest.php index 2237b04bfd..1d4031f04c 100644 --- a/tests/unit/ConfigStorage/RelationParametersTest.php +++ b/tests/unit/ConfigStorage/RelationParametersTest.php @@ -259,8 +259,8 @@ final class RelationParametersTest extends TestCase } /** - * @param mixed[] $params - * @param mixed[] $expected + * @param array $params + * @param array $expected */ #[DataProvider('providerForTestToArray')] public function testToArray(array $params, array $expected): void @@ -268,7 +268,7 @@ final class RelationParametersTest extends TestCase self::assertSame($expected, RelationParameters::fromArray($params)->toArray()); } - /** @return array>> */ + /** @return array, array}> */ public static function providerForTestToArray(): array { return [ diff --git a/tests/unit/ConfigTest.php b/tests/unit/ConfigTest.php index 111c107c8d..37d75e5894 100644 --- a/tests/unit/ConfigTest.php +++ b/tests/unit/ConfigTest.php @@ -434,9 +434,9 @@ class ConfigTest extends AbstractTestCase /** * Test for selectServer * - * @param mixed[] $settings settings array - * @param string|mixed[] $request request - * @param int $expected expected result + * @param array> $settings settings array + * @param string|mixed[] $request request + * @param int $expected expected result */ #[DataProvider('selectServerProvider')] public function testSelectServer(array $settings, string|array $request, int $expected): void @@ -463,7 +463,7 @@ class ConfigTest extends AbstractTestCase /** * Data provider for selectServer test * - * @return array + * @return array>, string|mixed[], int}> */ public static function selectServerProvider(): array { @@ -485,8 +485,8 @@ class ConfigTest extends AbstractTestCase /** * Test for getConnectionParams * - * @param mixed[] $serverCfg Server configuration - * @param mixed[] $expected Expected result + * @param array $serverCfg Server configuration + * @param array $expected Expected result */ #[DataProvider('connectionParams')] public function testGetConnectionParams(array $serverCfg, ConnectionType $connectionType, array $expected): void @@ -498,7 +498,7 @@ class ConfigTest extends AbstractTestCase /** * Data provider for getConnectionParams test * - * @return array + * @return array, ConnectionType, array}> */ public static function connectionParams(): array { @@ -637,7 +637,7 @@ class ConfigTest extends AbstractTestCase self::assertEquals($expected, $actual); } - /** @psalm-return iterable */ + /** @return iterable */ public static function connectionParamsWhenConnectionIsUserOrAuxiliaryProvider(): iterable { yield 'user with only port empty' => [ConnectionType::User, 'test.host', '', 'test.host', '0']; diff --git a/tests/unit/Controllers/Import/SimulateDmlControllerTest.php b/tests/unit/Controllers/Import/SimulateDmlControllerTest.php index d8f54d62ca..723bead926 100644 --- a/tests/unit/Controllers/Import/SimulateDmlControllerTest.php +++ b/tests/unit/Controllers/Import/SimulateDmlControllerTest.php @@ -82,7 +82,7 @@ final class SimulateDmlControllerTest extends AbstractTestCase } /** - * @psalm-return array< + * @return array< * array{ * string, * list>|false $value */ @@ -89,7 +89,7 @@ final class DatabaseInterfaceTest extends AbstractTestCase /** * Data provider for getCurrentUser() tests. * - * @return mixed[] + * @return array{list>|false, string, string[], bool}[] */ public static function currentUserData(): array { @@ -135,7 +135,7 @@ final class DatabaseInterfaceTest extends AbstractTestCase /** * Data provider for getCurrentRole() tests. * - * @return mixed[] + * @return array{string, bool, string[][]|false, string[], string[][]}[] */ public static function currentRolesData(): array { @@ -223,10 +223,10 @@ final class DatabaseInterfaceTest extends AbstractTestCase * Tests for DBI::postConnect() method. * should set version int, isMariaDB and isPercona * - * @param array $version Database version - * @param int $versionInt Database version as integer - * @param bool $isMariaDb True if mariadb - * @param bool $isPercona True if percona + * @param array $version Database version + * @param int $versionInt Database version as integer + * @param bool $isMariaDb True if mariadb + * @param bool $isPercona True if percona * @phpstan-param array $version */ #[DataProvider('provideDatabaseVersionData')] @@ -355,7 +355,7 @@ final class DatabaseInterfaceTest extends AbstractTestCase /** * Data provider for isAmazonRds() tests. * - * @return mixed[] + * @return array{list>, bool}[] */ public static function isAmazonRdsData(): array { @@ -778,10 +778,10 @@ final class DatabaseInterfaceTest extends AbstractTestCase /** * Tests for setVersion method. * - * @param array $version Database version - * @param int $versionInt Database version as integer - * @param bool $isMariaDb True if mariadb - * @param bool $isPercona True if percona + * @param array $version Database version + * @param int $versionInt Database version as integer + * @param bool $isMariaDb True if mariadb + * @param bool $isPercona True if percona * @phpstan-param array $version */ #[DataProvider('provideDatabaseVersionData')] diff --git a/tests/unit/Dbal/WarningTest.php b/tests/unit/Dbal/WarningTest.php index 51ee125b9f..58aa96b0db 100644 --- a/tests/unit/Dbal/WarningTest.php +++ b/tests/unit/Dbal/WarningTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase; #[CoversClass(Warning::class)] class WarningTest extends TestCase { - /** @param mixed[] $row */ + /** @param array $row */ #[DataProvider('providerForTestWarning')] public function testWarning(array $row, string $level, int $code, string $message, string $toString): void { @@ -23,10 +23,7 @@ class WarningTest extends TestCase self::assertSame($toString, (string) $warning); } - /** - * @return int[][]|string[][]|string[][][] - * @psalm-return array{string[], string, int, string, string}[] - */ + /** @return array{array, string, int, string, string}[] */ public static function providerForTestWarning(): array { return [ diff --git a/tests/unit/Display/ResultsTest.php b/tests/unit/Display/ResultsTest.php index 74c4c32329..0be75ae817 100644 --- a/tests/unit/Display/ResultsTest.php +++ b/tests/unit/Display/ResultsTest.php @@ -189,7 +189,7 @@ class ResultsTest extends AbstractTestCase /** * Data provider for testGetSpecialLinkUrl * - * @return mixed[] parameters and output + * @return array, string, string}> */ public static function dataProviderForTestGetSpecialLinkUrl(): array { @@ -217,12 +217,12 @@ class ResultsTest extends AbstractTestCase /** * Test getSpecialLinkUrl * - * @param string $db the database name - * @param string $table the table name - * @param string $columnValue column value - * @param mixed[] $rowInfo information about row - * @param string $fieldName column name - * @param string $output output of getSpecialLinkUrl + * @param string $db the database name + * @param string $table the table name + * @param string $columnValue column value + * @param array $rowInfo information about row + * @param string $fieldName column name + * @param string $output output of getSpecialLinkUrl */ #[DataProvider('dataProviderForTestGetSpecialLinkUrl')] public function testGetSpecialLinkUrl( @@ -297,9 +297,9 @@ class ResultsTest extends AbstractTestCase /** * Test getRowInfoForSpecialLinks * - * @param FieldMetadata[] $fieldsMeta meta information about fields - * @param mixed[] $row current row data - * @param mixed[] $output output of getRowInfoForSpecialLinks + * @param FieldMetadata[] $fieldsMeta meta information about fields + * @param string[] $row current row data + * @param array $output output of getRowInfoForSpecialLinks */ #[DataProvider('dataProviderForTestGetRowInfoForSpecialLinks')] public function testGetRowInfoForSpecialLinks( @@ -340,7 +340,7 @@ class ResultsTest extends AbstractTestCase /** * Data provider for testGetPartialText * - * @return mixed[] parameters and output + * @return array */ public static function dataProviderForTestGetPartialText(): array { @@ -386,7 +386,7 @@ class ResultsTest extends AbstractTestCase * TransformationsPlugin|null, * array|object, * object, - * array, + * array, * bool, * string * }> @@ -418,15 +418,15 @@ class ResultsTest extends AbstractTestCase } /** - * @param bool $displayBinary show binary contents? - * @param bool $displayBlob show blob contents? - * @param string $category BLOB|BINARY|GEOMETRY - * @param string|null $content the binary content - * @param mixed[]|object $transformOptions transformation parameters - * @param object $meta the meta-information about the field - * @param mixed[] $urlParams parameters that should go to the download link - * @param bool $isTruncated the result is truncated or not - * @param string $output the output of this function + * @param bool $displayBinary show binary contents? + * @param bool $displayBlob show blob contents? + * @param string $category BLOB|BINARY|GEOMETRY + * @param string|null $content the binary content + * @param mixed[]|object $transformOptions transformation parameters + * @param object $meta the meta-information about the field + * @param array $urlParams parameters that should go to the download link + * @param bool $isTruncated the result is truncated or not + * @param string $output the output of this function */ #[DataProvider('dataProviderForTestHandleNonPrintableContents')] public function testHandleNonPrintableContents( @@ -456,17 +456,16 @@ class ResultsTest extends AbstractTestCase } /** - * @return mixed[][] - * @psalm-return array */ @@ -597,7 +596,7 @@ class ResultsTest extends AbstractTestCase * @param mixed[] $map the list of relations * @param mixed[] $urlParams the parameters for generate url * @param bool $conditionField the column should highlighted or not - * @param mixed[] $transformOptions the transformation parameters + * @param string[] $transformOptions the transformation parameters * @param string $output the output of this function */ #[DataProvider('dataProviderForTestGetDataCellForNonNumericColumns')] @@ -793,7 +792,7 @@ class ResultsTest extends AbstractTestCase ]; } - /** @param mixed[] $urlParams */ + /** @param array $urlParams */ #[DataProvider('dataProviderGetSortOrderHiddenInputs')] public function testGetSortOrderHiddenInputs( string $sqlAdd, @@ -893,11 +892,11 @@ class ResultsTest extends AbstractTestCase } /** - * @param mixed[] $session - * @param mixed[] $get - * @param mixed[] $post - * @param mixed[] $request - * @param mixed[] $expected + * @param array>>|string> $session + * @param array $get + * @param array $post + * @param array $request + * @param array>|string|int> $expected */ #[DataProvider('providerSetConfigParamsForDisplayTable')] public function testSetConfigParamsForDisplayTable( diff --git a/tests/unit/Engines/PbxtTest.php b/tests/unit/Engines/PbxtTest.php index 71025bbb1c..0d28806124 100644 --- a/tests/unit/Engines/PbxtTest.php +++ b/tests/unit/Engines/PbxtTest.php @@ -162,8 +162,8 @@ class PbxtTest extends AbstractTestCase /** * Test for resolveTypeSize * - * @param string $formattedSize the size expression (for example 8MB) - * @param mixed[] $output Expected output + * @param string $formattedSize the size expression (for example 8MB) + * @param string[] $output Expected output */ #[DataProvider('providerFortTestResolveTypeSize')] public function testResolveTypeSize(string $formattedSize, array $output): void @@ -177,7 +177,7 @@ class PbxtTest extends AbstractTestCase /** * Provider for testResolveTypeSize * - * @return mixed[] + * @return array */ public static function providerFortTestResolveTypeSize(): array { diff --git a/tests/unit/Error/ErrorReportTest.php b/tests/unit/Error/ErrorReportTest.php index 082a79b583..67c67be099 100644 --- a/tests/unit/Error/ErrorReportTest.php +++ b/tests/unit/Error/ErrorReportTest.php @@ -319,8 +319,8 @@ class ErrorReportTest extends AbstractTestCase /** * Test the url sanitization * - * @param string $url The url to test - * @param mixed[] $result The result + * @param string $url The url to test + * @param string[] $result The result */ #[DataProvider('urlsToSanitize')] public function testSanitizeUrl(string $url, array $result): void diff --git a/tests/unit/Error/ErrorTest.php b/tests/unit/Error/ErrorTest.php index 5bfcdad491..4fffbc4e64 100644 --- a/tests/unit/Error/ErrorTest.php +++ b/tests/unit/Error/ErrorTest.php @@ -87,7 +87,7 @@ class ErrorTest extends AbstractTestCase self::assertStringEndsWith($expected, $filePath); } - /** @psalm-return non-empty-string[][] */ + /** @return non-empty-string[][] */ public static function validFilePathsProvider(): array { return [ @@ -107,7 +107,7 @@ class ErrorTest extends AbstractTestCase self::assertSame($expected, $filePath); } - /** @psalm-return non-empty-string[][] */ + /** @return non-empty-string[][] */ public static function invalidFilePathsProvider(): array { return [ diff --git a/tests/unit/Gis/GisGeometryCollectionTest.php b/tests/unit/Gis/GisGeometryCollectionTest.php index fee4a73a6e..fe5cd35d83 100644 --- a/tests/unit/Gis/GisGeometryCollectionTest.php +++ b/tests/unit/Gis/GisGeometryCollectionTest.php @@ -389,11 +389,11 @@ class GisGeometryCollectionTest extends GisGeomTestCase /** * Test for prepareRowAsOl * - * @param string $spatial string to parse - * @param int $srid SRID - * @param string $label field label - * @param int[] $color line color - * @param mixed[] $expected + * @param string $spatial string to parse + * @param int $srid SRID + * @param string $label field label + * @param int[] $color line color + * @param array $expected */ #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( @@ -410,7 +410,7 @@ class GisGeometryCollectionTest extends GisGeomTestCase /** * Data provider for testPrepareRowAsOl() test case * - * @return array + * @return array}> */ public static function providerForPrepareRowAsOl(): array { diff --git a/tests/unit/Gis/GisGeometryTest.php b/tests/unit/Gis/GisGeometryTest.php index 391a64930e..9201c8e8db 100644 --- a/tests/unit/Gis/GisGeometryTest.php +++ b/tests/unit/Gis/GisGeometryTest.php @@ -90,8 +90,8 @@ class GisGeometryTest extends AbstractTestCase /** * tests parseWktAndSrid method * - * @param string $value Geometry data - * @param mixed[] $output Expected output + * @param string $value Geometry data + * @param array $output Expected output */ #[DataProvider('providerForTestParseWktAndSrid')] public function testParseWktAndSrid(string $value, array $output): void @@ -110,7 +110,7 @@ class GisGeometryTest extends AbstractTestCase /** * data provider for testParseWktAndSrid * - * @return array + * @return array}> */ public static function providerForTestParseWktAndSrid(): array { @@ -133,7 +133,7 @@ class GisGeometryTest extends AbstractTestCase * @param string $pointSet String of comma separated points * @param ScaleData|null $scaleData Data related to scaling * @param bool $linear If true, as a 1D array, else as a 2D array - * @param mixed[] $output Expected output + * @param int[][]|int[] $output Expected output */ #[DataProvider('providerForTestExtractPointsInternal')] public function testExtractPointsInternal( @@ -154,7 +154,7 @@ class GisGeometryTest extends AbstractTestCase /** * data provider for testExtractPointsInternal * - * @return array + * @return array */ public static function providerForTestExtractPointsInternal(): array { diff --git a/tests/unit/Gis/GisMultiPolygonTest.php b/tests/unit/Gis/GisMultiPolygonTest.php index 2b8520cfe1..540cf87e79 100644 --- a/tests/unit/Gis/GisMultiPolygonTest.php +++ b/tests/unit/Gis/GisMultiPolygonTest.php @@ -156,8 +156,8 @@ class GisMultiPolygonTest extends GisGeomTestCase /** * test getShape method * - * @param mixed[] $rowData array of GIS data - * @param string $shape expected shape in WKT + * @param array>>> $rowData array of GIS data + * @param string $shape expected shape in WKT */ #[DataProvider('providerForTestGetShape')] public function testGetShape(array $rowData, string $shape): void @@ -169,7 +169,7 @@ class GisMultiPolygonTest extends GisGeomTestCase /** * data provider for testGetShape * - * @return array + * @return array>>>, string}> */ public static function providerForTestGetShape(): array { @@ -362,11 +362,11 @@ class GisMultiPolygonTest extends GisGeomTestCase /** * test case for prepareRowAsOl() method * - * @param string $spatial GIS MULTIPOLYGON object - * @param int $srid spatial reference ID - * @param string $label label for the GIS MULTIPOLYGON object - * @param int[] $color color for the GIS MULTIPOLYGON object - * @param mixed[] $expected + * @param string $spatial GIS MULTIPOLYGON object + * @param int $srid spatial reference ID + * @param string $label label for the GIS MULTIPOLYGON object + * @param int[] $color color for the GIS MULTIPOLYGON object + * @param array> $expected */ #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( @@ -383,7 +383,7 @@ class GisMultiPolygonTest extends GisGeomTestCase /** * data provider for testPrepareRowAsOl() test case * - * @return array + * @return array>}> */ public static function providerForPrepareRowAsOl(): array { diff --git a/tests/unit/Gis/GisPointTest.php b/tests/unit/Gis/GisPointTest.php index 63cf1e3de4..f13d60571b 100644 --- a/tests/unit/Gis/GisPointTest.php +++ b/tests/unit/Gis/GisPointTest.php @@ -56,8 +56,8 @@ class GisPointTest extends GisGeomTestCase /** * test getShape method * - * @param mixed[] $rowData array of GIS data - * @param string $shape expected shape in WKT + * @param array $rowData array of GIS data + * @param string $shape expected shape in WKT */ #[DataProvider('providerForTestGetShape')] public function testGetShape(array $rowData, string $shape): void @@ -69,7 +69,7 @@ class GisPointTest extends GisGeomTestCase /** * data provider for testGetShape * - * @return array + * @return array, string}> */ public static function providerForTestGetShape(): array { @@ -256,11 +256,11 @@ class GisPointTest extends GisGeomTestCase /** * test case for prepareRowAsOl() method * - * @param string $spatial GIS POINT object - * @param int $srid spatial reference ID - * @param string $label label for the GIS POINT object - * @param int[] $color color for the GIS POINT object - * @param mixed[] $expected + * @param string $spatial GIS POINT object + * @param int $srid spatial reference ID + * @param string $label label for the GIS POINT object + * @param int[] $color color for the GIS POINT object + * @param array> $expected */ #[DataProvider('providerForPrepareRowAsOl')] public function testPrepareRowAsOl( @@ -277,7 +277,7 @@ class GisPointTest extends GisGeomTestCase /** * data provider for testPrepareRowAsOl() test case * - * @return array + * @return array>}> */ public static function providerForPrepareRowAsOl(): array { diff --git a/tests/unit/Html/GeneratorTest.php b/tests/unit/Html/GeneratorTest.php index 1589dff826..37a16462c1 100644 --- a/tests/unit/Html/GeneratorTest.php +++ b/tests/unit/Html/GeneratorTest.php @@ -197,7 +197,7 @@ class GeneratorTest extends AbstractTestCase /** * Data provider for Generator::linkOrButton test * - * @return mixed[] + * @return array[]|string[]|null[]|bool[], int, string}> */ public static function linksOrButtons(): array { diff --git a/tests/unit/Http/Factory/ResponseFactoryTest.php b/tests/unit/Http/Factory/ResponseFactoryTest.php index 4f9dcfe2f9..5dbab91da1 100644 --- a/tests/unit/Http/Factory/ResponseFactoryTest.php +++ b/tests/unit/Http/Factory/ResponseFactoryTest.php @@ -42,7 +42,7 @@ final class ResponseFactoryTest extends TestCase self::assertInstanceOf($expectedResponse, $actual); } - /** @psalm-return iterable, class-string}> */ + /** @return iterable, class-string}> */ public static function providerForTestCreateResponse(): iterable { yield 'slim/psr7' => [SlimResponseFactory::class, \Slim\Psr7\Response::class]; @@ -64,7 +64,7 @@ final class ResponseFactoryTest extends TestCase self::assertInstanceOf($provider, $actual); } - /** @psalm-return iterable}> */ + /** @return iterable}> */ public static function providerForTestCreate(): iterable { yield 'slim/psr7' => [SlimResponseFactory::class]; diff --git a/tests/unit/Http/Factory/ServerRequestFactoryTest.php b/tests/unit/Http/Factory/ServerRequestFactoryTest.php index bf2096e9a8..60679af7f8 100644 --- a/tests/unit/Http/Factory/ServerRequestFactoryTest.php +++ b/tests/unit/Http/Factory/ServerRequestFactoryTest.php @@ -71,7 +71,7 @@ final class ServerRequestFactoryTest extends TestCase } /** - * @psalm-return iterable, * class-string * }> @@ -99,7 +99,7 @@ final class ServerRequestFactoryTest extends TestCase self::assertInstanceOf($provider, $actual); } - /** @psalm-return iterable}> */ + /** @return iterable}> */ public static function providerForTestCreate(): iterable { yield 'slim/psr7' => [SlimServerRequestFactory::class]; @@ -246,7 +246,7 @@ final class ServerRequestFactoryTest extends TestCase } /** - * @psalm-return iterable, * class-string, * class-string diff --git a/tests/unit/Http/Factory/UriFactoryTest.php b/tests/unit/Http/Factory/UriFactoryTest.php index 9a5c161874..ff156b0a35 100644 --- a/tests/unit/Http/Factory/UriFactoryTest.php +++ b/tests/unit/Http/Factory/UriFactoryTest.php @@ -40,7 +40,7 @@ final class UriFactoryTest extends TestCase self::assertInstanceOf($expectedUri, $uri); } - /** @psalm-return iterable, class-string}> */ + /** @return iterable, class-string}> */ public static function providerForTestCreateUri(): iterable { yield 'slim/psr7' => [SlimUriFactory::class, Uri::class]; @@ -62,7 +62,7 @@ final class UriFactoryTest extends TestCase self::assertInstanceOf($provider, $actual); } - /** @psalm-return iterable}> */ + /** @return iterable}> */ public static function uriFactoryProviders(): iterable { yield 'slim/psr7' => [SlimUriFactory::class]; diff --git a/tests/unit/Http/ResponseTest.php b/tests/unit/Http/ResponseTest.php index 242b2d11a9..1db41e80f4 100644 --- a/tests/unit/Http/ResponseTest.php +++ b/tests/unit/Http/ResponseTest.php @@ -32,7 +32,7 @@ final class ResponseTest extends TestCase return (new ResponseFactory(new $provider()))->createResponse(); } - /** @psalm-return iterable}> */ + /** @return iterable}> */ public static function responseFactoryProviders(): iterable { yield 'slim/psr7' => [SlimResponseFactory::class]; diff --git a/tests/unit/Http/ServerRequestTest.php b/tests/unit/Http/ServerRequestTest.php index 8165846395..e072bd8652 100644 --- a/tests/unit/Http/ServerRequestTest.php +++ b/tests/unit/Http/ServerRequestTest.php @@ -93,8 +93,8 @@ class ServerRequestTest extends TestCase } /** - * @psalm-param array $headers - * @psalm-param array|null $body + * @param array $headers + * @param array|null $body */ #[DataProvider('isAjaxProvider')] public function testIsAjax(bool $expected, string $method, string $uri, array $headers, array|null $body): void diff --git a/tests/unit/Import/ImportTest.php b/tests/unit/Import/ImportTest.php index a436edbbe5..fd754c108c 100644 --- a/tests/unit/Import/ImportTest.php +++ b/tests/unit/Import/ImportTest.php @@ -119,7 +119,7 @@ class ImportTest extends AbstractTestCase /** * Data provider for testGetColumnAlphaName * - * @return mixed[] + * @return array */ public static function provGetColumnAlphaName(): array { @@ -141,7 +141,7 @@ class ImportTest extends AbstractTestCase /** * Data provider for testGetColumnNumberFromName * - * @return mixed[] + * @return array */ public static function provGetColumnNumberFromName(): array { diff --git a/tests/unit/IpAllowDenyTest.php b/tests/unit/IpAllowDenyTest.php index 478cff40ce..f06848ef48 100644 --- a/tests/unit/IpAllowDenyTest.php +++ b/tests/unit/IpAllowDenyTest.php @@ -81,7 +81,7 @@ class IpAllowDenyTest extends AbstractTestCase /** * Data provider for Core::getIp tests * - * @return mixed[] + * @return array> */ public static function proxyIPs(): array { diff --git a/tests/unit/LinterTest.php b/tests/unit/LinterTest.php index 4201a95ced..7466b39d18 100644 --- a/tests/unit/LinterTest.php +++ b/tests/unit/LinterTest.php @@ -71,8 +71,8 @@ class LinterTest extends AbstractTestCase /** * Test for Linter::lint * - * @param mixed[] $expected The expected result. - * @param string $query The query to be analyzed. + * @param array> $expected The expected result. + * @param string $query The query to be analyzed. */ #[DataProvider('lintProvider')] public function testLint(array $expected, string $query): void @@ -83,7 +83,7 @@ class LinterTest extends AbstractTestCase /** * Provides data for `testLint`. * - * @return array + * @return array>, string}> Test data */ public static function lintProvider(): array { diff --git a/tests/unit/MessageTest.php b/tests/unit/MessageTest.php index 736ac4ca3b..732d6653ae 100644 --- a/tests/unit/MessageTest.php +++ b/tests/unit/MessageTest.php @@ -367,7 +367,7 @@ class MessageTest extends AbstractTestCase /** * Data provider for testAffectedRows * - * @return mixed[] Test-data + * @return array Test-data */ public static function providerAffectedRows(): array { @@ -410,7 +410,7 @@ class MessageTest extends AbstractTestCase /** * Data provider for testInsertedRows * - * @return mixed[] Test-data + * @return array Test-data */ public static function providerInsertedRows(): array { @@ -453,7 +453,7 @@ class MessageTest extends AbstractTestCase /** * Data provider for testDeletedRows * - * @return mixed[] Test-data + * @return array Test-data */ public static function providerDeletedRows(): array { diff --git a/tests/unit/MimeTest.php b/tests/unit/MimeTest.php index 715d120b4a..0d3a69dfcc 100644 --- a/tests/unit/MimeTest.php +++ b/tests/unit/MimeTest.php @@ -31,7 +31,7 @@ class MimeTest extends AbstractTestCase /** * Provider for testDetect * - * @return mixed[] data for testDetect + * @return string[][] data for testDetect */ public static function providerForTestDetect(): array { diff --git a/tests/unit/OperationsTest.php b/tests/unit/OperationsTest.php index f8ca3b145b..390e362d73 100644 --- a/tests/unit/OperationsTest.php +++ b/tests/unit/OperationsTest.php @@ -36,7 +36,7 @@ class OperationsTest extends AbstractTestCase $this->object = new Operations($this->dbi, $relation, new TableMover($this->dbi, $relation)); } - /** @param mixed[] $extraChoice */ + /** @param array $extraChoice */ #[DataProvider('providerGetPartitionMaintenanceChoices')] public function testGetPartitionMaintenanceChoices(string $tableName, array $extraChoice): void { @@ -57,7 +57,7 @@ class OperationsTest extends AbstractTestCase self::assertSame($expected, $actual); } - /** @psalm-return array}> */ + /** @return array}> */ public static function providerGetPartitionMaintenanceChoices(): array { return [ diff --git a/tests/unit/Partitioning/TablePartitionDefinitionTest.php b/tests/unit/Partitioning/TablePartitionDefinitionTest.php index 95e80e43e6..5e826e1cea 100644 --- a/tests/unit/Partitioning/TablePartitionDefinitionTest.php +++ b/tests/unit/Partitioning/TablePartitionDefinitionTest.php @@ -141,7 +141,7 @@ class TablePartitionDefinitionTest extends TestCase } /** - * @psalm-return array[]>[]|null * }> */ @@ -246,7 +246,7 @@ class TablePartitionDefinitionTest extends TestCase self::assertCount($partitionCount, $actual['partitions']); } - /** @psalm-return array{0: int, 1: string}[] */ + /** @return array{0: int, 1: string}[] */ public static function providerGetDetailsWithMaxPartitions(): array { return ['count within the limit' => [8192, '8192'], 'count above the limit' => [8192, '8193']]; diff --git a/tests/unit/Plugins/Auth/AuthenticationCookieTest.php b/tests/unit/Plugins/Auth/AuthenticationCookieTest.php index 9121bf0e2a..963dc00d69 100644 --- a/tests/unit/Plugins/Auth/AuthenticationCookieTest.php +++ b/tests/unit/Plugins/Auth/AuthenticationCookieTest.php @@ -636,7 +636,7 @@ class AuthenticationCookieTest extends AbstractTestCase ); } - /** @return mixed[] */ + /** @return array */ public static function dataProviderPasswordLength(): array { return [ @@ -979,7 +979,7 @@ class AuthenticationCookieTest extends AbstractTestCase self::assertSame($expected, $exception->failureType); } - /** @return mixed[] */ + /** @return array, string}> */ public static function checkRulesProvider(): array { return [ diff --git a/tests/unit/Plugins/Export/Helpers/TablePropertyTest.php b/tests/unit/Plugins/Export/Helpers/TablePropertyTest.php index 6bc2f7fcb6..cedc0891c3 100644 --- a/tests/unit/Plugins/Export/Helpers/TablePropertyTest.php +++ b/tests/unit/Plugins/Export/Helpers/TablePropertyTest.php @@ -85,7 +85,7 @@ class TablePropertyTest extends AbstractTestCase /** * Data provider for testIsNotNull * - * @return mixed[] Test Data + * @return string[][] Test Data */ public static function isNotNullProvider(): array { @@ -110,7 +110,7 @@ class TablePropertyTest extends AbstractTestCase /** * Data provider for testIsUnique * - * @return mixed[] Test Data + * @return string[][] Test Data */ public static function isUniqueProvider(): array { @@ -135,7 +135,7 @@ class TablePropertyTest extends AbstractTestCase /** * Data provider for testGetDotNetPrimitiveType * - * @return mixed[] Test Data + * @return string[][] Test Data */ public static function getDotNetPrimitiveTypeProvider(): array { @@ -172,7 +172,7 @@ class TablePropertyTest extends AbstractTestCase /** * Data provider for testGetDotNetObjectType * - * @return mixed[] Test Data + * @return string[][] Test Data */ public static function getDotNetObjectTypeProvider(): array { diff --git a/tests/unit/SanitizeTest.php b/tests/unit/SanitizeTest.php index b98de2c04d..80a7633280 100644 --- a/tests/unit/SanitizeTest.php +++ b/tests/unit/SanitizeTest.php @@ -69,7 +69,7 @@ class SanitizeTest extends AbstractTestCase /** * Data provider for sanitize [doc@foo] markup * - * @return mixed[] + * @return string[][] */ public static function docLinks(): array { @@ -166,7 +166,7 @@ class SanitizeTest extends AbstractTestCase /** * Provider for testFormat * - * @return mixed[] + * @return array */ public static function variables(): array { @@ -186,7 +186,7 @@ class SanitizeTest extends AbstractTestCase /** * Data provider for sanitize links * - * @return mixed[] + * @return array */ public static function dataProviderCheckLinks(): array { diff --git a/tests/unit/Server/PrivilegesTest.php b/tests/unit/Server/PrivilegesTest.php index 7e0de60f59..4014f04ae7 100644 --- a/tests/unit/Server/PrivilegesTest.php +++ b/tests/unit/Server/PrivilegesTest.php @@ -1940,7 +1940,7 @@ class PrivilegesTest extends AbstractTestCase /** * data provider for testEscapeMysqlWildcards and testUnescapeMysqlWildcards * - * @psalm-return list + * @return list */ public static function providerUnEscapeMysqlWildcards(): array { diff --git a/tests/unit/SqlTest.php b/tests/unit/SqlTest.php index 0c77eff2ba..52ac1ba9f5 100644 --- a/tests/unit/SqlTest.php +++ b/tests/unit/SqlTest.php @@ -421,7 +421,7 @@ class SqlTest extends AbstractTestCase ]; } - /** @param mixed[] $sessionTmpVal */ + /** @param array $sessionTmpVal */ #[DataProvider('dataProviderCountQueryResults')] public function testCountQueryResults( string|null $sqlQuery, diff --git a/tests/unit/StorageEngineTest.php b/tests/unit/StorageEngineTest.php index 4e843eda01..5ae5ad7af3 100644 --- a/tests/unit/StorageEngineTest.php +++ b/tests/unit/StorageEngineTest.php @@ -103,7 +103,7 @@ class StorageEngineTest extends AbstractTestCase /** * Provider for testGetEngine * - * @return mixed[] + * @return array */ public static function providerGetEngine(): array { diff --git a/tests/unit/Table/ColumnsDefinitionTest.php b/tests/unit/Table/ColumnsDefinitionTest.php index c9f62e79b5..16fbb1fc28 100644 --- a/tests/unit/Table/ColumnsDefinitionTest.php +++ b/tests/unit/Table/ColumnsDefinitionTest.php @@ -221,7 +221,7 @@ class ColumnsDefinitionTest extends AbstractTestCase /** * test for ColumnsDefinition::decorateColumnMetaDefault * - * @phpstan-param array $expected + * @param array $expected */ #[DataProvider('providerColumnMetaDefault')] public function testDecorateColumnMetaDefault( @@ -237,7 +237,7 @@ class ColumnsDefinitionTest extends AbstractTestCase /** * Data provider for testDecorateColumnMetaDefault * - * @psalm-return array}> + * @return array}> */ public static function providerColumnMetaDefault(): array { diff --git a/tests/unit/Table/Maintenance/MessageTest.php b/tests/unit/Table/Maintenance/MessageTest.php index c438d2623a..87a900fa71 100644 --- a/tests/unit/Table/Maintenance/MessageTest.php +++ b/tests/unit/Table/Maintenance/MessageTest.php @@ -12,7 +12,7 @@ use PHPUnit\Framework\TestCase; #[CoversClass(Message::class)] class MessageTest extends TestCase { - /** @param mixed[] $row */ + /** @param array $row */ #[DataProvider('providerForTestFromArray')] public function testFromArray(array $row, string $table, string $operation, string $type, string $text): void { @@ -23,10 +23,7 @@ class MessageTest extends TestCase self::assertSame($message->text, $text); } - /** - * @return array|string>> - * @psalm-return array{mixed[], string, string, string, string}[] - */ + /** @return array{array, string, string, string, string}[] */ public static function providerForTestFromArray(): array { return [ diff --git a/tests/unit/TemplateTest.php b/tests/unit/TemplateTest.php index cf78c0b9cd..5e3588754c 100644 --- a/tests/unit/TemplateTest.php +++ b/tests/unit/TemplateTest.php @@ -57,7 +57,7 @@ class TemplateTest extends AbstractTestCase /** * Data provider for testSet * - * @return mixed[] + * @return array */ public static function providerTestSet(): array { @@ -83,7 +83,7 @@ class TemplateTest extends AbstractTestCase /** * Data provider for testDynamicRender * - * @return mixed[] + * @return array */ public static function providerTestDynamicRender(): array { @@ -117,7 +117,7 @@ class TemplateTest extends AbstractTestCase /** * Data provider for testSet * - * @return mixed[] + * @return array */ public static function providerTestRender(): array { diff --git a/tests/unit/Theme/ThemeTest.php b/tests/unit/Theme/ThemeTest.php index 956e5c84a8..2b3e26da07 100644 --- a/tests/unit/Theme/ThemeTest.php +++ b/tests/unit/Theme/ThemeTest.php @@ -218,7 +218,7 @@ class ThemeTest extends AbstractTestCase /** * Provider for testGetImgPath * - * @return mixed[] + * @return array */ public static function providerForGetImgPath(): array { diff --git a/tests/unit/Tracking/TrackerTest.php b/tests/unit/Tracking/TrackerTest.php index 3cde6bae55..d233825a1f 100644 --- a/tests/unit/Tracking/TrackerTest.php +++ b/tests/unit/Tracking/TrackerTest.php @@ -342,7 +342,7 @@ class TrackerTest extends AbstractTestCase /** * Data provider for testParseQuery * - * @return mixed[] Test data + * @return array> */ public static function parseQueryData(): array { diff --git a/tests/unit/Tracking/TrackingTest.php b/tests/unit/Tracking/TrackingTest.php index a44eba88d4..b463c747f1 100644 --- a/tests/unit/Tracking/TrackingTest.php +++ b/tests/unit/Tracking/TrackingTest.php @@ -659,8 +659,8 @@ class TrackingTest extends AbstractTestCase /** * Test for getTrackedData() * - * @param mixed[] $fetchArrayReturn Value to be returned by mocked fetchArray - * @param TrackedData $expected Expected value + * @param array $fetchArrayReturn Value to be returned by mocked fetchArray + * @param TrackedData $expected Expected value */ #[DataProvider('getTrackedDataProvider')] public function testGetTrackedData(array $fetchArrayReturn, TrackedData $expected): void @@ -695,35 +695,33 @@ class TrackingTest extends AbstractTestCase /** * Data provider for testGetTrackedData * - * @return mixed[] Test data + * @return iterable, TrackedData}> */ - public static function getTrackedDataProvider(): array + public static function getTrackedDataProvider(): iterable { $fetchArrayReturn = [ + 'schema_sql' => "# log 20-03-2013 23:33:58 user1\nstat1" . + "# log 20-03-2013 23:39:58 user2\n", + 'data_sql' => '# log ', + 'schema_snapshot' => 'dataschema', + 'tracking' => 'SELECT, DELETE', + ]; + + $data = new TrackedData( + '20-03-2013 23:33:58', + '20-03-2013 23:39:58', [ - 'schema_sql' => "# log 20-03-2013 23:33:58 user1\nstat1" . - "# log 20-03-2013 23:39:58 user2\n", - 'data_sql' => '# log ', - 'schema_snapshot' => 'dataschema', - 'tracking' => 'SELECT, DELETE', + ['date' => '20-03-2013 23:33:58', 'username' => 'user1', 'statement' => "\nstat1"], + ['date' => '20-03-2013 23:39:58', 'username' => 'user2', 'statement' => ''], ], - ]; + [], + 'SELECT, DELETE', + 'dataschema', + ); - $data = [ - new TrackedData( - '20-03-2013 23:33:58', - '20-03-2013 23:39:58', - [ - ['date' => '20-03-2013 23:33:58', 'username' => 'user1', 'statement' => "\nstat1"], - ['date' => '20-03-2013 23:39:58', 'username' => 'user2', 'statement' => ''], - ], - [], - 'SELECT, DELETE', - 'dataschema', - ), - ]; + yield [$fetchArrayReturn, $data]; - $fetchArrayReturn[1] = [ + $fetchArrayReturn = [ 'schema_sql' => "# log 20-03-2012 23:33:58 user1\n" . "# log 20-03-2012 23:39:58 user2\n", 'data_sql' => "# log 20-03-2013 23:33:58 user3\n" . @@ -732,7 +730,7 @@ class TrackingTest extends AbstractTestCase 'tracking' => 'SELECT, DELETE', ]; - $data[1] = new TrackedData( + $data = new TrackedData( '20-03-2012 23:33:58', '20-03-2013 23:39:58', [ @@ -747,6 +745,6 @@ class TrackingTest extends AbstractTestCase 'dataschema', ); - return [[$fetchArrayReturn[0], $data[0]], [$fetchArrayReturn[1], $data[1]]]; + yield [$fetchArrayReturn, $data]; } } diff --git a/tests/unit/TransformationsTest.php b/tests/unit/TransformationsTest.php index 64928b3202..e6299e75fa 100644 --- a/tests/unit/TransformationsTest.php +++ b/tests/unit/TransformationsTest.php @@ -46,8 +46,8 @@ class TransformationsTest extends AbstractTestCase /** * Test for parsing options. * - * @param string $input String to parse - * @param mixed[] $expected Expected result + * @param string $input String to parse + * @param string[] $expected Expected result */ #[DataProvider('getOptionsData')] public function testGetOptions(string $input, array $expected): void diff --git a/tests/unit/Triggers/TriggerTest.php b/tests/unit/Triggers/TriggerTest.php index 21afb3bf86..d818d15983 100644 --- a/tests/unit/Triggers/TriggerTest.php +++ b/tests/unit/Triggers/TriggerTest.php @@ -19,7 +19,7 @@ class TriggerTest extends TestCase self::assertNull(Trigger::tryFromArray([])); } - /** @param mixed[] $trigger */ + /** @param array $trigger */ #[DataProvider('arrayWithValidValuesProvider')] public function testTryFromArrayWithValidValues(array $trigger): void { @@ -33,7 +33,7 @@ class TriggerTest extends TestCase self::assertSame('definer@localhost', $actual->definer); } - /** @return iterable */ + /** @return iterable}> */ public static function arrayWithValidValuesProvider(): iterable { yield [ @@ -59,14 +59,14 @@ class TriggerTest extends TestCase ]; } - /** @param mixed[] $trigger */ + /** @param array $trigger */ #[DataProvider('arrayWithInvalidValuesProvider')] public function testTryFromArrayWithInvalidValues(array $trigger): void { self::assertNull(Trigger::tryFromArray($trigger)); } - /** @return iterable */ + /** @return iterable}> */ public static function arrayWithInvalidValuesProvider(): iterable { yield [ diff --git a/tests/unit/Twig/Node/Expression/TransExpressionTest.php b/tests/unit/Twig/Node/Expression/TransExpressionTest.php index 6a7a3e7787..f065df5ee5 100644 --- a/tests/unit/Twig/Node/Expression/TransExpressionTest.php +++ b/tests/unit/Twig/Node/Expression/TransExpressionTest.php @@ -27,7 +27,7 @@ final class TransExpressionTest extends AbstractTestCase self::assertSame($expected, $compiler->getSource()); } - /** @psalm-return iterable */ + /** @return iterable */ public static function transExpressionsProvider(): iterable { yield 't("Message")' => [[self::getConstantExpression('Message')], '\\_gettext("Message")']; @@ -150,7 +150,7 @@ final class TransExpressionTest extends AbstractTestCase (new TransExpression('t', new Node($arguments), 1))->compile($this->getCompiler()); } - /** @psalm-return iterable */ + /** @return iterable */ public static function transExpressionsWithErrorProvider(): iterable { yield 't()' => [[], 'Value for argument "message" must be a non-empty literal string at line 1.']; diff --git a/tests/unit/TwoFactorTest.php b/tests/unit/TwoFactorTest.php index 3a6a36e2f4..39695696c8 100644 --- a/tests/unit/TwoFactorTest.php +++ b/tests/unit/TwoFactorTest.php @@ -121,7 +121,7 @@ class TwoFactorTest extends AbstractTestCase return new TwoFactor($user); } - /** @param mixed[] $backendSettings */ + /** @param array $backendSettings */ private function loadQueriesForConfigure(string $backend, array $backendSettings = []): void { $this->dummyDbi->addResult( diff --git a/tests/unit/TypesByDatabaseVersionTest.php b/tests/unit/TypesByDatabaseVersionTest.php index ed0d48dea9..0c1b522c06 100644 --- a/tests/unit/TypesByDatabaseVersionTest.php +++ b/tests/unit/TypesByDatabaseVersionTest.php @@ -14,8 +14,8 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase { /** * @param TypeClass $class The class to get function list. - * @param array $includes Expected elements should contain in result - * @param array $excludes Expected elements should not contain in result + * @param string[] $includes Expected elements should contain in result + * @param string[] $excludes Expected elements should not contain in result * @phpstan-param array $includes * @phpstan-param array $excludes */ @@ -217,8 +217,8 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase } /** - * @param array $includes Expected elements should contain in result - * @param array $excludes Expected elements should not contain in result + * @param string[] $includes Expected elements should contain in result + * @param string[] $excludes Expected elements should not contain in result * @phpstan-param array $includes * @phpstan-param array $excludes */ @@ -247,7 +247,7 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase /** * Data provider for testing get all functions * - * @psalm-return array, array}> + * @return array, array}> */ public static function providerFortTestGetAllFunctions(): array { @@ -468,7 +468,7 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase ]; } - /** @phpstan-param array|string> $expected */ + /** @param array|string> $expected */ #[DataProvider('providerFortTestGetColumns')] public function testGetColumns(string $version, array $expected): void { @@ -482,7 +482,7 @@ final class TypesByDatabaseVersionTest extends AbstractTestCase /** * Data provider for testing test columns * - * @psalm-return array|string>}> + * @return array|string>}> */ public static function providerFortTestGetColumns(): array { diff --git a/tests/unit/UniqueConditionTest.php b/tests/unit/UniqueConditionTest.php index c8e861fff3..5ad1209757 100644 --- a/tests/unit/UniqueConditionTest.php +++ b/tests/unit/UniqueConditionTest.php @@ -254,9 +254,9 @@ class UniqueConditionTest extends AbstractTestCase * Test for new UniqueCondition * note: GROUP_FLAG = MYSQLI_NUM_FLAG = 32769 * - * @param FieldMetadata[] $meta Meta Information for Field - * @param array $row Current Ddata Row - * @param array $expected Expected Result + * @param FieldMetadata[] $meta Meta Information for Field + * @param int[]|string[] $row Current Ddata Row + * @param array[]|string[]|bool[] $expected Expected Result * @psalm-param array $row * @psalm-param array{string, bool, array} $expected */ diff --git a/tests/unit/UrlTest.php b/tests/unit/UrlTest.php index 3ad4a57037..9f144953f0 100644 --- a/tests/unit/UrlTest.php +++ b/tests/unit/UrlTest.php @@ -242,7 +242,7 @@ class UrlTest extends AbstractTestCase $property->setValue(null, null); } - /** @psalm-return array */ + /** @return array */ public static function getArgSeparatorProvider(): array { return [ diff --git a/tests/unit/UserPasswordTest.php b/tests/unit/UserPasswordTest.php index 2fb9dc957e..dacd0d0e2f 100644 --- a/tests/unit/UserPasswordTest.php +++ b/tests/unit/UserPasswordTest.php @@ -63,7 +63,7 @@ class UserPasswordTest extends AbstractTestCase ); } - /** @psalm-return array{0: bool, 1: Message, 2: bool, 3: string, 4: string}[] */ + /** @return array{0: bool, 1: Message, 2: bool, 3: string, 4: string}[] */ public static function providerSetChangePasswordMsg(): array { return [ diff --git a/tests/unit/UtilTest.php b/tests/unit/UtilTest.php index 396f75e515..b5ea3915d1 100644 --- a/tests/unit/UtilTest.php +++ b/tests/unit/UtilTest.php @@ -88,7 +88,7 @@ class UtilTest extends AbstractTestCase /** * Data Provider for testgetCharsetQueryPart * - * @return mixed[] test data + * @return string[][] test data */ public static function charsetQueryData(): array { @@ -137,7 +137,7 @@ class UtilTest extends AbstractTestCase /** * Provider for testConvertBitDefaultValue * - * @return mixed[] + * @return array */ public static function providerConvertBitDefaultValue(): array { @@ -204,8 +204,8 @@ class UtilTest extends AbstractTestCase /** * Test case for parsing SHOW COLUMNS output * - * @param string $in Column specification - * @param mixed[] $out Expected value + * @param string $in Column specification + * @param array $out Expected value */ #[DataProvider('providerExtractColumnSpec')] public function testExtractColumnSpec(string $in, array $out): void @@ -221,7 +221,7 @@ class UtilTest extends AbstractTestCase /** * Data provider for testExtractColumnSpec * - * @return mixed[] + * @return array}> */ public static function providerExtractColumnSpec(): array { @@ -486,7 +486,7 @@ class UtilTest extends AbstractTestCase /** * Data provider for testExtractValueFromFormattedSize * - * @return mixed[] + * @return array */ public static function providerExtractValueFromFormattedSize(): array { @@ -511,7 +511,7 @@ class UtilTest extends AbstractTestCase /** * format byte down data provider * - * @psalm-return list + * @return list */ public static function providerFormatByteDown(): array { @@ -538,7 +538,7 @@ class UtilTest extends AbstractTestCase ]; } - /** @psalm-param list{0: float|int|numeric-string, 1?: int, 2?: int, 3?: bool, 4?: bool} $arguments */ + /** @param list{0: float|int|numeric-string, 1?: int, 2?: int, 3?: bool, 4?: bool} $arguments */ #[DataProvider('providerFormatNumber')] public function testFormatNumber(string $expected, array $arguments): void { @@ -594,7 +594,7 @@ class UtilTest extends AbstractTestCase } } - /** @psalm-return array */ + /** @return array */ public static function providerFormatNumber(): array { return [ @@ -667,7 +667,7 @@ class UtilTest extends AbstractTestCase /** * Data provider for testGetFormattedMaximumUploadSize * - * @return mixed[] + * @return array */ public static function providerGetFormattedMaximumUploadSize(): array { @@ -759,7 +759,7 @@ class UtilTest extends AbstractTestCase /** * data provider for localised date test * - * @return mixed[] + * @return array */ public static function providerLocalisedDate(): array { @@ -836,7 +836,7 @@ class UtilTest extends AbstractTestCase /** * data provider for localised timestamp test * - * @return mixed[] + * @return array */ public static function providerTimespanFormat(): array { @@ -865,7 +865,7 @@ class UtilTest extends AbstractTestCase /** * data provider for printable bit value test * - * @return mixed[] + * @return array */ public static function providerPrintableBitValue(): array { @@ -893,7 +893,7 @@ class UtilTest extends AbstractTestCase /** * data provider for PhpMyAdmin\Util::unQuote test * - * @return mixed[] + * @return string[][] */ public static function providerUnQuote(): array { @@ -918,7 +918,7 @@ class UtilTest extends AbstractTestCase /** * data provider for PhpMyAdmin\Util::unQuote test with chosen quote * - * @return mixed[] + * @return string[][] */ public static function providerUnQuoteSelectedChar(): array { @@ -978,7 +978,7 @@ class UtilTest extends AbstractTestCase /** * data provider for PhpMyAdmin\Util::userDir test * - * @return mixed[] + * @return string[][] */ public static function providerUserDir(): array { @@ -1003,7 +1003,7 @@ class UtilTest extends AbstractTestCase /** * data provider for duplicate first newline test * - * @return mixed[] + * @return string[][] */ public static function providerDuplicateFirstNewline(): array { @@ -1034,7 +1034,7 @@ class UtilTest extends AbstractTestCase /** * Data provider for Util::isInteger test * - * @return mixed[] + * @return array */ public static function providerIsInteger(): array { @@ -1057,7 +1057,7 @@ class UtilTest extends AbstractTestCase /** * Data provider for Util::getProtoFromForwardedHeader test * - * @return mixed[] + * @return string[][] * * @source https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded MDN docs * @source https://www.nginx.com/resources/wiki/start/topics/examples/forwarded/ Nginx docs @@ -1430,8 +1430,7 @@ SQL; /** * Data provider for isUUIDSupported() tests. * - * @return mixed[] - * @psalm-return array + * @return array */ public static function provideForTestIsUUIDSupported(): array { @@ -1510,8 +1509,8 @@ SQL; } /** - * @param mixed[] $array - * @param (string|int)[] $path + * @param string[]|string[][] $array + * @param string[] $path */ #[DataProvider('providerForTestGetValueByKey')] public function testGetValueByKey(mixed $expected, array $array, array $path, mixed $default = null): void @@ -1519,7 +1518,7 @@ SQL; self::assertSame($expected, Util::getValueByKey($array, $path, $default)); } - /** @return iterable */ + /** @return iterable */ public static function providerForTestGetValueByKey(): iterable { yield 'array_has_all_keys' => [ diff --git a/tests/unit/Utils/ForeignKeyTest.php b/tests/unit/Utils/ForeignKeyTest.php index 395426324c..fe2bbe6336 100644 --- a/tests/unit/Utils/ForeignKeyTest.php +++ b/tests/unit/Utils/ForeignKeyTest.php @@ -39,7 +39,7 @@ class ForeignKeyTest extends AbstractTestCase /** * data provider for foreign key supported test * - * @return mixed[] + * @return array */ public static function providerIsSupported(): array { diff --git a/tests/unit/Utils/FormatConverterTest.php b/tests/unit/Utils/FormatConverterTest.php index a7459a75a6..ddaf94ebd3 100644 --- a/tests/unit/Utils/FormatConverterTest.php +++ b/tests/unit/Utils/FormatConverterTest.php @@ -31,7 +31,7 @@ class FormatConverterTest extends AbstractTestCase /** * Data provider for binaryToIp * - * @return mixed[] + * @return array */ public static function providerBinaryToIp(): array { @@ -66,7 +66,7 @@ class FormatConverterTest extends AbstractTestCase /** * Data provider for ipToBinary * - * @return mixed[] + * @return string[][] */ public static function providerIpToBinary(): array { @@ -75,9 +75,6 @@ class FormatConverterTest extends AbstractTestCase /** * Test for ipToLong - * - * @param string $expected Expected result given an input - * @param string $input Input to convert */ #[DataProvider('providerIpToLong')] public function testIpToLong(string|int $expected, string $input): void @@ -89,7 +86,7 @@ class FormatConverterTest extends AbstractTestCase /** * Data provider for ipToLong * - * @return mixed[] + * @return array */ public static function providerIpToLong(): array { diff --git a/tests/unit/Utils/GisTest.php b/tests/unit/Utils/GisTest.php index 90ef1b35ba..7d05da9340 100644 --- a/tests/unit/Utils/GisTest.php +++ b/tests/unit/Utils/GisTest.php @@ -24,10 +24,10 @@ class GisTest extends AbstractTestCase } /** - * @param string $expectedQuery The query to expect - * @param mixed[] $returnData The data to return for fetchRow - * @param bool $SRIDOption Use the SRID option or not - * @param int $mysqlVersion The mysql version to return for getVersion + * @param string $expectedQuery The query to expect + * @param string[] $returnData The data to return for fetchRow + * @param bool $SRIDOption Use the SRID option or not + * @param int $mysqlVersion The mysql version to return for getVersion */ #[DataProvider('providerConvertToWellKnownText')] public function testConvertToWellKnownText( diff --git a/tests/unit/VersionInformationTest.php b/tests/unit/VersionInformationTest.php index a78348c3cc..5027ec4317 100644 --- a/tests/unit/VersionInformationTest.php +++ b/tests/unit/VersionInformationTest.php @@ -76,7 +76,7 @@ class VersionInformationTest extends AbstractTestCase /** * Data provider for version parsing * - * @return mixed[] + * @return array */ public static function dataVersions(): array { diff --git a/tests/unit/WebAuthn/CBORDecoderTest.php b/tests/unit/WebAuthn/CBORDecoderTest.php index 1a9a40dc5a..6a08e50f1a 100644 --- a/tests/unit/WebAuthn/CBORDecoderTest.php +++ b/tests/unit/WebAuthn/CBORDecoderTest.php @@ -29,7 +29,7 @@ class CBORDecoderTest extends TestCase self::assertSame($expected, $decoder->decode(new DataStream($data))); } - /** @psalm-return iterable */ + /** @return iterable */ public static function dataProviderForTestDecode(): iterable { return [ @@ -164,7 +164,7 @@ class CBORDecoderTest extends TestCase $decoder->decode(new DataStream($data)); } - /** @psalm-return iterable */ + /** @return iterable */ public static function indefiniteLengthValuesProvider(): iterable { return [