From 95a51d5743e173784ef88ff8865e40c349a3f217 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 30 Jul 2026 12:12:41 +0200 Subject: [PATCH] bump dev dependencies, PHPUnit 13 Run composer update and vendor/bin/jack raise-to-installed. PHPUnit 13 moved InvocationMocker out of the Builder namespace, so match both fully qualified names. --- composer.json | 14 +++++++------- .../TypeWillReturnCallableArrowFunctionRector.php | 6 +++++- ...ethodWithCallbackToWillReturnCallbackRector.php | 6 +++++- src/Enum/PHPUnitClassName.php | 5 +++++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index f0e09432..b8fb816d 100644 --- a/composer.json +++ b/composer.json @@ -8,21 +8,21 @@ }, "require-dev": { "phpstan/extension-installer": "^1.4", - "phpstan/phpstan": "^2.1.38", + "phpstan/phpstan": "^2.2", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-webmozart-assert": "^2.0", - "phpunit/phpunit": "^12.5", - "rector/jack": "^0.5", + "phpunit/phpunit": "^13.2", + "rector/jack": "^1.0", "rector/rector-src": "dev-main", - "rector/swiss-knife": "^2.3", - "symplify/easy-coding-standard": "^13.0", + "rector/swiss-knife": "^2.4", + "symplify/easy-coding-standard": "^13.2", "symplify/phpstan-extensions": "^12.0", - "symplify/phpstan-rules": "^14.9.11", + "symplify/phpstan-rules": "^14.12", "symplify/vendor-patches": "^11.5", "tomasvotruba/class-leak": "^2.1", "tomasvotruba/type-coverage": "^2.3", "tomasvotruba/unused-public": "^2.2", - "tracy/tracy": "^2.11" + "tracy/tracy": "^2.12" }, "autoload": { "psr-4": { diff --git a/rules/CodeQuality/Rector/Class_/TypeWillReturnCallableArrowFunctionRector.php b/rules/CodeQuality/Rector/Class_/TypeWillReturnCallableArrowFunctionRector.php index f41648c4..cadd3539 100644 --- a/rules/CodeQuality/Rector/Class_/TypeWillReturnCallableArrowFunctionRector.php +++ b/rules/CodeQuality/Rector/Class_/TypeWillReturnCallableArrowFunctionRector.php @@ -170,7 +170,11 @@ public function refactor(Node $node): ?Class_ if ($callerType instanceof ObjectType && in_array( $callerType->getClassName(), - [PHPUnitClassName::INVOCATION_MOCKER, PHPUnitClassName::INVOCATION_STUBBER], + [ + PHPUnitClassName::INVOCATION_MOCKER, + PHPUnitClassName::INVOCATION_MOCKER_INTERFACE, + PHPUnitClassName::INVOCATION_STUBBER, + ], true )) { $parentMethodCall = $parentMethodCall->var; diff --git a/rules/CodeQuality/Rector/Class_/VoidMethodWithCallbackToWillReturnCallbackRector.php b/rules/CodeQuality/Rector/Class_/VoidMethodWithCallbackToWillReturnCallbackRector.php index cfdef383..f24dfcaf 100644 --- a/rules/CodeQuality/Rector/Class_/VoidMethodWithCallbackToWillReturnCallbackRector.php +++ b/rules/CodeQuality/Rector/Class_/VoidMethodWithCallbackToWillReturnCallbackRector.php @@ -237,7 +237,11 @@ private function isMockedVoidMethodCall( if ($callerType instanceof ObjectType && in_array( $callerType->getClassName(), - [PHPUnitClassName::INVOCATION_MOCKER, PHPUnitClassName::INVOCATION_STUBBER], + [ + PHPUnitClassName::INVOCATION_MOCKER, + PHPUnitClassName::INVOCATION_MOCKER_INTERFACE, + PHPUnitClassName::INVOCATION_STUBBER, + ], true )) { $parentMethodCall = $parentMethodCall->var; diff --git a/src/Enum/PHPUnitClassName.php b/src/Enum/PHPUnitClassName.php index 6aad1917..421fd706 100644 --- a/src/Enum/PHPUnitClassName.php +++ b/src/Enum/PHPUnitClassName.php @@ -19,6 +19,11 @@ final class PHPUnitClassName public const string INVOCATION_MOCKER = 'PHPUnit\Framework\MockObject\Builder\InvocationMocker'; + /** + * PHPUnit 13 moved the interface out of the Builder namespace + */ + public const string INVOCATION_MOCKER_INTERFACE = 'PHPUnit\Framework\MockObject\InvocationMocker'; + public const string INVOCATION_STUBBER = 'PHPUnit\Framework\MockObject\InvocationStubber'; public const string TEST_LISTENER = 'PHPUnit\Framework\TestListener';