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

Allow phpstan/extension-installer #417

Open
dereuromark opened this issue Nov 26, 2023 · 4 comments
Open

Allow phpstan/extension-installer #417

dereuromark opened this issue Nov 26, 2023 · 4 comments

Comments

@dereuromark
Copy link
Contributor

Is it possible to allow/support also

Refs cakephp/cakephp#17448

We currently have phpstan installed via phive, but also having those (depending directly on phpstan) available makes it a bit tricky.
It almost sounds like we would have to remove phpstan from phive installation back to normal require-dev.

Would be nice if those could somehow we supported as well.
Is this feasable?

@pereorga
Copy link

pereorga commented Nov 26, 2023

Similar here, for my case I've found that I still prefer to use Composer for phpstan, phpunit and psalm, because it is easier to set-up:

    "phpstan/phpstan": "^1.10",
    "phpstan/phpstan-deprecation-rules": "^1.1",
    "phpstan/phpstan-strict-rules": "^1.5",
    "phpunit/phpunit": "^10.4",
    "psalm/plugin-phpunit": "^0.18.4",
    "rector/rector": "^0.18.10",
    "vimeo/psalm": "^5.16"

(And rector, because it is not available in Phive, as per rectorphp/rector#2724).

I use phive for php-cs-fixer, phan, composer-normalize, composer, phpcs (unless you need SlevomatCodingStandard), phpcpd, php-parallel-lint and yaml-lint.

@theseer theseer transferred this issue from phar-io/phar.io Nov 26, 2023
@theseer
Copy link
Member

theseer commented Nov 26, 2023

Dealing with extensions isn't easy - as that opens the door to actual dependency handling. See #88 for details.

PHPStan, if i recall correctly, is particularly problematic as it uses - for no apparent reason to me - PHPScoper when creating its phar archive. That makes it virtually impossible to install extensions for the phar distribution of it as the namespace of PHPStan or any child components is random. Unless the PHPStan authors drop that, there is nothing phive can do to make things work - even if we'd have a means of installing extensions.

@theseer
Copy link
Member

theseer commented Nov 26, 2023

PHPUnit is actually one of the main reasons phive exits: As it's a tool with runtime impact when executing tests, collisions in packages are a nightmare. I fail to see how installing phpunit with composer is in any possible way better.

Extensions to PHPUnit are best distributed as phar as well.

@pereorga
Copy link

@theseer It's because I use psalm for analysing PHPUnit tests, with psalm/plugin-phpunit. If I install PHPUnit with Phive, psalm fails with ERROR: UnusedClass. I didn't know how to get it to work.

Additionally, the architecture of my project may not be very common. It's a very simple and efficient website, with no OOP and free from any PHP dependencies: https://github.com/Softcatala/pccd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants