Closed Dropelikeit closed 1 year ago
If you use the --with-all-dependencies
flag as the Composer message suggests, unless you've got a package that ONLY supports doctrine/lexer:>=3.0
, you should be able to install the serializer and have the lexer package downgraded to 2.x.
Checking a Laravel project I have at work:
$ composer why doctrine/lexer
doctrine/annotations 2.0.1 requires doctrine/lexer (^2 || ^3)
egulias/email-validator 4.0.1 requires doctrine/lexer (^2.0 || ^3.0)
friendsofphp/php-cs-fixer v3.16.0 requires doctrine/lexer (^2 || ^3)
So, Laravel itself does NOT depend on the lexer.
Note, because of the lexer package's API redesign, either a combination of 1.x and 2.x or a combination of 2.x and 3.x can be supported, there isn't a sane way to support all 3 major versions.
Thank you very much for your quick reply. As you correctly described, the installation works with the --with-all-dependencies
flag. Nevertheless, I thought I would create this ticket to point out that Laravel 10 no longer supports doctrine-lexer version 1 and the message appears when adding the JMS/Serializer in a newly deployed Laravel app.
PHP: 8.1 JMS/Serializer: 3.23 Laravel: 10
Since the release of Laravel version 10, this library can no longer be installed because it ends in a dependency problem. The reason is that Laravel now uses
doctrine/lexer:^3.0.0
and this library can be used with version ^1 or ^2. It should also work with ^3.Steps required to reproduce the problem
composer create-project laravel/laravel example-app
)dropelikeit/laravel-jms-serializer
Expected Result
Actual Result
It should not be necessary to downgrade the
doctrine/lexer
package to use this library. I don't know what exactly is broken in Laravel whendoctrine/lexer
is downgraded.