From cd5c85fd25fbe65559ea7091c2406ea71110f6c4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 4 Jul 2026 12:58:33 +0000 Subject: [PATCH] Update dependency phpstan/phpstan-phpunit to ^2.0.18 --- tools/.phpstan/composer.json | 2 +- tools/.phpstan/composer.lock | 14 +++++++------- tools/.phpstan/vendor/composer/installed.json | 14 +++++++------- tools/.phpstan/vendor/composer/installed.php | 10 +++++----- .../AttributeVersionRequirementHelper.php | 16 ++++++++++++---- .../src/Rules/PHPUnit/PHPUnitVersion.php | 17 +++++++++++++++++ 6 files changed, 49 insertions(+), 24 deletions(-) diff --git a/tools/.phpstan/composer.json b/tools/.phpstan/composer.json index 0065d44e8..c4fe7aea4 100644 --- a/tools/.phpstan/composer.json +++ b/tools/.phpstan/composer.json @@ -2,7 +2,7 @@ "require-dev": { "phpstan/phpstan": "^2.2.4", "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan-phpunit": "^2.0.17", + "phpstan/phpstan-phpunit": "^2.0.18", "phpstan/phpstan-strict-rules": "^2.0.11", "tomasvotruba/type-coverage": "^2.2.2", "ergebnis/phpstan-rules": "^2.13.1" diff --git a/tools/.phpstan/composer.lock b/tools/.phpstan/composer.lock index 38ed62887..e9f882523 100644 --- a/tools/.phpstan/composer.lock +++ b/tools/.phpstan/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a34ce8651ddc3c943b199ad2e3301c49", + "content-hash": "9210e675833edf360766da6287af8b9c", "packages": [], "packages-dev": [ { @@ -245,16 +245,16 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "2.0.17", + "version": "2.0.18", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "c2f977551f0736d60467b3d754b2e0cf4e337b3f" + "reference": "f5dc20ff8082d02339b60cab68ec3eb0d859fb30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/c2f977551f0736d60467b3d754b2e0cf4e337b3f", - "reference": "c2f977551f0736d60467b3d754b2e0cf4e337b3f", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f5dc20ff8082d02339b60cab68ec3eb0d859fb30", + "reference": "f5dc20ff8082d02339b60cab68ec3eb0d859fb30", "shasum": "" }, "require": { @@ -297,9 +297,9 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.17" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.18" }, - "time": "2026-06-29T05:32:23+00:00" + "time": "2026-07-04T12:16:09+00:00" }, { "name": "phpstan/phpstan-strict-rules", diff --git a/tools/.phpstan/vendor/composer/installed.json b/tools/.phpstan/vendor/composer/installed.json index fe97cfc45..cdcd5724c 100644 --- a/tools/.phpstan/vendor/composer/installed.json +++ b/tools/.phpstan/vendor/composer/installed.json @@ -250,17 +250,17 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "2.0.17", - "version_normalized": "2.0.17.0", + "version": "2.0.18", + "version_normalized": "2.0.18.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "c2f977551f0736d60467b3d754b2e0cf4e337b3f" + "reference": "f5dc20ff8082d02339b60cab68ec3eb0d859fb30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/c2f977551f0736d60467b3d754b2e0cf4e337b3f", - "reference": "c2f977551f0736d60467b3d754b2e0cf4e337b3f", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f5dc20ff8082d02339b60cab68ec3eb0d859fb30", + "reference": "f5dc20ff8082d02339b60cab68ec3eb0d859fb30", "shasum": "" }, "require": { @@ -279,7 +279,7 @@ "phpunit/phpunit": "^9.6", "shipmonk/name-collision-detector": "^2.1" }, - "time": "2026-06-29T05:32:23+00:00", + "time": "2026-07-04T12:16:09+00:00", "type": "phpstan-extension", "extra": { "phpstan": { @@ -305,7 +305,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.17" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.18" }, "install-path": "../phpstan/phpstan-phpunit" }, diff --git a/tools/.phpstan/vendor/composer/installed.php b/tools/.phpstan/vendor/composer/installed.php index 74f4a7f4f..704d7a7d0 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' => 'ade0ea39dc79debd1c2c46bcc19830acfe449afc', + 'reference' => '7fa079b9c95cf84f46ba074010f8d1e79f689af8', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'ade0ea39dc79debd1c2c46bcc19830acfe449afc', + 'reference' => '7fa079b9c95cf84f46ba074010f8d1e79f689af8', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -56,9 +56,9 @@ 'dev_requirement' => true, ), 'phpstan/phpstan-phpunit' => array( - 'pretty_version' => '2.0.17', - 'version' => '2.0.17.0', - 'reference' => 'c2f977551f0736d60467b3d754b2e0cf4e337b3f', + 'pretty_version' => '2.0.18', + 'version' => '2.0.18.0', + 'reference' => 'f5dc20ff8082d02339b60cab68ec3eb0d859fb30', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../phpstan/phpstan-phpunit', 'aliases' => array(), diff --git a/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/AttributeVersionRequirementHelper.php b/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/AttributeVersionRequirementHelper.php index 966c2bf52..382493fb9 100644 --- a/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/AttributeVersionRequirementHelper.php +++ b/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/AttributeVersionRequirementHelper.php @@ -17,6 +17,7 @@ use function is_numeric; use function preg_match; use function sprintf; +use function strpos; use function substr_count; use function version_compare; @@ -43,9 +44,9 @@ final class AttributeVersionRequirementHelper public function __construct( PHPUnitVersion $PHPUnitVersion, - bool $deprecationRulesInstalled, PhpVersion $phpVersion, - bool $bleedingEdge, + bool $deprecationRulesInstalled = false, + bool $bleedingEdge = false, bool $warnAboutIncompleteVersion = true ) { @@ -96,11 +97,18 @@ public function checkVersionRequirement(array $attributes, Scope $scope): array continue; } + $pharIoVersions = strpos($attr->getName(), 'RequiresPhpunit') !== false + ? $this->PHPUnitVersion->getPharIoVersions() + : $phpstanPharIoVersions; + if ($pharIoVersions === []) { + continue; + } + try { // check composer like version constraints, e.g. ^1 or ~2 $testPhpVersionConstraint = $parser->parse($versionRequirement); - foreach ($phpstanPharIoVersions as $pharIoVersion) { + foreach ($pharIoVersions as $pharIoVersion) { if ($testPhpVersionConstraint->complies($pharIoVersion)) { // one of the versions within range matched, check next attribute continue 2; @@ -120,7 +128,7 @@ public function checkVersionRequirement(array $attributes, Scope $scope): array $operator = $matches['operator'] !== '' ? $matches['operator'] : '>='; - foreach ($phpstanPharIoVersions as $pharIoVersion) { + foreach ($pharIoVersions as $pharIoVersion) { if (version_compare($pharIoVersion->getVersionString(), $matches['version'], $operator)) { // one of the versions within range matched, check next attribute continue 2; diff --git a/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/PHPUnitVersion.php b/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/PHPUnitVersion.php index f614585be..e6176b0af 100644 --- a/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/PHPUnitVersion.php +++ b/tools/.phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit/PHPUnitVersion.php @@ -2,7 +2,9 @@ namespace PHPStan\Rules\PHPUnit; +use PharIo\Version\Version; use PHPStan\TrinaryLogic; +use function sprintf; class PHPUnitVersion { @@ -17,6 +19,21 @@ public function __construct(?int $majorVersion, ?int $minorVersion) $this->minorVersion = $minorVersion; } + /** + * @return array{}|array{Version, Version} + */ + public function getPharIoVersions(): array + { + if ($this->majorVersion === null || $this->minorVersion === null) { + return []; + } + + return [ + new Version(sprintf('%d.%d.0', $this->majorVersion, $this->minorVersion)), + new Version(sprintf('%d.%d.99', $this->majorVersion, $this->minorVersion)), + ]; + } + public function supportsDataProviderAttribute(): TrinaryLogic { if ($this->majorVersion === null) {