You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ServiceMapProvider always has a ServiceMap with the new Entropy DI Container #9901
I have a TYPO3 Rector rule where I want to migrate configuration from Services.yaml. This works fine in Unit tests as in unit tests there is a special "hack" to make it work:
if (defined('PHPUNIT_COMPOSER_INSTALL')) {
$this->serviceMap = null;
}
but when you run the code on a real project, it doesn't work. The following line:
if (SimpleParameterProvider::hasParameter(Option::SYMFONY_CONTAINER_XML_PATH_PARAMETER)) {
never gets called because $this->serviceMap instanceof ServiceMap is always true.
Subject
Details
Rector version
2.6.7
I'm pretty sure there is a bug in Entropy Container as Entropy should not create a service if it's nullable.
this is my suggestion: Entropy should not create a service if it's nullable and pass null instead. The other question would be, why is the service even nullable and how was it before Entropy?
Well, you implemented this new DI Framework and i just see that it doesn't work exactly like before. I'm wondering why you ask me about a PR because I would expect you as a specialist to suggest a solution as you are giving me the impression that if I find a bug, I need to fix it myself. I have already suggested changes in the past and they were just closed and this is not how I want to be treated.
Activity
TomasVotruba commentedon Sep 17, 2026
Indeed. What do you suggest?
simonschaufi commentedon Sep 17, 2026
this is my suggestion: Entropy should not create a service if it's nullable and pass null instead. The other question would be, why is the service even nullable and how was it before Entropy?
TomasVotruba commentedon Sep 17, 2026
That would be
git blameto answer. I don't think it's needed in ctor, but PR would have to test this. Feel free to kick off onesimonschaufi commentedon Sep 17, 2026
Well, you implemented this new DI Framework and i just see that it doesn't work exactly like before. I'm wondering why you ask me about a PR because I would expect you as a specialist to suggest a solution as you are giving me the impression that if I find a bug, I need to fix it myself. I have already suggested changes in the past and they were just closed and this is not how I want to be treated.
TomasVotruba commentedon Sep 17, 2026
Sure 👍 Closing then.
simonschaufi commentedon Oct 19, 2026
Resolved with rectorphp/rector-symfony#1073