Installing this in a Laravel project or using it with other packages that require a higher version of the nikic/php-parser package fails.
- Installation request for phpdocumentor/phpdocumentor ^2.9 -> satisfiable by phpdocumentor/phpdocumentor[v2.9.0].
- Conclusion: remove nikic/php-parser v2.1.1
- Conclusion: don't install nikic/php-parser v2.1.1
- phpdocumentor/phpdocumentor v2.9.0 requires phpdocumentor/reflection ^3.0 -> satisfiable by phpdocumentor/reflection[3.0.0, 3.0.1].
- phpdocumentor/reflection 3.0.0 requires nikic/php-parser ^1.0 -> satisfiable by nikic/php-parser[v1.0.0, v1.0.1, v1.0.2, v1.1.0, v1.2.0, v1.2.1, v1.2.2, v1.3.0, v1.4.0, v1.4.1].
Can the version requirement for this package be adjusted to allow v2 also?
@sebastiaanluca +1, I would like to use phpDocumentor in a Laravel project too and I've ran into the same problem. Also, the composer installation instructions on phpdoc.org point to an even older version that only supports php 5.3
We do not recommend using composer to install phpdocumentor. Please use the phar to run phpdocumentor.
I ran in the same problem with laravel too. But there is also another problem when using phpdocumentor with php7 using Phar installed version
http://stackoverflow.com/questions/34958319/phpdocumentor-2-and-php-7-with-opcache-issues-in-doctrine
So neither works by default at this moment.
hmm, I can not see why this issue is closed. Everyone's using composer. I even tried the PHAR, but it throws a thousand warnings and seem to not work right parsing the code.
With Laravel 5.6, I walk in circles trying to install phpdocumentor.
It requires an outdated nikic/php-parser, symfony/console and has problems with the other requirements from phpdocumentor/ like reflection.
Is there any chance anyone updates the requirements ?
phpdocumentor/phpdocumentor 3.0.x-dev requires phpdocumentor/type-resolver 0.6.2
phpdocumentor/reflection-docblock 4.3.0 requires phpdocumentor/type-resolver ^0.4.0
or ^2
composer require phpdocumentor/phpdocumentor ^2
phpdocumentor/reflection 3.0.0 requires nikic/php-parser ^1.0
but laravel/framework wants nikic/php-parser ^4
It isn't that easy to just support multiple versions of php parser. Each major version has a number of bc breaks we cannot support.
We realize that it is an issue for our users. But since there is a workaround we want to focus on issues that are blocking.
We are a small team with limited resources maintaining phpdocumentor in our spare time. So we have to make choices.
This lack of support for composer is also causing me a headache.
Why not just drop support for the old version of php-parser? With PHP 5.6 at EOL this year, Focus on PHP 7 and use only the new php-parser.
People can always use old versions of phpdoc for legacy apps.
Whichever version of a package we choose, we are bound to dissatisfy someone. Especially since phpDocumentor uses commonly used packages, such as php-parser but also quite a few Symfony components, as such we cannot support all these cases.
Your suggestion for people to use old versions of phpdoc for 'legacy' apps also doesn't work unfortunately since, as you can read in the opening post, this is not a problem restricted to legacy apps. phpDocumentor uses newer versions of libraries than, for example, laravel supports.
The suggestion to change our version restraint to include multiple major versions of php-parser also doesn't work because the changes in php-parser are not compatible between its major versions. Whole classes have been renamed and moved.
As such, there is only one thing left for us to support: use phpDocumentor as a phar, docker or installed globally in a separate folder; but using it in your composer.json files is at your own risk and we are physically, literally and technically unable to support these setups. This is not unwillingness, it is just impossible.