Ocramius/ProxyManager

Could not check compatibility between `Laminas\ClassGenerator` and `Zend\ClassGenerator`

joshlopes opened this issue · 4 comments

Hello everyone, having this issue and is confusing me and haven't any luck on fixing it.

Fatal error: Could not check compatibility between Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator::generate(ReflectionClass $originalClass, Zend\Code\Generator\ClassGenerator $classGenerator): void and ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator::generate(ReflectionClass $originalClass, Laminas\Code\Generator\ClassGenerator $classGenerator), because class Zend\Code\Generator\ClassGenerator is not available in /var/www/vendor/symfony/symfony/src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php on line 33

When trying to upgrade

Bumps ocramius/proxy-manager from 2.12.0 to 2.13.0.

Does anyone faced the same or knows what is wrong?

I've looked in this issue list and most of people say to use composer v2 we are using composer:v2.1.3 so not quite sure what could be causing this issue.

This could be an inadvertently introduced BC break due to stricter API signatures: will check 👍

@Ocramius dependabot is also trying to update laminas library, but I think if I manually update this by hand without laminas update it works fine.

8adca224-2c1f-4c91-9ff1-b9b7565c55f9

This is what dependabot is doing. Guess some sort of incompatibility with laminas 4.4.2 ?

Ah, I see the problem:

  • laminas/laminas-code no longer requires laminas/laminas-zendframework-bridge since 4.4.0
  • symfony/symfony declares that it ocramius/proxy-manager, but does not declare that it also needs zendframework/zend-code
  • laminas/laminas-zendframework-bridge made it so that component requiring Zend\ stuff, also worked with Laminas\ stuff

Therefore, the alternatives here are two:

  1. upgrade to a newer symfony/symfony releases: even if they did their own weird thing and started replacing ocramius/proxy-manager with a fork, because of political reasons of their own, they no longer rely on the Zend\ dependency
  2. manually add laminas/laminas-zendframework-bridge to your dependencies if you cannot upgrade

I've already made the problem clear at symfony/symfony#41742 (comment)