You are here

private function YamlDumper::addServiceAlias in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php \Symfony\Component\DependencyInjection\Dumper\YamlDumper::addServiceAlias()

Adds a service alias.

Parameters

string $alias:

Alias $id:

Return value

string

1 call to YamlDumper::addServiceAlias()
YamlDumper::addServices in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
Adds services.

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php, line 162

Class

YamlDumper
YamlDumper dumps a service container as a YAML string.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function addServiceAlias($alias, $id) {
  if ($id
    ->isPublic()) {
    return sprintf("    %s: @%s\n", $alias, $id);
  }
  else {
    return sprintf("    %s:\n        alias: %s\n        public: false", $alias, $id);
  }
}