-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Service names containing underscores not working after upgrading to 6.4.0 #52815
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
Comments
Please provide a reproducer for your bug. |
Seems to be related to #50718 |
Small reproduction script for this issue: <?php
// Install symfony/dependency-injection (6.3 works ok, 6.4 fails)
use Symfony\Component\DependencyInjection\ContainerBuilder;
require_once __DIR__ . "/vendor/autoload.php";
class MyClass {
public function __construct(\DateTimeImmutable $now_datetime) {}
}
$container = new ContainerBuilder();
$container->autowire(\DateTimeImmutable::class . ' $now_datetime', \DateTimeImmutable::class);
$container->autowire(MyClass::class, MyClass::class)->setPublic(true);
$container->compile();
$container->get(MyClass::class);
print "OK"; The essence is that the argument name (here: |
Thanks. I've run |
Thank you for digging / the reproducer - I suspect it would have taken me quite a while... |
This should be fixed by #52836. |
Works for me - all my tests pass. Thanks! |
… that contain underscores (nicolas-grekas) This PR was merged into the 6.4 branch. Discussion ---------- [DependencyInjection] Fix parsing named autowiring aliases that contain underscores | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #52815 | License | MIT Fixing a regression introduced in #50718 Commits ------- 69a115c [DependencyInjection] Fix parsing named autowiring aliases that contain underscores
Symfony version(s) affected
6.4.0
Description
Sorry - I'm not sure if this is a bug or just a misconfiguration by me.
Upgrading from 6.3.x to 6.4.0, and autowiring Redis is suddenly throwing an error.
How to reproduce
I have this, which works in 6.3.9:
When I upgrade to 6.4.0, I get this error:
Might this be a bug, or just a config issue on my project (nothing changes apart from upgrading Symfony and a few other packages not related to Redis)
In case it's relevant, I'm using snc/redis-bundle to manage the services, with phpredis:
If I rollback the upgrade, it starts working again.
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: