php-standard-library / psalm-plugin

Psalm integration for the PHP Standard Library
MIT License
24 stars 6 forks source link

unable to use the plugin with `psalm/phar` #14

Closed azjezz closed 4 months ago

azjezz commented 1 year ago

Describe the bug

The plugin is not installable when using psalm/phar instead of vimeo/psalm

To Reproduce

Code to reproduce the behaviour: https://github.com/neutomic/neu

Expected behaviour

The plugin should be installable with the phar distribution of psalm.

Additional context

neu uses psalm/phar instead of vimeo/psalm because there's a dependency conflict with vimeo/psalm.

psalm relies on amphp/amp v2, while neu requires amphp/amp v3, the solution is to use psalm/phar, which prefixes all the dependencies, allowing neu to use amphp/amp v3, while psalm uses v2, however, php-standard-library/psalm-plugin requires vimeo/psalm as a dependency, one solution could be to move psalm to dev-dependencies instead, the down side of doing this is that people would be able to install the plugin with psalm v4, but this in my opinion is not an issue we should worry about.

azjezz commented 1 year ago

@veewee wdyt?

veewee commented 1 year ago

Shouldn't the psalm phar 'replace' vimeo/psalm? It doesn't seem to be doing this: https://github.com/psalm/phar/blob/master/composer.json

This is how we do things in grumphp-shim:

https://github.com/phpro/grumphp-shim/blob/master/composer.json#L29

It should allow to require vimeo/psalm in here and still use psalm/phar downstream

azjezz commented 1 year ago

no, it seems psalm phar conflicts with the package :/ https://github.com/psalm/phar/blob/master/composer.json#L9