From e127bef5e86beada6a7a2f08d3385cc155a271cd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 00:53:04 +0000 Subject: [PATCH 1/5] Update PHPStan packages to v2.0.6 --- composer.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.lock b/composer.lock index 8905f1ca3f..8d253b4163 100644 --- a/composer.lock +++ b/composer.lock @@ -4874,16 +4874,16 @@ }, { "name": "phpstan/phpstan-nette", - "version": "2.0.4", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-nette.git", - "reference": "9b629867b8e13e0afad8c8537b6541230d7b6a38" + "reference": "aa6c413df9587c355a744c3a84ecf9736987b607" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-nette/zipball/9b629867b8e13e0afad8c8537b6541230d7b6a38", - "reference": "9b629867b8e13e0afad8c8537b6541230d7b6a38", + "url": "https://api.github.com/repos/phpstan/phpstan-nette/zipball/aa6c413df9587c355a744c3a84ecf9736987b607", + "reference": "aa6c413df9587c355a744c3a84ecf9736987b607", "shasum": "" }, "require": { @@ -4930,9 +4930,9 @@ "description": "Nette Framework class reflection extension for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-nette/issues", - "source": "https://github.com/phpstan/phpstan-nette/tree/2.0.4" + "source": "https://github.com/phpstan/phpstan-nette/tree/2.0.6" }, - "time": "2025-06-17T13:26:39+00:00" + "time": "2025-09-19T19:54:10+00:00" }, { "name": "phpstan/phpstan-phpunit", @@ -4990,21 +4990,21 @@ }, { "name": "phpstan/phpstan-strict-rules", - "version": "2.0.6", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "f9f77efa9de31992a832ff77ea52eb42d675b094" + "reference": "d6211c46213d4181054b3d77b10a5c5cb0d59538" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/f9f77efa9de31992a832ff77ea52eb42d675b094", - "reference": "f9f77efa9de31992a832ff77ea52eb42d675b094", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/d6211c46213d4181054b3d77b10a5c5cb0d59538", + "reference": "d6211c46213d4181054b3d77b10a5c5cb0d59538", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.0.4" + "phpstan/phpstan": "^2.1.29" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", @@ -5032,9 +5032,9 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.6" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.7" }, - "time": "2025-07-21T12:19:29+00:00" + "time": "2025-09-26T11:19:08+00:00" }, { "name": "phpunit/php-code-coverage", From 7b71575a92188160da6550711bb3bc02c9587273 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 9 Dec 2025 07:18:52 +0100 Subject: [PATCH 2/5] fix --- tests/PHPStan/Analyser/NodeScopeResolverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PHPStan/Analyser/NodeScopeResolverTest.php b/tests/PHPStan/Analyser/NodeScopeResolverTest.php index c08efc1a78..43cfa13eae 100644 --- a/tests/PHPStan/Analyser/NodeScopeResolverTest.php +++ b/tests/PHPStan/Analyser/NodeScopeResolverTest.php @@ -276,7 +276,7 @@ public function testFile(string $file): void $actual = $args[3]; if ($expected !== $actual) { - $failures[] = sprintf("Line %d:\nExpected: %s\nActual: %s\n", $args[4], $expected, $actual); + $failures[] = sprintf("Line %d:\nExpected: %s\nActual: %s\n", $args[4], (string) $expected, $actual); } } elseif ($args[0] === 'variableCertainty') { $file = $args[1]; From d3f3e2c19f88c348f9f2aab2493ea39ddb0e3bbe Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 9 Dec 2025 07:30:37 +0100 Subject: [PATCH 3/5] fix php7 error --- stubs/ReflectionClass.stub | 5 +++++ stubs/ReflectionClassWithLazyObjects.stub | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/stubs/ReflectionClass.stub b/stubs/ReflectionClass.stub index 06f8e08a2e..fc751cee66 100644 --- a/stubs/ReflectionClass.stub +++ b/stubs/ReflectionClass.stub @@ -23,6 +23,11 @@ class ReflectionClass */ public function getName() : string; + /** + * @return non-empty-string + */ + public function getShortName() : string; + /** * @param mixed ...$args * diff --git a/stubs/ReflectionClassWithLazyObjects.stub b/stubs/ReflectionClassWithLazyObjects.stub index 1a53ae8750..a840f5247b 100644 --- a/stubs/ReflectionClassWithLazyObjects.stub +++ b/stubs/ReflectionClassWithLazyObjects.stub @@ -23,6 +23,11 @@ class ReflectionClass */ public function getName() : string; + /** + * @return non-empty-string + */ + public function getShortName() : string; + /** * @param mixed ...$args * From 273066918b4508cc91075511a54f4704c237b3e9 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 9 Dec 2025 08:17:35 +0100 Subject: [PATCH 4/5] ignore substr() errors --- build/baseline-7.4.neon | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build/baseline-7.4.neon b/build/baseline-7.4.neon index b28b9f9f5d..7ba9306b5f 100644 --- a/build/baseline-7.4.neon +++ b/build/baseline-7.4.neon @@ -77,3 +77,18 @@ parameters: message: "#^Class PHPStan\\\\Reflection\\\\BetterReflection\\\\SourceLocator\\\\CachingVisitor has an uninitialized property \\$constantNodes\\. Give it default value or assign it in the constructor\\.$#" count: 1 path: ../src/Reflection/BetterReflection/SourceLocator/CachingVisitor.php + + - + message: '#^Parameter \#3 of function sprintf is expected to be string by placeholder \#2 \("%%s"\), string\|false given\.$#' + count: 1 + path: ../src/Cache/FileCacheStorage.php + + - + message: '#^Parameter \#3 of function sprintf is expected to be string by placeholder \#2 \("%%s"\), string\|false given\.$#' + count: 1 + path: ../src/Rules/Cast/InvalidCastRule.php + + - + message: '#^Parameter \#2 of function sprintf is expected to be string by placeholder \#1 \("%%s"\), string\|false given\.$#' + count: 1 + path: ../src/Rules/ClassForbiddenNameCheck.php From 5c90f242bfb8cf38235d9504e3f17dbd02182eb4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 9 Dec 2025 08:25:09 +0100 Subject: [PATCH 5/5] move ignores --- build/baseline-7.4.neon | 15 --------------- build/baseline-pre-8.0.neon | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build/baseline-7.4.neon b/build/baseline-7.4.neon index 7ba9306b5f..b28b9f9f5d 100644 --- a/build/baseline-7.4.neon +++ b/build/baseline-7.4.neon @@ -77,18 +77,3 @@ parameters: message: "#^Class PHPStan\\\\Reflection\\\\BetterReflection\\\\SourceLocator\\\\CachingVisitor has an uninitialized property \\$constantNodes\\. Give it default value or assign it in the constructor\\.$#" count: 1 path: ../src/Reflection/BetterReflection/SourceLocator/CachingVisitor.php - - - - message: '#^Parameter \#3 of function sprintf is expected to be string by placeholder \#2 \("%%s"\), string\|false given\.$#' - count: 1 - path: ../src/Cache/FileCacheStorage.php - - - - message: '#^Parameter \#3 of function sprintf is expected to be string by placeholder \#2 \("%%s"\), string\|false given\.$#' - count: 1 - path: ../src/Rules/Cast/InvalidCastRule.php - - - - message: '#^Parameter \#2 of function sprintf is expected to be string by placeholder \#1 \("%%s"\), string\|false given\.$#' - count: 1 - path: ../src/Rules/ClassForbiddenNameCheck.php diff --git a/build/baseline-pre-8.0.neon b/build/baseline-pre-8.0.neon index be90d68ad1..5d195f2e84 100644 --- a/build/baseline-pre-8.0.neon +++ b/build/baseline-pre-8.0.neon @@ -113,3 +113,18 @@ parameters: identifier: parameter.phpDocType count: 1 path: ../src/Reflection/ClassReflectionFactory.php + + - + message: '#^Parameter \#3 of function sprintf is expected to be string by placeholder \#2 \("%%s"\), string\|false given\.$#' + count: 1 + path: ../src/Cache/FileCacheStorage.php + + - + message: '#^Parameter \#3 of function sprintf is expected to be string by placeholder \#2 \("%%s"\), string\|false given\.$#' + count: 1 + path: ../src/Rules/Cast/InvalidCastRule.php + + - + message: '#^Parameter \#2 of function sprintf is expected to be string by placeholder \#1 \("%%s"\), string\|false given\.$#' + count: 1 + path: ../src/Rules/ClassForbiddenNameCheck.php