From c8feb43bd50ccc9b1217f185ddd37cad0f405997 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 19 Jul 2026 09:56:33 +0000 Subject: [PATCH] Update dependency phpstan/phpstan-strict-rules to ^2.0.12 --- tools/.phpstan/composer.json | 2 +- tools/.phpstan/composer.lock | 19 +++++---- tools/.phpstan/vendor/composer/installed.json | 19 +++++---- tools/.phpstan/vendor/composer/installed.php | 10 ++--- .../phpstan-strict-rules/composer.json | 5 ++- .../Rules/Operators/OperatorRuleHelper.php | 42 +++++++++++++++++-- 6 files changed, 68 insertions(+), 29 deletions(-) diff --git a/tools/.phpstan/composer.json b/tools/.phpstan/composer.json index 610cd34dd..eb8189384 100644 --- a/tools/.phpstan/composer.json +++ b/tools/.phpstan/composer.json @@ -3,7 +3,7 @@ "phpstan/phpstan": "^2.2.5", "phpstan/extension-installer": "^1.4.3", "phpstan/phpstan-phpunit": "^2.0.18", - "phpstan/phpstan-strict-rules": "^2.0.11", + "phpstan/phpstan-strict-rules": "^2.0.12", "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 ed74a7563..08c718238 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": "3864d2393d875f2a59e9776942d63a59", + "content-hash": "f0fe144d785447caaecd86e1a5b1ba41", "packages": [], "packages-dev": [ { @@ -303,27 +303,28 @@ }, { "name": "phpstan/phpstan-strict-rules", - "version": "2.0.11", + "version": "2.0.12", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "9b000a578b85b32945b358b172c7b20e91189024" + "reference": "2bc5ae19ae965663b62ac907ee6342c3903ec93b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/9b000a578b85b32945b358b172c7b20e91189024", - "reference": "9b000a578b85b32945b358b172c7b20e91189024", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2bc5ae19ae965663b62ac907ee6342c3903ec93b", + "reference": "2bc5ae19ae965663b62ac907ee6342c3903ec93b", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.39" + "phpstan/phpstan": "^2.1.52" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" }, "type": "phpstan-extension", "extra": { @@ -348,9 +349,9 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.11" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.12" }, - "time": "2026-05-02T06:54:10+00:00" + "time": "2026-07-19T07:24:06+00:00" }, { "name": "tomasvotruba/type-coverage", diff --git a/tools/.phpstan/vendor/composer/installed.json b/tools/.phpstan/vendor/composer/installed.json index e1227a9a5..b39224e77 100644 --- a/tools/.phpstan/vendor/composer/installed.json +++ b/tools/.phpstan/vendor/composer/installed.json @@ -311,30 +311,31 @@ }, { "name": "phpstan/phpstan-strict-rules", - "version": "2.0.11", - "version_normalized": "2.0.11.0", + "version": "2.0.12", + "version_normalized": "2.0.12.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "9b000a578b85b32945b358b172c7b20e91189024" + "reference": "2bc5ae19ae965663b62ac907ee6342c3903ec93b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/9b000a578b85b32945b358b172c7b20e91189024", - "reference": "9b000a578b85b32945b358b172c7b20e91189024", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2bc5ae19ae965663b62ac907ee6342c3903ec93b", + "reference": "2bc5ae19ae965663b62ac907ee6342c3903ec93b", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.39" + "phpstan/phpstan": "^2.1.52" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" }, - "time": "2026-05-02T06:54:10+00:00", + "time": "2026-07-19T07:24:06+00:00", "type": "phpstan-extension", "extra": { "phpstan": { @@ -359,7 +360,7 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.11" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.12" }, "install-path": "../phpstan/phpstan-strict-rules" }, diff --git a/tools/.phpstan/vendor/composer/installed.php b/tools/.phpstan/vendor/composer/installed.php index 44d50f18f..a377e2460 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' => '0ac6e384ac13a51b8b4b0ea6222ad8a83fe4c0fb', + 'reference' => '62e92853bd9c3d5d562ce1bf07ab8c47b7d9e98e', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '0ac6e384ac13a51b8b4b0ea6222ad8a83fe4c0fb', + 'reference' => '62e92853bd9c3d5d562ce1bf07ab8c47b7d9e98e', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -65,9 +65,9 @@ 'dev_requirement' => true, ), 'phpstan/phpstan-strict-rules' => array( - 'pretty_version' => '2.0.11', - 'version' => '2.0.11.0', - 'reference' => '9b000a578b85b32945b358b172c7b20e91189024', + 'pretty_version' => '2.0.12', + 'version' => '2.0.12.0', + 'reference' => '2bc5ae19ae965663b62ac907ee6342c3903ec93b', 'type' => 'phpstan-extension', 'install_path' => __DIR__ . '/../phpstan/phpstan-strict-rules', 'aliases' => array(), diff --git a/tools/.phpstan/vendor/phpstan/phpstan-strict-rules/composer.json b/tools/.phpstan/vendor/phpstan/phpstan-strict-rules/composer.json index f7c12b517..4bcbd7f99 100644 --- a/tools/.phpstan/vendor/phpstan/phpstan-strict-rules/composer.json +++ b/tools/.phpstan/vendor/phpstan/phpstan-strict-rules/composer.json @@ -8,13 +8,14 @@ "keywords": ["static analysis"], "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.39" + "phpstan/phpstan": "^2.1.52" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" }, "config": { "platform": { diff --git a/tools/.phpstan/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperatorRuleHelper.php b/tools/.phpstan/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperatorRuleHelper.php index 6de54cab1..adb8f9c0a 100644 --- a/tools/.phpstan/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperatorRuleHelper.php +++ b/tools/.phpstan/vendor/phpstan/phpstan-strict-rules/src/Rules/Operators/OperatorRuleHelper.php @@ -3,6 +3,7 @@ namespace PHPStan\Rules\Operators; use PhpParser\Node\Expr; +use PhpParser\Node\Scalar\Int_; use PHPStan\Analyser\Scope; use PHPStan\Rules\RuleLevelHelper; use PHPStan\Type\Accessory\AccessoryNumericStringType; @@ -38,7 +39,20 @@ public function isValidForArithmeticOperation(Scope $scope, Expr $expr): bool return true; } - return $this->isSubtypeOfNumber($scope, $expr); + if ($this->isSubtypeOfNumber($scope, $expr)) { + return true; + } + + // Check if the type supports arithmetic via operator overloading extensions + // (only applies to object types like GMP, BCMath\Number) + if ($type->isObject()->yes()) { + $resultType = $scope->getType(new Expr\BinaryOp\Plus($expr, new Int_(1))); + if (!$resultType instanceof ErrorType) { + return true; + } + } + + return false; } public function isValidForIncrement(Scope $scope, Expr $expr): bool @@ -53,7 +67,18 @@ public function isValidForIncrement(Scope $scope, Expr $expr): bool return true; } - return $this->isSubtypeOfNumber($scope, $expr); + if ($this->isSubtypeOfNumber($scope, $expr)) { + return true; + } + + if ($type->isObject()->yes()) { + $resultType = $scope->getType(new Expr\PreInc($expr)); + if (!$resultType instanceof ErrorType) { + return true; + } + } + + return false; } public function isValidForDecrement(Scope $scope, Expr $expr): bool @@ -63,7 +88,18 @@ public function isValidForDecrement(Scope $scope, Expr $expr): bool return true; } - return $this->isSubtypeOfNumber($scope, $expr); + if ($this->isSubtypeOfNumber($scope, $expr)) { + return true; + } + + if ($type->isObject()->yes()) { + $resultType = $scope->getType(new Expr\PreDec($expr)); + if (!$resultType instanceof ErrorType) { + return true; + } + } + + return false; } private function isSubtypeOfNumber(Scope $scope, Expr $expr): bool