New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Class incompatiblity between symfony/proxy-manager-bridge and laminas/laminas-code #41742
Comments
Also relevant:
* Installing `laminas/laminas-zendframework-bridge`, at the cost of a
performance penalty
* Adding `maglnet/composer-require-checker` to CI runs: catches these
relatively standard issues
…On Fri, Jun 18, 2021, 10:37 Gaëtan Petit ***@***.***> wrote:
*Symfony version(s) affected*: 3.4.49
*Description*
Updating dependencies through composer cause incompability with
laminas/laminas-code
*How to reproduce*
Running composer update with package requiring ocramius/proxy-manager
like symfony/proxy-manager-bridge
*Possible Solution*
As discussed with @Ocramius <https://github.com/Ocramius> in
laminas/laminas-code#89
<laminas/laminas-code#89>
Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator
seems to use zendframework/zend-code, but it doesn't declare a
dependency to it, hence why the class didn't get installed, and a
crash occurs.
The correct fix would be to declare a dependency there, and perhaps
plan a migration to laminas/laminas-code too
*Additional context*
composer update
Loading composer repositories with package information
Restricting packages listed in "symfony/symfony" to "3.4.*"
Updating dependencies
Lock file operations: 0 installs, 5 updates, 2 removals
- Removing laminas/laminas-eventmanager (3.3.1)
- Removing laminas/laminas-zendframework-bridge (1.2.0)
- Upgrading laminas/laminas-code (4.3.0 => 4.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 5 updates, 2 removals
- Downloading laminas/laminas-code (4.4.0)
- Downloading phpstan/phpstan (0.12.90)
- Removing laminas/laminas-zendframework-bridge (1.2.0)
- Removing laminas/laminas-eventmanager (3.3.1)
- Upgrading laminas/laminas-code (4.3.0 => 4.4.0): Extracting archive
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
Symfony operations: 2 recipes (5471d04139cfeb8c88ad90ba4a997ba1)
- Unconfiguring laminas/laminas-zendframework-bridge (>=1.2.0): From auto-generated recipe
- Unconfiguring laminas/laminas-eventmanager (>=3.3.1): From auto-generated recipe
Executing script cache:clear --no-warmup [KO]
[KO]
Script cache:clear --no-warmup returned with error code 255
!! PHP Fatal error: Could not check compatibility between Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator::generate(ReflectionClass $originalClass, Zend\Code\Generator\ClassGenerator $classGenerator) and ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator::generate(ReflectionClass $originalClass, Laminas\Code\Generator\ClassGenerator $classGenerator), because class Zend\Code\Generator\ClassGenerator is not available in /var/www/marketplace/vendor/symfony/proxy-manager-bridge/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php on line 25
Requiring laminas/laminas-zendframework-bridge seems to fix the problem.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41742>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFVEAVKNOGZDKMVKQZ5WDTTMATLANCNFSM465HAHXA>
.
|
Thanks for the report. |
This comment has been minimized.
This comment has been minimized.
No you can't as several dependencies are directly requiring on |
actually
We have to draw a line and stick to it, that's been annouced years ahead... |
Can't do that either it requires
I understand, we're actually just a step from switching to 4.4. It's just that it'll clearly break many 3.4 from updating dependencies (including possible security update). |
That's the risk of using a version that reached end of life 8 months ago. There is not much we can do I'm afraid (apart from fixing the bug in currently maintained versions if it's there). |
@gaetan-petit indeed, good luck with the upgrade! I realized there is one more thing you can do, which is to stick to laminas/laminas-code < 4.4, which is the version that introduced the change you're seeing. |
Thanks @wouterj (I guess) but in my previous post I said that we're actually finishing the migration. |
@gaetan-petit You can fix that yourself by adding I used this temporary fix: require_once __DIR__ . '/vendor/laminas/laminas-code/src/Generator/GeneratorInterface.php';
require_once __DIR__ . '/vendor/laminas/laminas-code/src/Generator/AbstractGenerator.php';
require_once __DIR__ . '/vendor/laminas/laminas-code/src/Generator/TraitUsageInterface.php';
require_once __DIR__ . '/vendor/laminas/laminas-code/src/Generator/ClassGenerator.php';
class_alias("Laminas\Code\Generator\GeneratorInterface",
"Zend\Code\Generator\GeneratorInterface");
class_alias("Laminas\Code\Generator\AbstractGenerator",
"Zend\Code\Generator\AbstractGenerator",);
class_alias("Laminas\Code\Generator\TraitUsageInterface",
"Zend\Code\Generator\TraitUsageInterface",);
class_alias("Laminas\Code\Generator\ClassGenerator",
"Zend\Code\Generator\ClassGenerator",); |
Hello, I am working with symfony 5.0 and had the this error: Running this fixed the problem: Upgrading to symfony 5.3 fixed the problem. |
Worked for me. Thanks. |
When I try to install laminas / laminas-zend framework-bridge, it gives me an error saying Class "1\ApiContentController" does not exist. How do I solve this? |
hiii symfony 3.4 worked for me |
…as-code < 4.4 (#1266) See symfony/symfony#41742 for details.
laminas/laminas-code. See the related symfony issue: symfony/symfony#41742 And add ics-parser 3.x to composer
Symfony version(s) affected: 3.4.49
Description
Updating dependencies through composer cause incompability with laminas/laminas-code
How to reproduce
Running
composer update
with package requiringocramius/proxy-manager
likesymfony/proxy-manager-bridge
Possible Solution
As discussed with @Ocramius in laminas/laminas-code#89
Additional context
Requiring
laminas/laminas-zendframework-bridge
seems to fix the problem.The text was updated successfully, but these errors were encountered: