作者:makhloufi-louni
项目:tuto_symfon
/**
* {@inheritdoc}
*/
protected function describeContainerAlias(Alias $alias, array $options = array())
{
$output = '- Service: `' . $alias . '`' . "\n" . '- Public: ' . ($alias->isPublic() ? 'yes' : 'no');
$this->write(isset($options['id']) ? sprintf("%s\n%s\n\n%s\n", $options['id'], str_repeat('~', strlen($options['id'])), $output) : $output);
}
作者:aWEBoLab
项目:tax
/**
* Adds a service alias.
*
* @param string $alias
* @param Alias $id
*
* @return string
*/
private function addServiceAlias($alias, $id)
{
if ($id->isPublic()) {
return sprintf(" %s: '@%s'\n", $alias, $id);
}
return sprintf(" %s:\n alias: %s\n public: false", $alias, $id);
}
作者:brennanto
项目:hackazo
/**
* @param Alias $alias
* @param string|null $id
*
* @return \DOMDocument
*/
private function getContainerAliasDocument(Alias $alias, $id = null)
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($aliasXML = $dom->createElement('alias'));
if ($id) {
$aliasXML->setAttribute('id', $id);
}
$aliasXML->setAttribute('service', (string) $alias);
$aliasXML->setAttribute('public', $alias->isPublic() ? 'true' : 'false');
return $dom;
}
作者:Ener-Getic
项目:symfon
/**
* @param Alias $alias
*
* @return array
*/
private function getContainerAliasData(Alias $alias)
{
return array('service' => (string) $alias, 'public' => $alias->isPublic());
}
作者:EarthTea
项目:earthteam.ne
/**
* Returns a service alias definiton.
*
* @param string $alias
* @param Alias $id
*
* @return string
*/
protected function getServiceAliasDefinition($id)
{
if ($id->isPublic()) {
return array('alias' => (string) $id);
} else {
return array('alias' => (string) $id, 'public' => FALSE);
}
}