diff --git a/composer.json b/composer.json index 522151e..23651e3 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ }, "require": { "php": "^7.4 | ^8.0", - "phpunit/phpunit": "^8.4 | ^9.0 | ^10.0 | 10.0.x-dev" + "phpunit/phpunit": "^8.4 | ^9.0 | ^10.0 | ^11" }, "require-dev": { "consolidation/robo": "^3.0" diff --git a/src/Stub.php b/src/Stub.php index aaee8bc..d57db23 100644 --- a/src/Stub.php +++ b/src/Stub.php @@ -416,7 +416,19 @@ public static function constructEmptyExcept( private static function generateMock() { $args = func_get_args(); - if (version_compare(PHPUnitVersion::series(), '10.4', '>=') && !is_bool($args[1])) { + if (version_compare(PHPUnitVersion::series(), '11', '>=')) { + if (!is_bool($args[1]) || !is_bool($args[2])) { + $additionalParameters = []; + if (!is_bool($args[1])) { + $additionalParameters[] = true; + } + if (!is_bool($args[2])) { + $additionalParameters[] = true; + } + + array_splice($args, 1, 0, $additionalParameters); + } + } elseif (version_compare(PHPUnitVersion::series(), '10.4', '>=') && !is_bool($args[1])) { array_splice($args, 1, 0, [true]); }