diff --git a/composer.json b/composer.json index 683af09..fe9d8f3 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "roave/backward-compatibility-check": "^8.0", "testo/bridge-infection": "^0.1.6", "testo/testo": "^0.10.25", - "vimeo/psalm": "^6.16" + "vimeo/psalm": "^7.0" }, "autoload": { "psr-4": { diff --git a/docs/.api-workspace/composer.lock b/docs/.api-workspace/composer.lock index 7ceefe0..5ffd5fc 100644 --- a/docs/.api-workspace/composer.lock +++ b/docs/.api-workspace/composer.lock @@ -2833,6 +2833,325 @@ ], "time": "2026-09-25T08:41:20+00:00" }, + { + "name": "psalm/plugin-laravel", + "version": "v4.19.1", + "source": { + "type": "git", + "url": "https://github.com/psalm/psalm-plugin-laravel.git", + "reference": "bfeefed6ea930f448cb0c2b5bc57e8948ee78531" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/psalm-plugin-laravel/zipball/bfeefed6ea930f448cb0c2b5bc57e8948ee78531", + "reference": "bfeefed6ea930f448cb0c2b5bc57e8948ee78531", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "nikic/php-parser": "^5.0", + "php": "^8.2", + "psalm/psalm-plugin-api": "^0.4.1", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "symfony/console": "^6.4 || ^7.0 || ^8.0", + "vimeo/psalm": "^7.2" + }, + "conflict": { + "laravel/framework": "<12.27 || 13.0.0 || >=13.1 <13.20", + "orchestra/testbench-core": "<10.0" + }, + "require-dev": { + "alies-dev/psalm-tester": "^0.4", + "brianium/paratest": "^7.7", + "friendsofphp/php-cs-fixer": "^3.94", + "laravel/framework": "^12.27 || ^13.20", + "orchestra/testbench-core": "^10.0 || ^11.0", + "phpunit/phpunit": "^11.5 || ^12.5 || ^13.0", + "ramsey/collection": "^1.3", + "rector/rector": "^2.8.3", + "symfony/http-foundation": "^7.1 || ^8.0", + "symfony/process": "^7.1 || ^8.0" + }, + "bin": [ + "bin/psalm-laravel" + ], + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psalm\\LaravelPlugin\\Plugin" + } + }, + "autoload": { + "psr-4": { + "Psalm\\LaravelPlugin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown", + "email": "github@muglug.com", + "role": "Original Author" + }, + { + "name": "Alies Lapatsin", + "email": "github@alies.dev", + "role": "Maintainer" + } + ], + "description": "Psalm plugin for Laravel", + "homepage": "https://github.com/psalm/psalm-plugin-laravel", + "keywords": [ + "dev", + "laravel", + "psalm", + "psalm-plugin" + ], + "support": { + "issues": "https://github.com/psalm/psalm-plugin-laravel/issues", + "source": "https://github.com/psalm/psalm-plugin-laravel/tree/v4.19.1" + }, + "funding": [ + { + "url": "https://github.com/alies-dev", + "type": "github" + } + ], + "time": "2026-11-10T19:22:22+00:00" + }, + { + "name": "psalm/plugin-mockery", + "version": "1.3.2", + "source": { + "type": "git", + "url": "https://github.com/psalm/psalm-plugin-mockery.git", + "reference": "ddff47dd095dc3c47224a3f6bf137e28570ef022" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/psalm-plugin-mockery/zipball/ddff47dd095dc3c47224a3f6bf137e28570ef022", + "reference": "ddff47dd095dc3c47224a3f6bf137e28570ef022", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "php": ">=8.1", + "psalm/psalm-plugin-api": "^0.4", + "vimeo/psalm": "^7|dev-master" + }, + "conflict": { + "mockery/mockery": "<1.0" + }, + "require-dev": { + "codeception/codeception": "^5.0", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^10.5 || ^11.5 || ^12.0 || ^13.0", + "squizlabs/php_codesniffer": "^3.3.1", + "weirdan/codeception-psalm-module": "^0.14.1" + }, + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psalm\\MockeryPlugin\\Plugin" + } + }, + "autoload": { + "psr-4": { + "Psalm\\MockeryPlugin\\": [ + "." + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Brown", + "email": "github@muglug.com" + } + ], + "description": "Psalm plugin for Mockery", + "support": { + "issues": "https://github.com/psalm/psalm-plugin-mockery/issues", + "source": "https://github.com/psalm/psalm-plugin-mockery/tree/1.3.2" + }, + "time": "2026-10-28T12:21:43+00:00" + }, + { + "name": "psalm/plugin-phpunit", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/psalm/psalm-plugin-phpunit.git", + "reference": "02622ac27c733402886a6d6aaea8a69b14e94f7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/02622ac27c733402886a6d6aaea8a69b14e94f7b", + "reference": "02622ac27c733402886a6d6aaea8a69b14e94f7b", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "php": ">=8.2", + "psalm/psalm-plugin-api": "^0.4.2", + "vimeo/psalm": "^7.2 || dev-master" + }, + "conflict": { + "phpspec/prophecy": "<1.20.0", + "phpspec/prophecy-phpunit": "<2.3.0", + "phpunit/phpunit": "<11.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.88", + "phpspec/prophecy-phpunit": "^2.5", + "phpunit/phpunit": "^11.0 || ^12.0 || ^13.0" + }, + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin" + }, + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psalm\\PhpUnitPlugin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Brown", + "email": "github@muglug.com" + } + ], + "description": "Psalm plugin for PHPUnit", + "support": { + "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", + "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/1.1.0" + }, + "time": "2026-11-11T10:38:01+00:00" + }, + { + "name": "psalm/plugin-symfony", + "version": "v5.11.0", + "source": { + "type": "git", + "url": "https://github.com/psalm/psalm-plugin-symfony.git", + "reference": "1fef73d616f0e187ffc05d13dd98f10ade6bc9e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/psalm-plugin-symfony/zipball/1fef73d616f0e187ffc05d13dd98f10ade6bc9e0", + "reference": "1fef73d616f0e187ffc05d13dd98f10ade6bc9e0", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "php": ">=8.2", + "psalm/psalm-plugin-api": "^0.4.2", + "vimeo/psalm": "^7.0@stable|dev-master" + }, + "conflict": { + "fidry/cpu-core-counter": "<1.2", + "symfony/expression-language": "<5.0", + "symfony/framework-bundle": "<5.0" + }, + "require-dev": { + "doctrine/annotations": "^1.8|^2", + "doctrine/orm": "^2.9 || ^3.6", + "phpunit/phpunit": "~7.5 || ~9.5", + "symfony/cache-contracts": "^1.0 || ^2.0 || ^3.0", + "symfony/console": "*", + "symfony/expression-language": "^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/form": "^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/messenger": "^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/mime": "^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/security-core": "*", + "symfony/serializer": "^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/validator": "*", + "twig/twig": "^2.10 || ^3.0", + "weirdan/codeception-psalm-module": "dev-master" + }, + "suggest": { + "weirdan/doctrine-psalm-plugin": "If Doctrine is used, it is recommended install this plugin" + }, + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psalm\\SymfonyPsalmPlugin\\Plugin" + } + }, + "autoload": { + "psr-4": { + "Psalm\\SymfonyPsalmPlugin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Farhad Safarov", + "email": "farhad.safarov@gmail.com" + } + ], + "description": "Psalm Plugin for Symfony", + "support": { + "issues": "https://github.com/psalm/psalm-plugin-symfony/issues", + "source": "https://github.com/psalm/psalm-plugin-symfony/tree/v5.11.0" + }, + "time": "2026-11-11T11:34:54+00:00" + }, + { + "name": "psalm/psalm-plugin-api", + "version": "0.4.2", + "source": { + "type": "git", + "url": "https://github.com/psalm/psalm-plugin-api.git", + "reference": "151e64d8cf62c7972f0f58cd87f68f548b78477e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/psalm-plugin-api/zipball/151e64d8cf62c7972f0f58cd87f68f548b78477e", + "reference": "151e64d8cf62c7972f0f58cd87f68f548b78477e", + "shasum": "" + }, + "conflict": { + "vimeo/psalm": "<7.0.0-rc3" + }, + "type": "metapackage", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniil Gentili", + "email": "daniil@daniil.it" + } + ], + "description": "Stable, semantically versioned API for Psalm plugins", + "support": { + "issues": "https://github.com/psalm/psalm-plugin-api/issues", + "source": "https://github.com/psalm/psalm-plugin-api/tree/0.4.2" + }, + "time": "2026-11-10T21:10:59+00:00" + }, { "name": "psr/container", "version": "2.0.2", @@ -3100,7 +3419,7 @@ "dist": { "type": "path", "url": "../..", - "reference": "789f7756b3c9bb01b1c8e0a7e382f96baeba30de" + "reference": "4fea1d48dfeff63e694a1d9ead7d3e18fad84515" }, "require": { "ext-tokenizer": "*", @@ -3117,7 +3436,7 @@ "roave/backward-compatibility-check": "^8.0", "testo/bridge-infection": "^0.1.6", "testo/testo": "^0.10.25", - "vimeo/psalm": "^6.16" + "vimeo/psalm": "^7.0" }, "type": "library", "extra": { @@ -3169,10 +3488,12 @@ "@php examples/wiring.php", "@php examples/protocol.php", "@php examples/defaults-registry.php", - "@php examples/structured-failures.php" + "@php examples/structured-failures.php", + "@php examples/where-guard.php" ], "mutation": [ - "infection --threads=max" + "Composer\\Config::disableProcessTimeout", + "infection --threads=max --with-uncovered" ], "psalm": [ "psalm --no-cache" @@ -3370,23 +3691,23 @@ }, { "name": "rasuvaeff/understudy-psalm", - "version": "v1.0.0", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/rasuvaeff/understudy-psalm.git", - "reference": "94a16bb9675d36734e26a394f6aa54a142a2ccfc" + "reference": "55fdda333da5fadc9eb1d5394f95fe737ac8fcfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rasuvaeff/understudy-psalm/zipball/94a16bb9675d36734e26a394f6aa54a142a2ccfc", - "reference": "94a16bb9675d36734e26a394f6aa54a142a2ccfc", + "url": "https://api.github.com/repos/rasuvaeff/understudy-psalm/zipball/55fdda333da5fadc9eb1d5394f95fe737ac8fcfe", + "reference": "55fdda333da5fadc9eb1d5394f95fe737ac8fcfe", "shasum": "" }, "require": { "nikic/php-parser": "^5.0", "php": "8.3 - 8.5", "rasuvaeff/understudy": "^1.0", - "vimeo/psalm": "^6.16" + "vimeo/psalm": "^6.19 || ^7.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.51", @@ -3434,7 +3755,7 @@ "issues": "https://github.com/rasuvaeff/understudy-psalm/issues", "source": "https://github.com/rasuvaeff/understudy-psalm" }, - "time": "2026-09-27T12:53:25+00:00" + "time": "2026-11-06T06:04:09+00:00" }, { "name": "rasuvaeff/understudy-testo", @@ -6763,22 +7084,22 @@ }, { "name": "vimeo/psalm", - "version": "6.18.1", + "version": "7.3.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "79465b8dc674127f442ae31ea114c11bc4dd7ed6" + "reference": "6480ee65f252d9829b0c5a49d44c1fa263babfa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/79465b8dc674127f442ae31ea114c11bc4dd7ed6", - "reference": "79465b8dc674127f442ae31ea114c11bc4dd7ed6", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/6480ee65f252d9829b0c5a49d44c1fa263babfa2", + "reference": "6480ee65f252d9829b0c5a49d44c1fa263babfa2", "shasum": "" }, "require": { "amphp/amp": "^3", "amphp/byte-stream": "^2", - "amphp/parallel": "^2.3", + "amphp/parallel": "^2.4.0", "composer-runtime-api": "^2", "composer/semver": "^1.4 || ^2.0 || ^3.0", "composer/xdebug-handler": "^2.0 || ^3.0", @@ -6792,10 +7113,15 @@ "ext-simplexml": "*", "ext-tokenizer": "*", "felixfbecker/language-server-protocol": "^1.5.3", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0", + "fidry/cpu-core-counter": "^1.2", "netresearch/jsonmapper": "^5.0", - "nikic/php-parser": "^5.2.0", - "php": "~8.1.31 || ~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0", + "nikic/php-parser": "^5.9", + "php-64bit": "~8.2.27 || ~8.3.16 || ~8.4.3 || ~8.5.0 || ~8.6.0", + "psalm/plugin-laravel": "^4.17.4", + "psalm/plugin-mockery": "^1.3.2", + "psalm/plugin-phpunit": "^0.21 || ^0.22 || ^1.0", + "psalm/plugin-symfony": "^5.9.1", + "psalm/psalm-plugin-api": "0.4.2", "sebastian/diff": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0", "spatie/array-to-xml": "^2.17.0 || ^3.0", "symfony/console": "^6.0 || ^7.0 || ^8.0", @@ -6806,9 +7132,8 @@ "psalm/psalm": "self.version" }, "require-dev": { - "amphp/phpunit-util": "^3", "bamarni/composer-bin-plugin": "^1.4", - "brianium/paratest": "^6.9", + "brianium/paratest": "^7.3", "danog/class-finder": "^0.4.8", "dg/bypass-finals": "^1.5", "ext-curl": "*", @@ -6816,16 +7141,15 @@ "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpdoc-parser": "^1.6", - "phpunit/phpunit": "^9.6", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.19", + "phpunit/phpunit": "^10.5 || ^11.5 || ^12.5 || ^13.0", "slevomat/coding-standard": "^8.4", "squizlabs/php_codesniffer": "^3.6", "symfony/process": "^6.0 || ^7.0 || ^8.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", - "ext-igbinary": "^2.0.5 is required, used to serialize caching data" + "ext-igbinary": "^2.0.5 is required, used to serialize caching data", + "ext-zstd": ">=0.15.0 is required, used to compress caching data" }, "bin": [ "psalm", @@ -6877,7 +7201,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2026-09-23T10:02:42+00:00" + "time": "2026-11-10T23:55:56+00:00" }, { "name": "webmozart/assert", diff --git a/src/WhenBuilder.php b/src/WhenBuilder.php index 8a2f9a3..f7b4cf5 100644 --- a/src/WhenBuilder.php +++ b/src/WhenBuilder.php @@ -101,6 +101,7 @@ public function returns(mixed ...$values): static // a position of its own would give the expectation two competing // notions of "the next call", and `returns($a, $b)->then()->returns($c)` // would step over $b without ever answering it. + /** @var mixed $value */ foreach ($list as $offset => $value) { $this->expectation->setAction(new ReturnValue($value), $this->slot + $offset); }