[DependencyInjection] Rename ContainerBuilder::$aliases to avoid conflicting with the parent class
This commit is contained in:
parent
bb797ee755
commit
d8c0ef705c
@ -57,7 +57,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
/**
|
||||
* @var Alias[]
|
||||
*/
|
||||
private $aliases = array();
|
||||
private $aliasDefinitions = array();
|
||||
|
||||
/**
|
||||
* @var ResourceInterface[]
|
||||
@ -404,7 +404,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
$this->obsoleteDefinitions[$id] = $this->definitions[$id];
|
||||
}
|
||||
|
||||
unset($this->definitions[$id], $this->aliases[$id]);
|
||||
unset($this->definitions[$id], $this->aliasDefinitions[$id]);
|
||||
|
||||
parent::set($id, $service, $scope);
|
||||
|
||||
@ -438,7 +438,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
{
|
||||
$id = strtolower($id);
|
||||
|
||||
return isset($this->definitions[$id]) || isset($this->aliases[$id]) || parent::has($id);
|
||||
return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -475,8 +475,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
throw new LogicException(sprintf('The service "%s" has a circular reference to itself.', $id), 0, $e);
|
||||
}
|
||||
|
||||
if (!$this->hasDefinition($id) && isset($this->aliases[$id])) {
|
||||
return $this->get($this->aliases[$id]);
|
||||
if (!$this->hasDefinition($id) && isset($this->aliasDefinitions[$id])) {
|
||||
return $this->get($this->aliasDefinitions[$id]);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -640,7 +640,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*/
|
||||
public function getServiceIds()
|
||||
{
|
||||
return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliases), parent::getServiceIds()));
|
||||
return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -666,7 +666,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*/
|
||||
public function setAliases(array $aliases)
|
||||
{
|
||||
$this->aliases = array();
|
||||
$this->aliasDefinitions = array();
|
||||
$this->addAliases($aliases);
|
||||
}
|
||||
|
||||
@ -697,7 +697,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
|
||||
unset($this->definitions[$alias]);
|
||||
|
||||
$this->aliases[$alias] = $id;
|
||||
$this->aliasDefinitions[$alias] = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -709,7 +709,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*/
|
||||
public function removeAlias($alias)
|
||||
{
|
||||
unset($this->aliases[strtolower($alias)]);
|
||||
unset($this->aliasDefinitions[strtolower($alias)]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -723,7 +723,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*/
|
||||
public function hasAlias($id)
|
||||
{
|
||||
return isset($this->aliases[strtolower($id)]);
|
||||
return isset($this->aliasDefinitions[strtolower($id)]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -735,7 +735,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
*/
|
||||
public function getAliases()
|
||||
{
|
||||
return $this->aliases;
|
||||
return $this->aliasDefinitions;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -757,7 +757,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
throw new InvalidArgumentException(sprintf('The service alias "%s" does not exist.', $id));
|
||||
}
|
||||
|
||||
return $this->aliases[$id];
|
||||
return $this->aliasDefinitions[$id];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -837,7 +837,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
|
||||
$id = strtolower($id);
|
||||
|
||||
unset($this->aliases[$id]);
|
||||
unset($this->aliasDefinitions[$id]);
|
||||
|
||||
return $this->definitions[$id] = $definition;
|
||||
}
|
||||
|
Reference in New Issue
Block a user