CodeExplorer addServiceAlias example
$services =
$this->document->
createElement('services'
);
foreach ($definitions as $id =>
$definition) { $this->
addService($definition,
$id,
$services);
} $aliases =
$this->container->
getAliases();
foreach ($aliases as $alias =>
$id) { while (isset($aliases[(string) $id])) { $id =
$aliases[(string) $id];
} $this->
addServiceAlias($alias,
$id,
$services);
} $parent->
appendChild($services);
} private function addTagRecursiveAttributes(\DOMElement
$parent, array
$attributes): void
{ foreach ($attributes as $name =>
$value) { $attribute =
$this->document->
createElement('attribute'
);
$attribute->
setAttribute('name',
$name);
if (\
is_array($value)) { $services =
$this->document->
createElement('services'
);
foreach ($definitions as $id =>
$definition) { $this->
addService($definition,
$id,
$services);
} $aliases =
$this->container->
getAliases();
foreach ($aliases as $alias =>
$id) { while (isset($aliases[(string) $id])) { $id =
$aliases[(string) $id];
} $this->
addServiceAlias($alias,
$id,
$services);
} $parent->
appendChild($services);
} private function addTagRecursiveAttributes(\DOMElement
$parent, array
$attributes): void
{ foreach ($attributes as $name =>
$value) { $attribute =
$this->document->
createElement('attribute'
);
$attribute->
setAttribute('name',
$name);
if (\
is_array($value)) { $code = "services:\n";
foreach ($this->container->
getDefinitions() as $id =>
$definition) { $code .=
$this->
addService($id,
$definition);
} $aliases =
$this->container->
getAliases();
foreach ($aliases as $alias =>
$id) { while (isset($aliases[(string) $id])) { $id =
$aliases[(string) $id];
} $code .=
$this->
addServiceAlias($alias,
$id);
} return $code;
} private function addParameters(): string
{ if (!
$this->container->
getParameterBag()->
all()) { return '';
} $code = "services:\n";
foreach ($this->container->
getDefinitions() as $id =>
$definition) { $code .=
$this->
addService($id,
$definition);
} $aliases =
$this->container->
getAliases();
foreach ($aliases as $alias =>
$id) { while (isset($aliases[(string) $id])) { $id =
$aliases[(string) $id];
} $code .=
$this->
addServiceAlias($alias,
$id);
} return $code;
} private function addParameters(): string
{ if (!
$this->container->
getParameterBag()->
all()) { return '';
}