[DependencyInjection] added some missing accessors
This commit is contained in:
parent
1a0bcd141a
commit
7e2d6c0043
@ -157,6 +157,37 @@ class BuilderConfiguration
|
|||||||
return $this->aliases;
|
return $this->aliases;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if a service alias exists.
|
||||||
|
*
|
||||||
|
* @param string $alias The alias
|
||||||
|
*
|
||||||
|
* @return Boolean true if the alias exists, false otherwise
|
||||||
|
*/
|
||||||
|
public function hasAlias($alias)
|
||||||
|
{
|
||||||
|
return array_key_exists($alias, $this->aliases);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the service id for a given alias.
|
||||||
|
*
|
||||||
|
* @param string $alias The alias
|
||||||
|
*
|
||||||
|
* @return string The aliased id
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException if the service alias does not exist
|
||||||
|
*/
|
||||||
|
public function getAlias($alias)
|
||||||
|
{
|
||||||
|
if (!$this->hasAlias($alias))
|
||||||
|
{
|
||||||
|
throw new \InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $alias));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->aliases[$alias];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a definition.
|
* Sets a definition.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user