doctrine / DoctrinePHPCRBundle

This bundle integrates Doctrine PHPCR ODM and PHPCR backends into Symfony
http://phpcr.github.com
MIT License
156 stars 66 forks source link

Version 3.0 conflicts with doctrine/persistence 2.5 #402

Closed YetiCGN closed 3 months ago

YetiCGN commented 3 months ago

I have a project where another dependency requires doctrine/persistence: ^1.3 || ^2.0. Because of that, Composer installed doctrine/persistence version 2.5.7 alongside doctrine/phpcr-bundle 3.0.0. However, upon executing the CacheClearCommand, I get the following error:

Error: Class Doctrine\Bundle\PHPCRBundle\ManagerRegistry contains 1 abstract method and must therefore be declared 
abstract or implement the remaining methods (Doctrine\Persistence\ManagerRegistry::getAliasNamespace)

The version of symfony/doctrine-bridge used is 6.3.12 because of the above mentioned package that only declares compatibility with versions lower than 3 of doctrine/persistence.

Since the error originates in this bundle, I would advise to declare a conflict with versions lower than 3.0.0 of doctrine/persistence so that the incompatibility is caught by Composer.

YetiCGN commented 3 months ago

FYI: I did upgrade the dependency that blocks doctrine/persistence 3 to a develop version, which solves my immediate problem.

dbu commented 3 months ago

thanks for the clear report. fixing this in #403. i think it won't fully prevent the problem because 3.0.0 is released and does not declare the conflict. afaik there is no way to retroactively fix the existing release.

YetiCGN commented 3 months ago

Wow! That was lightning-fast. Thanks! Yeah, 3.0.0 won't be fixed but it's a rare enough use case* that I don't think many people will encounter this scenario. But now they at least have a hit for their search query with this issue. :wink:

*I am currently updating a Sulu project from 2021 which is constantly being updated