From fcc638186d286ff2d549e65ac74507a7e5005831 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 16 May 2024 09:22:37 +0200 Subject: [PATCH 1/5] PHPStan 1.11.1 (#6399) --- composer.json | 4 ++-- phpstan.neon.dist | 6 +++--- src/Result.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 81e0d702518..ab12807dace 100644 --- a/composer.json +++ b/composer.json @@ -43,8 +43,8 @@ "doctrine/coding-standard": "12.0.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2023.1", - "phpstan/phpstan": "1.10.67", - "phpstan/phpstan-strict-rules": "^1.5", + "phpstan/phpstan": "1.11.1", + "phpstan/phpstan-strict-rules": "^1.6", "phpunit/phpunit": "9.6.19", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 3074c054646..9c3b2389430 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,14 +1,14 @@ parameters: level: 8 - phpVersion: 80200 + phpVersion: 80300 paths: - src - static-analysis treatPhpDocTypesAsCertain: false reportUnmatchedIgnoredErrors: false - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false ignoreErrors: + - identifier: missingType.generics + # https://github.com/doctrine/dbal/pull/3836 # TODO: remove in 4.0.0 - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array, array given\.\z~' diff --git a/src/Result.php b/src/Result.php index fdc7daa94d6..9de52c293fc 100644 --- a/src/Result.php +++ b/src/Result.php @@ -184,7 +184,7 @@ public function iterateAssociative(): Traversable } /** - * {@inheritDoc} + * @return Traversable> * * @throws Exception */ From 15500588d3b7c34dc47059392cbcc297fd13d276 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 16 May 2024 09:23:34 +0200 Subject: [PATCH 2/5] PHPUnit 10.5.20 (#6400) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e660699ab8a..dbbe361420c 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "phpstan/phpstan": "1.10.67", "phpstan/phpstan-phpunit": "1.3.16", "phpstan/phpstan-strict-rules": "^1.5", - "phpunit/phpunit": "10.5.9", + "phpunit/phpunit": "10.5.20", "psalm/plugin-phpunit": "0.18.4", "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.9.2", From 85130ccb6d4ee00c7a8862fed09a80ee17c1da19 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 16 May 2024 09:25:39 +0200 Subject: [PATCH 3/5] Psalm 5.24.0 (#6401) --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index dbbe361420c..172173c86d8 100644 --- a/composer.json +++ b/composer.json @@ -44,12 +44,12 @@ "phpstan/phpstan-phpunit": "1.3.16", "phpstan/phpstan-strict-rules": "^1.5", "phpunit/phpunit": "10.5.20", - "psalm/plugin-phpunit": "0.18.4", + "psalm/plugin-phpunit": "0.19.0", "slevomat/coding-standard": "8.13.1", "squizlabs/php_codesniffer": "3.9.2", "symfony/cache": "^6.3.8|^7.0", "symfony/console": "^5.4|^6.3|^7.0", - "vimeo/psalm": "5.21.1" + "vimeo/psalm": "5.24.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." From 3d1041bdeee6e7629215cf141701e2e57a8a8cae Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 16 May 2024 09:49:35 +0200 Subject: [PATCH 4/5] Fix return type of iterateKeyValue() (#6402) | Q | A |------------- | ----------- | Type | bug | Fixed issues | N/A #### Summary I messed this up in #6399. We cannot make any assumptions regarding key and value here. --- src/Result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Result.php b/src/Result.php index 9de52c293fc..92235d0643a 100644 --- a/src/Result.php +++ b/src/Result.php @@ -184,7 +184,7 @@ public function iterateAssociative(): Traversable } /** - * @return Traversable> + * @return Traversable * * @throws Exception */ From b36ede02a84f369d0c84a12e1dec293803739c33 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 16 May 2024 10:14:30 +0200 Subject: [PATCH 5/5] Fix iterable type errors --- phpstan.neon.dist | 1 - src/Portability/Converter.php | 2 +- tests/Functional/Types/JsonTest.php | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index c200fee0103..7649943adf0 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -9,7 +9,6 @@ parameters: reportUnmatchedIgnoredErrors: false ignoreErrors: - identifier: missingType.generics - - identifier: missingType.iterableValue # https://github.com/phpstan/phpstan-strict-rules/issues/103 - diff --git a/src/Portability/Converter.php b/src/Portability/Converter.php index ae117720281..09a4712b7cd 100644 --- a/src/Portability/Converter.php +++ b/src/Portability/Converter.php @@ -244,7 +244,7 @@ private function createConvertAll(?Closure $function): Closure * * @param Closure $function The function that maps each value of the array * - * @return Closure(array):array + * @return Closure(array):array */ private function createMapper(Closure $function): Closure { diff --git a/tests/Functional/Types/JsonTest.php b/tests/Functional/Types/JsonTest.php index 6bf150fe1c5..45dc42434a8 100644 --- a/tests/Functional/Types/JsonTest.php +++ b/tests/Functional/Types/JsonTest.php @@ -59,7 +59,7 @@ public function testInsertAndSelect(): void self::assertSame($value2, $res2); } - /** @param array $value */ + /** @param array $value */ private function insert(int $id, array $value): void { $result = $this->connection->insert('json_test_table', [ @@ -73,7 +73,7 @@ private function insert(int $id, array $value): void self::assertSame(1, $result); } - /** @return array */ + /** @return array */ private function select(int $id): array { $value = $this->connection->fetchOne(