yii2-apidoc
yii2-apidoc copied to clipboard
Uninstallable with yii2-app-basic due to unsatisfiable nikic/php-parser dependency
What steps will reproduce the problem?
$ composer require --prefer-dist yiisoft/yii2-apidoc
What's expected?
The package is installed.
What do you get instead?
$ composer require --prefer-dist yiisoft/yii2-apidoc
./composer.json has been updated
Running composer update yiisoft/yii2-apidoc
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- yiisoft/yii2-apidoc[2.0.0, ..., 2.0.6] require nikic/php-parser 0.9.* -> found nikic/php-parser[v0.9.0, ..., v0.9.5] but the package is fixed to v5.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- yiisoft/yii2-apidoc[2.1.0, ..., 2.1.6] require nikic/php-parser ^1.0 -> found nikic/php-parser[v1.0.0, ..., v1.4.1] but the package is fixed to v5.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- yiisoft/yii2-apidoc[3.0.0, ..., 3.0.6] require nikic/php-parser ^4.0 -> found nikic/php-parser[v4.0.0, ..., v4.18.0] but the package is fixed to v5.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires yiisoft/yii2-apidoc * -> satisfiable by yiisoft/yii2-apidoc[2.0.0, ..., 2.1.6, 3.0.0, ..., 3.0.6].
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require yiisoft/yii2-apidoc:*" to figure out if any version is installable, or "composer require yiisoft/yii2-apidoc:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Additional info
| Q | A |
|---|---|
| Yii version | 2.0.49.3 |
| Yii APIDoc version | 3.0.6 |
| PHP version | 8.2.12 |
| Operating system | Debian GNU/Linux 12 |
Hi @ricpelo does it work with PHP 8.1?
According with https://github.com/yiisoft/yii2-apidoc/issues/297#issuecomment-1664037132 this package should support php 8.2 (or later, I think).
You have nikic/php-parser in v5 but api-doc currently supports ^4.0.
Your current options:
- downgrade
nikic/php-parserto v4 - prepare PR to this package to support
nikic/php-parserv5 (should be straight forward I think).
I think nikic/php-parser comes from the dev requirement phpunit/phpunit included in the advanced template, while the basic template doesn't have such requirement. Anyway, if the project requires BS5, this package won't be installed neither because of apidoc requires bs2-3.