Skip to content

Commit 72bc3f0

Browse files
committed
Compiler: removed support for \ in service name (BC break)
1 parent 9023712 commit 72bc3f0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/DI/Compiler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,12 @@ public static function parseServices(ContainerBuilder $builder, array $config, $
240240
}
241241
array_multisort($depths, $services);
242242

243-
foreach ($services as $origName => $def) {
244-
if ((string) (int) $origName === (string) $origName) {
243+
foreach ($services as $name => $def) {
244+
if ((string) (int) $name === (string) $name) {
245245
$postfix = $def instanceof Statement && is_string($def->getEntity()) ? '.' . $def->getEntity() : (is_scalar($def) ? ".$def" : '');
246246
$name = (count($builder->getDefinitions()) + 1) . preg_replace('#\W+#', '_', $postfix);
247-
} else {
248-
$name = ($namespace ? $namespace . '.' : '') . strtr($origName, '\\', '_');
247+
} elseif ($namespace) {
248+
$name = $namespace . '.' . $name;
249249
}
250250

251251
$params = $builder->parameters;

0 commit comments

Comments
 (0)