composer update
This commit is contained in:
parent
f6abc3dce2
commit
71dfaca858
1753 changed files with 45274 additions and 14619 deletions
|
@ -123,6 +123,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
|
||||
private $removedIds = array();
|
||||
|
||||
private $removedBindingIds = array();
|
||||
|
||||
private static $internalTypes = array(
|
||||
'int' => true,
|
||||
'float' => true,
|
||||
|
@ -364,11 +366,11 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
try {
|
||||
if (isset($this->classReflectors[$class])) {
|
||||
$classReflector = $this->classReflectors[$class];
|
||||
} elseif ($this->trackResources) {
|
||||
} elseif (class_exists(ClassExistenceResource::class)) {
|
||||
$resource = new ClassExistenceResource($class, false);
|
||||
$classReflector = $resource->isFresh(0) ? false : new \ReflectionClass($class);
|
||||
} else {
|
||||
$classReflector = new \ReflectionClass($class);
|
||||
$classReflector = class_exists($class) ? new \ReflectionClass($class) : false;
|
||||
}
|
||||
} catch (\ReflectionException $e) {
|
||||
if ($throw) {
|
||||
|
@ -531,7 +533,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
throw new BadMethodCallException(sprintf('Setting service "%s" for an unknown or non-synthetic service definition on a compiled container is not allowed.', $id));
|
||||
}
|
||||
|
||||
unset($this->definitions[$id], $this->aliasDefinitions[$id], $this->removedIds[$id]);
|
||||
$this->removeId($id);
|
||||
unset($this->removedIds[$id]);
|
||||
|
||||
parent::set($id, $service);
|
||||
}
|
||||
|
@ -544,8 +547,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
public function removeDefinition($id)
|
||||
{
|
||||
if (isset($this->definitions[$id = $this->normalizeId($id)])) {
|
||||
unset($this->definitions[$id]);
|
||||
$this->removedIds[$id] = true;
|
||||
$this->removeId($id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -876,7 +878,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
throw new InvalidArgumentException(sprintf('An alias can not reference itself, got a circular reference on "%s".', $alias));
|
||||
}
|
||||
|
||||
unset($this->definitions[$alias], $this->removedIds[$alias]);
|
||||
$this->removeId($alias);
|
||||
unset($this->removedIds[$alias]);
|
||||
|
||||
return $this->aliasDefinitions[$alias] = $id;
|
||||
}
|
||||
|
@ -889,8 +892,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
public function removeAlias($alias)
|
||||
{
|
||||
if (isset($this->aliasDefinitions[$alias = $this->normalizeId($alias)])) {
|
||||
unset($this->aliasDefinitions[$alias]);
|
||||
$this->removedIds[$alias] = true;
|
||||
$this->removeId($alias);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1019,7 +1021,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
|
||||
$id = $this->normalizeId($id);
|
||||
|
||||
unset($this->aliasDefinitions[$id], $this->removedIds[$id]);
|
||||
$this->removeId($id);
|
||||
unset($this->removedIds[$id]);
|
||||
|
||||
return $this->definitions[$id] = $definition;
|
||||
}
|
||||
|
@ -1552,6 +1555,18 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
return $services;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets removed binding ids.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function getRemovedBindingIds()
|
||||
{
|
||||
return $this->removedBindingIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes a reasonably unique hash of a value.
|
||||
*
|
||||
|
@ -1656,4 +1671,21 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function removeId($id)
|
||||
{
|
||||
$this->removedIds[$id] = true;
|
||||
unset($this->aliasDefinitions[$id]);
|
||||
|
||||
if (!isset($this->definitions[$id])) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($this->definitions[$id]->getBindings() as $binding) {
|
||||
list(, $identifier) = $binding->getValues();
|
||||
$this->removedBindingIds[$identifier] = true;
|
||||
}
|
||||
|
||||
unset($this->definitions[$id]);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue