From 4b3428e23005add66f83455a54cf851ed807a72c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 21:15:59 +0000 Subject: [PATCH] Update PHPStan packages --- tools/.phpstan/composer.json | 4 +- tools/.phpstan/composer.lock | 34 ++--- tools/.phpstan/vendor/composer/installed.json | 36 ++--- tools/.phpstan/vendor/composer/installed.php | 16 +- .../ergebnis/phpstan-rules/CHANGELOG.md | 15 +- .../vendor/ergebnis/phpstan-rules/README.md | 2 + .../ergebnis/phpstan-rules/composer.json | 6 +- .../Rules/PHPUnit/EmptyDataProviderRule.php | 2 +- .../PHPUnit/ShouldCallParentMethodsRule.php | 140 ++++++++++++++---- 9 files changed, 172 insertions(+), 83 deletions(-) diff --git a/tools/.phpstan/composer.json b/tools/.phpstan/composer.json index 87a63d270..6c5050a3e 100644 --- a/tools/.phpstan/composer.json +++ b/tools/.phpstan/composer.json @@ -2,9 +2,9 @@ "require-dev": { "phpstan/phpstan": "^2.3.7", "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan-phpunit": "^2.1.2", + "phpstan/phpstan-phpunit": "^2.1.3", "phpstan/phpstan-strict-rules": "^2.1.2", - "ergebnis/phpstan-rules": "^2.18.0", + "ergebnis/phpstan-rules": "^2.19.0", "phpstan/phpstan-deprecation-rules": "^2.0.6" }, "config": { diff --git a/tools/.phpstan/composer.lock b/tools/.phpstan/composer.lock index f7c853f5f..b4442e2e9 100644 --- a/tools/.phpstan/composer.lock +++ b/tools/.phpstan/composer.lock @@ -4,34 +4,34 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9e9e8cbf5830bbc310fc84d6198151fe", + "content-hash": "b8ecbe315754223ab890097f08a213b9", "packages": [], "packages-dev": [ { "name": "ergebnis/phpstan-rules", - "version": "2.18.0", + "version": "2.19.0", "source": { "type": "git", "url": "https://github.com/ergebnis/phpstan-rules.git", - "reference": "f8014018e83ee4afbe6a72a529622d1524749c7f" + "reference": "538387f06e6a444669e242df45b2d68b3dc0682a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/f8014018e83ee4afbe6a72a529622d1524749c7f", - "reference": "f8014018e83ee4afbe6a72a529622d1524749c7f", + "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/538387f06e6a444669e242df45b2d68b3dc0682a", + "reference": "538387f06e6a444669e242df45b2d68b3dc0682a", "shasum": "" }, "require": { "composer-runtime-api": "^2.0.0", "ergebnis/version": "^1.4.0", "ext-mbstring": "*", - "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0 || ~8.7.0", "phpstan/phpstan": "^2.1.35" }, "require-dev": { "codeception/codeception": "^4.0.0 || ^5.0.0", "doctrine/orm": "^2.20.0 || ^3.3.0", - "ergebnis/composer-normalize": "^2.56.1", + "ergebnis/composer-normalize": "^2.57.0", "ergebnis/license": "^2.9.0", "ergebnis/php-cs-fixer-config": "^6.64.3", "ergebnis/phpunit-slow-test-detector": "^2.27.0", @@ -55,7 +55,7 @@ ] }, "branch-alias": { - "dev-main": "2.18-dev" + "dev-main": "2.19-dev" } }, "autoload": { @@ -85,8 +85,8 @@ "security": "https://github.com/ergebnis/phpstan-rules/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/phpstan-rules" }, - "time": "2026-11-19T13:18:51+00:00", - "published-time": "2026-11-19T13:18:57+00:00" + "time": "2026-11-24T15:49:29+00:00", + "published-time": "2026-11-24T15:49:35+00:00" }, { "name": "ergebnis/version", @@ -386,16 +386,16 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "2.1.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "ffff35d4f96c4642d7f41a3515d90afa0f58be62" + "reference": "3912977f00552c85adcf7ca0960e49bdce95b36f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/ffff35d4f96c4642d7f41a3515d90afa0f58be62", - "reference": "ffff35d4f96c4642d7f41a3515d90afa0f58be62", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/3912977f00552c85adcf7ca0960e49bdce95b36f", + "reference": "3912977f00552c85adcf7ca0960e49bdce95b36f", "shasum": "" }, "require": { @@ -438,10 +438,10 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.1.2" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.1.3" }, - "time": "2026-11-12T15:27:53+00:00", - "published-time": "2026-11-12T16:07:51+00:00" + "time": "2026-11-24T08:18:33+00:00", + "published-time": "2026-11-24T20:17:22+00:00" }, { "name": "phpstan/phpstan-strict-rules", diff --git a/tools/.phpstan/vendor/composer/installed.json b/tools/.phpstan/vendor/composer/installed.json index c07dcc7a6..99dfc8fa3 100644 --- a/tools/.phpstan/vendor/composer/installed.json +++ b/tools/.phpstan/vendor/composer/installed.json @@ -2,30 +2,30 @@ "packages": [ { "name": "ergebnis/phpstan-rules", - "version": "2.18.0", - "version_normalized": "2.18.0.0", + "version": "2.19.0", + "version_normalized": "2.19.0.0", "source": { "type": "git", "url": "https://github.com/ergebnis/phpstan-rules.git", - "reference": "f8014018e83ee4afbe6a72a529622d1524749c7f" + "reference": "538387f06e6a444669e242df45b2d68b3dc0682a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/f8014018e83ee4afbe6a72a529622d1524749c7f", - "reference": "f8014018e83ee4afbe6a72a529622d1524749c7f", + "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/538387f06e6a444669e242df45b2d68b3dc0682a", + "reference": "538387f06e6a444669e242df45b2d68b3dc0682a", "shasum": "" }, "require": { "composer-runtime-api": "^2.0.0", "ergebnis/version": "^1.4.0", "ext-mbstring": "*", - "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0 || ~8.7.0", "phpstan/phpstan": "^2.1.35" }, "require-dev": { "codeception/codeception": "^4.0.0 || ^5.0.0", "doctrine/orm": "^2.20.0 || ^3.3.0", - "ergebnis/composer-normalize": "^2.56.1", + "ergebnis/composer-normalize": "^2.57.0", "ergebnis/license": "^2.9.0", "ergebnis/php-cs-fixer-config": "^6.64.3", "ergebnis/phpunit-slow-test-detector": "^2.27.0", @@ -41,8 +41,8 @@ "symfony/finder": "^5.4.45", "symfony/process": "^5.4.51" }, - "time": "2026-11-19T13:18:51+00:00", - "published-time": "2026-11-19T13:18:57+00:00", + "time": "2026-11-24T15:49:29+00:00", + "published-time": "2026-11-24T15:49:35+00:00", "type": "phpstan-extension", "extra": { "phpstan": { @@ -51,7 +51,7 @@ ] }, "branch-alias": { - "dev-main": "2.18-dev" + "dev-main": "2.19-dev" } }, "installation-source": "dist", @@ -395,17 +395,17 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "2.1.2", - "version_normalized": "2.1.2.0", + "version": "2.1.3", + "version_normalized": "2.1.3.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "ffff35d4f96c4642d7f41a3515d90afa0f58be62" + "reference": "3912977f00552c85adcf7ca0960e49bdce95b36f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/ffff35d4f96c4642d7f41a3515d90afa0f58be62", - "reference": "ffff35d4f96c4642d7f41a3515d90afa0f58be62", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/3912977f00552c85adcf7ca0960e49bdce95b36f", + "reference": "3912977f00552c85adcf7ca0960e49bdce95b36f", "shasum": "" }, "require": { @@ -424,8 +424,8 @@ "phpunit/phpunit": "^9.6", "shipmonk/name-collision-detector": "^2.1" }, - "time": "2026-11-12T15:27:53+00:00", - "published-time": "2026-11-12T16:07:51+00:00", + "time": "2026-11-24T08:18:33+00:00", + "published-time": "2026-11-24T20:17:22+00:00", "type": "phpstan-extension", "extra": { "phpstan": { @@ -451,7 +451,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.1.2" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.1.3" }, "install-path": "../phpstan/phpstan-phpunit" }, diff --git a/tools/.phpstan/vendor/composer/installed.php b/tools/.phpstan/vendor/composer/installed.php index 9b93ba42e..521f7dd69 100644 --- a/tools/.phpstan/vendor/composer/installed.php +++ b/tools/.phpstan/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'd1e64968ad5248995a1188c7838a17693e5a573a', + 'reference' => '473a9dadf7a882d6faba49575b975263348040a6', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,16 +13,16 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'd1e64968ad5248995a1188c7838a17693e5a573a', + 'reference' => '473a9dadf7a882d6faba49575b975263348040a6', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'ergebnis/phpstan-rules' => array( - 'pretty_version' => '2.18.0', - 'version' => '2.18.0.0', - 'reference' => 'f8014018e83ee4afbe6a72a529622d1524749c7f', + 'pretty_version' => '2.19.0', + 'version' => '2.19.0.0', + 'reference' => '538387f06e6a444669e242df45b2d68b3dc0682a', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../ergebnis/phpstan-rules', 'aliases' => array(), @@ -74,9 +74,9 @@ 'dev_requirement' => true, ), 'phpstan/phpstan-phpunit' => array( - 'pretty_version' => '2.1.2', - 'version' => '2.1.2.0', - 'reference' => 'ffff35d4f96c4642d7f41a3515d90afa0f58be62', + 'pretty_version' => '2.1.3', + 'version' => '2.1.3.0', + 'reference' => '3912977f00552c85adcf7ca0960e49bdce95b36f', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../phpstan/phpstan-phpunit', 'aliases' => array(), diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md b/tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md index 2f0a9798b..531ae1ea3 100644 --- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md +++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md @@ -6,7 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased -For a full diff see [`2.18.0...main`][2.18.0...main]. +For a full diff see [`2.19.0...main`][2.19.0...main]. + +## [`2.19.0`][2.19.0] + +For a full diff see [`2.18.0...2.19.0`][2.18.0...2.19.0]. + +### Changed + +- Allowed installation on PHP 8.7 ([#1192]), by [@localheinz] ## [`2.18.0`][2.18.0] @@ -764,7 +772,9 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0]. [2.17.1]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.17.1 [2.17.1...2.18.0]: https://github.com/ergebnis/phpstan-rules/compare/2.17.1...2.18.0 [2.18.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.18.0 -[2.18.0...main]: https://github.com/ergebnis/phpstan-rules/compare/2.18.0...main +[2.18.0...2.19.0]: https://github.com/ergebnis/phpstan-rules/compare/2.18.0...2.19.0 +[2.19.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.19.0 +[2.19.0...main]: https://github.com/ergebnis/phpstan-rules/compare/2.19.0...main [#1]: https://github.com/ergebnis/phpstan-rules/pull/1 [#4]: https://github.com/ergebnis/phpstan-rules/pull/4 @@ -890,6 +900,7 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0]. [#1169]: https://github.com/ergebnis/phpstan-rules/pull/1169 [#1182]: https://github.com/ergebnis/phpstan-rules/pull/1182 [#1186]: https://github.com/ergebnis/phpstan-rules/pull/1186 +[#1192]: https://github.com/ergebnis/phpstan-rules/pull/1192 [@alfredbez]: https://github.com/alfredbez [@cosmastech]: https://github.com/cosmastech diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md b/tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md index 05ae6859e..472b79729 100644 --- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md +++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md @@ -388,6 +388,8 @@ This project currently supports the following PHP versions: - [PHP 8.5](https://www.php.net/releases/#8.5.0) - [PHP 8.6](https://www.php.net/releases/#8.6.0) +The maintainers of this project _may_ allow installation on a PHP version as soon as they become aware of it, but do not support it before its initial release. + The maintainers of this project add support for a PHP version following its initial release and _may_ drop support for a PHP version when it has reached its [end of life](https://www.php.net/supported-versions.php). ## Security Policy diff --git a/tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json b/tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json index 69e2163cc..add28f811 100644 --- a/tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json +++ b/tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json @@ -21,7 +21,7 @@ "security": "https://github.com/ergebnis/phpstan-rules/blob/main/.github/SECURITY.md" }, "require": { - "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0 || ~8.7.0", "ext-mbstring": "*", "composer-runtime-api": "^2.0.0", "ergebnis/version": "^1.4.0", @@ -30,7 +30,7 @@ "require-dev": { "codeception/codeception": "^4.0.0 || ^5.0.0", "doctrine/orm": "^2.20.0 || ^3.3.0", - "ergebnis/composer-normalize": "^2.56.1", + "ergebnis/composer-normalize": "^2.57.0", "ergebnis/license": "^2.9.0", "ergebnis/php-cs-fixer-config": "^6.64.3", "ergebnis/phpunit-slow-test-detector": "^2.27.0", @@ -73,7 +73,7 @@ }, "extra": { "branch-alias": { - "dev-main": "2.18-dev" + "dev-main": "2.19-dev" }, "phpstan": { "includes": [ diff --git a/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/EmptyDataProviderRule.php b/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/EmptyDataProviderRule.php index a0511272b..ac01dd3f5 100644 --- a/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/EmptyDataProviderRule.php +++ b/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/EmptyDataProviderRule.php @@ -63,7 +63,7 @@ public function processNode(Node $node, Scope $scope): array foreach ($returnStatements as $returnStatement) { $returnExpr = $returnStatement->getReturnNode()->expr; if ($returnExpr === null) { - return []; + continue; } $returnType = $returnStatement->getScope()->getType($returnExpr); diff --git a/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/ShouldCallParentMethodsRule.php b/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/ShouldCallParentMethodsRule.php index bfd316906..7f3d082f5 100644 --- a/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/ShouldCallParentMethodsRule.php +++ b/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/ShouldCallParentMethodsRule.php @@ -3,11 +3,19 @@ namespace PHPStan\Rules\PHPUnit; use PhpParser\Node; +use PhpParser\Node\Stmt\ClassMethod; +use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; +use PhpParser\NodeVisitorAbstract; use PHPStan\Analyser\Scope; use PHPStan\Node\InClassMethodNode; use PHPStan\Rules\Rule; use PHPStan\Rules\RuleErrorBuilder; use PHPUnit\Framework\TestCase; +use function array_pop; +use function array_splice; +use function count; +use function end; use function in_array; use function sprintf; use function strtolower; @@ -51,58 +59,126 @@ public function processNode(Node $node, Scope $scope): array return []; } - $hasParentCall = $this->hasParentClassCall($node->getOriginalNode()->getStmts(), strtolower($methodName)); + $stmts = $node->getOriginalNode()->getStmts() ?? []; + if ($this->hasParentClassCall($stmts, strtolower($methodName))) { + return []; + } + + $errorBuilder = RuleErrorBuilder::message( + sprintf('Missing call to parent::%s() method.', $methodName), + )->identifier('phpunit.callParent'); + + if ($scope->isInTrait()) { + return [$errorBuilder->build()]; + } - if (!$hasParentCall) { - return [ - RuleErrorBuilder::message( - sprintf('Missing call to parent::%s() method.', $methodName), - )->identifier('phpunit.callParent')->build(), - ]; + $position = $this->getParentCallPosition($stmts, $methodName); + if ($position === null) { + return [$errorBuilder->build()]; } - return []; + $parentMethodName = $parentMethod->getName(); + $errorBuilder->fixNode($node->getOriginalNode(), static function (ClassMethod $methodNode) use ($position, $parentMethodName): ClassMethod { + $stmts = $methodNode->stmts ?? []; + array_splice($stmts, $position, 0, [ + new Node\Stmt\Expression( + new Node\Expr\StaticCall(new Node\Name('parent'), new Node\Identifier($parentMethodName)), + ), + ]); + $methodNode->stmts = $stmts; + + return $methodNode; + }); + + return [$errorBuilder->build()]; } /** - * @param Node\Stmt[]|null $stmts + * @param Node\Stmt[] $stmts + */ + private function hasParentClassCall(array $stmts, string $methodName): bool + { + return $this->findInMethodScope($stmts, static fn (Node $node): bool => $node instanceof Node\Expr\StaticCall + && !$node->isFirstClassCallable() + && $node->class instanceof Node\Name + && $node->class->toLowerString() === 'parent' + && $node->name instanceof Node\Identifier + && $node->name->toLowerString() === $methodName) !== []; + } + + /** + * setUp() gets the parent call as its first statement, tearDown() as its last one + * (before a trailing return). A tearDown() with an early return or with a throw + * is not fixable, because the appended call would be skipped on that path. * + * @param Node\Stmt[] $stmts */ - private function hasParentClassCall(?array $stmts, string $methodName): bool + private function getParentCallPosition(array $stmts, string $methodName): ?int { - if ($stmts === null) { - return false; + if (strtolower($methodName) === 'setup') { + return 0; } - foreach ($stmts as $stmt) { - if (! $stmt instanceof Node\Stmt\Expression) { - continue; - } + $position = count($stmts); + $exits = $this->findInMethodScope($stmts, static fn (Node $node): bool => $node instanceof Node\Stmt\Return_ || $node instanceof Node\Expr\Throw_); - if (! $stmt->expr instanceof Node\Expr\StaticCall) { - continue; - } + if (end($stmts) instanceof Node\Stmt\Return_) { + // the trailing return is the last one found + array_pop($exits); + $position--; + } - if (! $stmt->expr->class instanceof Node\Name) { - continue; - } + if ($exits !== []) { + return null; + } - $class = (string) $stmt->expr->class; + return $position; + } - if (strtolower($class) !== 'parent') { - continue; - } + /** + * Finds nodes in the method body, skipping nested functions, closures and classes. + * + * @param Node\Stmt[] $stmts + * @param callable(Node): bool $filter + * @return list + */ + private function findInMethodScope(array $stmts, callable $filter): array + { + $visitor = new class ($filter) extends NodeVisitorAbstract { - if (! $stmt->expr->name instanceof Node\Identifier) { - continue; + /** @var callable(Node): bool */ + private $filter; + + /** @var list */ + public array $found = []; + + /** + * @param callable(Node): bool $filter + */ + public function __construct(callable $filter) + { + $this->filter = $filter; } - if ($stmt->expr->name->toLowerString() === $methodName) { - return true; + public function enterNode(Node $node): ?int + { + if ($node instanceof Node\FunctionLike || $node instanceof Node\Stmt\ClassLike) { + return NodeVisitor::DONT_TRAVERSE_CHILDREN; + } + + if (($this->filter)($node)) { + $this->found[] = $node; + } + + return null; } - } - return false; + }; + + $traverser = new NodeTraverser($visitor); + $traverser->traverse($stmts); + + return $visitor->found; } }