DoctrineModule: Can't install due to conflicting requirements

I’m trying to require DoctrineModule using:

composer require doctrine/doctrine-module:5.3.0

Pretty standard, but I’m getting the following:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires doctrine/doctrine-module 5.3.0 -> satisfiable by doctrine/doctrine-module[5.3.0].
    - doctrine/doctrine-module 5.3.0 requires doctrine/annotations ^1.13.3 -> found doctrine/annotations[1.13.3, ..., 1.14.3] but the package is fixed to 2.0.1 (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.

The conflicting package is PHP-CS-Fixer, that requires this:

        "doctrine/annotations": "^2",

While the composer.json in DoctrineModule requires this:

        "doctrine/annotations": "^1.13.3",

I’m not sure whether doctrine/annotations has a stable release for version 2, and this repo should upgrade the requirement or not

What do you guys suggest?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 25 (21 by maintainers)

Most upvoted comments

Thanks for the pointers, @greg0ire. Removing registerLoader does indeed clear up most of the errors. I have opened #801 as a draft, and I’ve added a TODO note to test with annotations v1 after the work is done to be sure we haven’t broken backward compatibility. Unfortunately, it looks to me like the one remaining piece, the CachedReader --> PsrCachedReader modification, is going to be a non-trivial change. The doctrine/cache library is deprecated in favor of PSR-6/PSR-16, and I suspect we need to do some refactoring to get rid of it before we can easily finish the rest of the work. That’s probably a task for a separate PR, but unfortunately I think it’s more than my time will permit me to figure out at the moment. Of course, if nobody else is willing or able, I can try to make time – but it’s going to require me to learn more details that I don’t currently know, so it will take me a while to work through, and my plate is already very full.

it might make sense to pin the dev tools

FTR, that’s exactly what we do on some other Doctrine repositories where this situation happens too often.

Note that mongodb-odm 2.5.0 was released yesterday, and that it now supports annotations v2: https://github.com/doctrine/mongodb-odm/blob/b8ff84dacb3b4926de346919211bf0fabe86e31a/composer.json#L26

You might want to give this another try.

…but hopefully it’s a sign that changes required won’t be too terrible.

I think it will be annoying, but just annoying

Do you get the phpstan error after a composer install of the current dependencies, before changing anything related to the annotations? Have you compared the way phpstan runs in continuous integration here with your local approach? (Sorry if these are obvious questions – just trying to be as helpful as I can with limited project familiarity 😃 ).

Yup the Most recent job apparently failed like this well

Please go ahead. v2 shouldn’t be too hard to upgrade to.