Adds a service alias.
string $alias:
string $id:
string
private function addServiceAlias($alias, $id) {
$name = Container::camelize($alias);
$type = 'Object';
if ($this->container
->hasDefinition($id)) {
$class = $this->container
->getDefinition($id)
->getClass();
$type = 0 === strpos($class, '%') ? 'Object' : $class;
}
return <<<EOF
/**
* Gets the {<span class="php-variable">$alias</span>} service alias.
*
* @return {<span class="php-variable">$type</span>} An instance of the {<span class="php-variable">$id</span>} service
*/
protected function get{<span class="php-variable">$name</span>}Service()
{
return {<span class="php-variable">$this</span>
-><span class="php-function-or-constant function member-of-self">getServiceCall</span>(<span class="php-variable">$id</span>)};
}
EOF;
}