Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PsalmRestarter#restart is not compatible with XdebugHandler#restart in v3 #9462

Closed
boesing opened this issue Mar 6, 2023 · 3 comments
Closed

Comments

@boesing
Copy link
Contributor

boesing commented Mar 6, 2023

With v3, the method argument $commands got typed in composer/xdebug-handler@16057ba

Somehow, the bump made it to this package in 2c5052c without having failing tests. I guess that something else blocked the bump to v3 which now supports v3 and thus, builds are failing.

Uncaught RuntimeException: PHP Error: Declaration of Psalm\Internal\Fork\PsalmRestarter::restart(array $command): void should be compatible with Composer\XdebugHandler\XdebugHandler::restart($command) in /github/workspace/vendor/vimeo/psalm/src/Psalm/Internal/Fork/PsalmRestarter.php:79
@psalm-github-bot
Copy link

Hey @boesing, can you reproduce the issue on https://psalm.dev ?

boesing added a commit to boesing/psalm-plugin-stringf that referenced this issue Mar 6, 2023
vimeo/psalm#9462
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
@boesing
Copy link
Contributor Author

boesing commented Mar 6, 2023

As far as I can see, v5.7.0 had PsalmRestarter#restart(array $commands) which was removed in v5.7.1 - since there is still the composer.json which allows composer/xdebug-handler v3, this will remain problematic.

As far as I can see, you can either support v2 or v3 (or do class_alias magic).

@weirdan
Copy link
Collaborator

weirdan commented Mar 6, 2023

Widening the parameter type (from array to implicit mixed) is valid, so PsalmRestarter::restart($command): void should work with both versions: https://3v4l.org/GAIgs

Thus the issue is already fixed in 5.7.1 (#9347).

@weirdan weirdan closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants