Skip to content

Commit 9f1acc1

Browse files
committed
bug symfony#25264 [DI] Trigger deprecation when setting a to-be-private synthetic service (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [DI] Trigger deprecation when setting a to-be-private synthetic service | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#25253 | License | MIT | Doc PR | - Commits ------- 2817576 [DI] Trigger deprecation when setting a to-be-private synthetic service
2 parents 9401afd + 2817576 commit 9f1acc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/DependencyInjection/Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function set($id, $service)
174174
}
175175

176176
if (isset($this->privates[$id]) || !(isset($this->fileMap[$id]) || isset($this->methodMap[$id]))) {
177-
if (isset($this->syntheticIds[$id]) || (!isset($this->privates[$id]) && !isset($this->getRemovedIds()[$id]))) {
177+
if (!isset($this->privates[$id]) && !isset($this->getRemovedIds()[$id])) {
178178
// no-op
179179
} elseif (null === $service) {
180180
@trigger_error(sprintf('The "%s" service is private, unsetting it is deprecated since Symfony 3.2 and will fail in 4.0.', $id), E_USER_DEPRECATED);

0 commit comments

Comments
 (0)