-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
[Scoper] Make phpstan/phpdoc-parser part of preload.php and preload-split-package.php #2908
Conversation
This reverts commit f795831.
All checks have passed 🎉 @TomasVotruba it is ready for review. |
Could you elaborate more on what was the issue here? |
For example, I want to run rector on laminas components that has require-dev composer require --dev rector/rector
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^0.14.2 for rector/rector
./composer.json has been updated
Running composer update rector/rector
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laminas/laminas-coding-standard is locked to version 2.4.0 and an update of this package was not requested.
- slevomat/coding-standard 7.2.1 requires phpstan/phpdoc-parser ^1.5.1 -> satisfiable by phpstan/phpdoc-parser[1.5.1].
- rector/rector 0.14.2 conflicts with phpstan/phpdoc-parser <1.7.
- laminas/laminas-coding-standard 2.4.0 requires slevomat/coding-standard ^7.0 -> satisfiable by slevomat/coding-standard[7.2.1].
- Root composer.json requires rector/rector ^0.14.2 -> satisfiable by rector/rector[0.14.2]. Running rector from global will make error as well as different rector process
PHP Fatal error: Uncaught _PHPStan_9a6ded56a\Nette\DI\ServiceCreationException: Service of type PHPStan\PhpDocParser\Parser\PhpDocParser: Unable to pass specified arguments to PhpDocParser::__construct(). in phar:///Users/samsonasik/.composer/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/nette/di/src/DI/Resolver.php:421 The workaround was to:
But I think make it part on preload.php should solve it. By add this to preload, Rector should use the phpstan/phpdoc-parser from scoped vendor, while original |
I see. That makes sense 👍 |
This PR make phpstan/phpdoc-parser part of preload.php, so it loaded early by default when run rector, so no need to make part of conflict config:
"conflict": { - "phpstan/phpdoc-parser": "<1.7",