Update to Drupal 8.2.6. For more information, see https://www.drupal.org/project/drupal/releases/8.2.6

This commit is contained in:
Pantheon Automation 2017-02-02 16:28:38 -08:00 committed by Greg Anderson
parent db56c09587
commit f1e72395cb
588 changed files with 26857 additions and 2777 deletions
vendor/symfony/dependency-injection

View file

@ -201,7 +201,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* @param ResourceInterface $resource A resource instance
*
* @return ContainerBuilder The current instance
* @return $this
*/
public function addResource(ResourceInterface $resource)
{
@ -219,7 +219,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* @param ResourceInterface[] $resources An array of resources
*
* @return ContainerBuilder The current instance
* @return $this
*/
public function setResources(array $resources)
{
@ -237,7 +237,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* @param object $object An object instance
*
* @return ContainerBuilder The current instance
* @return $this
*/
public function addObjectResource($object)
{
@ -253,7 +253,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* @param \ReflectionClass $class
*
* @return ContainerBuilder The current instance
* @return $this
*/
public function addClassResource(\ReflectionClass $class)
{
@ -276,7 +276,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* @param string $extension The extension alias or namespace
* @param array $values An array of values that customizes the extension
*
* @return ContainerBuilder The current instance
* @return $this
*
* @throws BadMethodCallException When this ContainerBuilder is frozen
* @throws \LogicException if the container is frozen
@ -300,7 +300,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* @param CompilerPassInterface $pass A compiler pass
* @param string $type The type of compiler pass
*
* @return ContainerBuilder The current instance
* @return $this
*/
public function addCompilerPass(CompilerPassInterface $pass, $type = PassConfig::TYPE_BEFORE_OPTIMIZATION)
{
@ -354,7 +354,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
/**
* Returns all Scope children.
*
* @return array An array of scope children.
* @return array An array of scope children
*
* @deprecated since version 2.8, to be removed in 3.0.
*/
@ -381,21 +381,14 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
public function set($id, $service, $scope = self::SCOPE_CONTAINER)
{
$id = strtolower($id);
$set = isset($this->definitions[$id]);
if ($this->isFrozen()) {
if ($this->isFrozen() && ($set || isset($this->obsoleteDefinitions[$id])) && !$this->{$set ? 'definitions' : 'obsoleteDefinitions'}[$id]->isSynthetic()) {
// setting a synthetic service on a frozen container is alright
if (
(!isset($this->definitions[$id]) && !isset($this->obsoleteDefinitions[$id]))
||
(isset($this->definitions[$id]) && !$this->definitions[$id]->isSynthetic())
||
(isset($this->obsoleteDefinitions[$id]) && !$this->obsoleteDefinitions[$id]->isSynthetic())
) {
throw new BadMethodCallException(sprintf('Setting service "%s" on a frozen container is not allowed.', $id));
}
throw new BadMethodCallException(sprintf('Setting service "%s" on a frozen container is not allowed.', $id));
}
if (isset($this->definitions[$id])) {
if ($set) {
$this->obsoleteDefinitions[$id] = $this->definitions[$id];
}
@ -456,7 +449,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
}
if (!array_key_exists($id, $this->definitions) && isset($this->aliasDefinitions[$id])) {
return $this->get($this->aliasDefinitions[$id]);
return $this->get((string) $this->aliasDefinitions[$id], $invalidBehavior);
}
try {
@ -480,6 +473,10 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
return;
}
throw $e;
} catch (\Throwable $e) {
unset($this->loading[$id]);
throw $e;
}
@ -506,7 +503,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* parameter, the value will still be 'bar' as defined in the ContainerBuilder
* constructor.
*
* @param ContainerBuilder $container The ContainerBuilder instance to merge.
* @param ContainerBuilder $container The ContainerBuilder instance to merge
*
* @throws BadMethodCallException When this ContainerBuilder is frozen
*/
@ -862,6 +859,10 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
public function createService(Definition $definition, $id, $tryProxy = true)
{
if ($definition instanceof DefinitionDecorator) {
throw new RuntimeException(sprintf('Constructing service "%s" from a parent definition is not supported at build time.', $id));
}
if ($definition->isSynthetic()) {
throw new RuntimeException(sprintf('You have requested a synthetic service ("%s"). The DIC does not know how to construct this service.', $id));
}
@ -936,15 +937,15 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
$this->shareService($definition, $service, $id);
}
foreach ($definition->getMethodCalls() as $call) {
$this->callMethod($service, $call);
}
$properties = $this->resolveServices($parameterBag->unescapeValue($parameterBag->resolveValue($definition->getProperties())));
foreach ($properties as $name => $value) {
$service->$name = $value;
}
foreach ($definition->getMethodCalls() as $call) {
$this->callMethod($service, $call);
}
if ($callable = $definition->getConfigurator()) {
if (is_array($callable)) {
$callable[0] = $parameterBag->resolveValue($callable[0]);
@ -1007,7 +1008,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*
* @param string $name The tag name
*
* @return array An array of tags with the tagged service as key, holding a list of attribute arrays.
* @return array An array of tags with the tagged service as key, holding a list of attribute arrays
*/
public function findTaggedServiceIds($name)
{
@ -1063,7 +1064,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
/**
* Returns the Service Conditionals.
*
* @param mixed $value An array of conditionals to return.
* @param mixed $value An array of conditionals to return
*
* @return array An array of Service conditionals
*/
@ -1144,15 +1145,15 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
/**
* Shares a given service in the container.
*
* @param Definition $definition
* @param mixed $service
* @param string $id
* @param Definition $definition
* @param mixed $service
* @param string|null $id
*
* @throws InactiveScopeException
*/
private function shareService(Definition $definition, $service, $id)
{
if ($definition->isShared() && self::SCOPE_PROTOTYPE !== $scope = $definition->getScope(false)) {
if (null !== $id && $definition->isShared() && self::SCOPE_PROTOTYPE !== $scope = $definition->getScope(false)) {
if (self::SCOPE_CONTAINER !== $scope && !isset($this->scopedServices[$scope])) {
throw new InactiveScopeException($id, $scope);
}