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:
parent
db56c09587
commit
f1e72395cb
588 changed files with 26857 additions and 2777 deletions
|
@ -23,8 +23,6 @@ abstract class Dumper implements DumperInterface
|
|||
protected $container;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ContainerBuilder $container The service container to dump
|
||||
*/
|
||||
public function __construct(ContainerBuilder $container)
|
||||
|
|
|
@ -130,7 +130,7 @@ class GraphvizDumper extends Dumper
|
|||
*
|
||||
* @return array An array of edges
|
||||
*/
|
||||
private function findEdges($id, $arguments, $required, $name)
|
||||
private function findEdges($id, array $arguments, $required, $name)
|
||||
{
|
||||
$edges = array();
|
||||
foreach ($arguments as $argument) {
|
||||
|
@ -246,7 +246,7 @@ class GraphvizDumper extends Dumper
|
|||
*
|
||||
* @return string A comma separated list of attributes
|
||||
*/
|
||||
private function addAttributes($attributes)
|
||||
private function addAttributes(array $attributes)
|
||||
{
|
||||
$code = array();
|
||||
foreach ($attributes as $k => $v) {
|
||||
|
@ -263,7 +263,7 @@ class GraphvizDumper extends Dumper
|
|||
*
|
||||
* @return string A space separated list of options
|
||||
*/
|
||||
private function addOptions($options)
|
||||
private function addOptions(array $options)
|
||||
{
|
||||
$code = array();
|
||||
foreach ($options as $k => $v) {
|
||||
|
|
|
@ -144,6 +144,7 @@ class PhpDumper extends Dumper
|
|||
if ($this->container->isFrozen()) {
|
||||
$code .= $this->addFrozenConstructor();
|
||||
$code .= $this->addFrozenCompile();
|
||||
$code .= $this->addIsFrozenMethod();
|
||||
} else {
|
||||
$code .= $this->addConstructor();
|
||||
}
|
||||
|
@ -334,8 +335,8 @@ class PhpDumper extends Dumper
|
|||
$code .= $this->addNewInstance($id, $sDefinition, '$'.$name, ' = ');
|
||||
|
||||
if (!$this->hasReference($id, $sDefinition->getMethodCalls(), true) && !$this->hasReference($id, $sDefinition->getProperties(), true)) {
|
||||
$code .= $this->addServiceMethodCalls(null, $sDefinition, $name);
|
||||
$code .= $this->addServiceProperties(null, $sDefinition, $name);
|
||||
$code .= $this->addServiceMethodCalls(null, $sDefinition, $name);
|
||||
$code .= $this->addServiceConfigurator(null, $sDefinition, $name);
|
||||
}
|
||||
|
||||
|
@ -374,7 +375,7 @@ class PhpDumper extends Dumper
|
|||
* @throws InvalidArgumentException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
private function addServiceInstance($id, $definition)
|
||||
private function addServiceInstance($id, Definition $definition)
|
||||
{
|
||||
$class = $definition->getClass();
|
||||
|
||||
|
@ -424,7 +425,7 @@ class PhpDumper extends Dumper
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isSimpleInstance($id, $definition)
|
||||
private function isSimpleInstance($id, Definition $definition)
|
||||
{
|
||||
foreach (array_merge(array($definition), $this->getInlinedDefinitions($definition)) as $sDefinition) {
|
||||
if ($definition !== $sDefinition && !$this->hasReference($id, $sDefinition->getMethodCalls())) {
|
||||
|
@ -448,7 +449,7 @@ class PhpDumper extends Dumper
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
private function addServiceMethodCalls($id, $definition, $variableName = 'instance')
|
||||
private function addServiceMethodCalls($id, Definition $definition, $variableName = 'instance')
|
||||
{
|
||||
$calls = '';
|
||||
foreach ($definition->getMethodCalls() as $call) {
|
||||
|
@ -463,7 +464,7 @@ class PhpDumper extends Dumper
|
|||
return $calls;
|
||||
}
|
||||
|
||||
private function addServiceProperties($id, $definition, $variableName = 'instance')
|
||||
private function addServiceProperties($id, Definition $definition, $variableName = 'instance')
|
||||
{
|
||||
$code = '';
|
||||
foreach ($definition->getProperties() as $name => $value) {
|
||||
|
@ -483,7 +484,7 @@ class PhpDumper extends Dumper
|
|||
*
|
||||
* @throws ServiceCircularReferenceException when the container contains a circular reference
|
||||
*/
|
||||
private function addServiceInlinedDefinitionsSetup($id, $definition)
|
||||
private function addServiceInlinedDefinitionsSetup($id, Definition $definition)
|
||||
{
|
||||
$this->referenceVariables[$id] = new Variable('instance');
|
||||
|
||||
|
@ -506,8 +507,8 @@ class PhpDumper extends Dumper
|
|||
}
|
||||
|
||||
$name = (string) $this->definitionVariables->offsetGet($iDefinition);
|
||||
$code .= $this->addServiceMethodCalls(null, $iDefinition, $name);
|
||||
$code .= $this->addServiceProperties(null, $iDefinition, $name);
|
||||
$code .= $this->addServiceMethodCalls(null, $iDefinition, $name);
|
||||
$code .= $this->addServiceConfigurator(null, $iDefinition, $name);
|
||||
}
|
||||
|
||||
|
@ -527,7 +528,7 @@ class PhpDumper extends Dumper
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
private function addServiceConfigurator($id, $definition, $variableName = 'instance')
|
||||
private function addServiceConfigurator($id, Definition $definition, $variableName = 'instance')
|
||||
{
|
||||
if (!$callable = $definition->getConfigurator()) {
|
||||
return '';
|
||||
|
@ -559,7 +560,7 @@ class PhpDumper extends Dumper
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
private function addService($id, $definition)
|
||||
private function addService($id, Definition $definition)
|
||||
{
|
||||
$this->definitionVariables = new \SplObjectStorage();
|
||||
$this->referenceVariables = array();
|
||||
|
@ -570,22 +571,22 @@ class PhpDumper extends Dumper
|
|||
if ($definition->isSynthetic()) {
|
||||
$return[] = '@throws RuntimeException always since this service is expected to be injected dynamically';
|
||||
} elseif ($class = $definition->getClass()) {
|
||||
$return[] = sprintf('@return %s A %s instance.', 0 === strpos($class, '%') ? 'object' : '\\'.ltrim($class, '\\'), ltrim($class, '\\'));
|
||||
$return[] = sprintf('@return %s A %s instance', 0 === strpos($class, '%') ? 'object' : '\\'.ltrim($class, '\\'), ltrim($class, '\\'));
|
||||
} elseif ($definition->getFactory()) {
|
||||
$factory = $definition->getFactory();
|
||||
if (is_string($factory)) {
|
||||
$return[] = sprintf('@return object An instance returned by %s().', $factory);
|
||||
$return[] = sprintf('@return object An instance returned by %s()', $factory);
|
||||
} elseif (is_array($factory) && (is_string($factory[0]) || $factory[0] instanceof Definition || $factory[0] instanceof Reference)) {
|
||||
if (is_string($factory[0]) || $factory[0] instanceof Reference) {
|
||||
$return[] = sprintf('@return object An instance returned by %s::%s().', (string) $factory[0], $factory[1]);
|
||||
$return[] = sprintf('@return object An instance returned by %s::%s()', (string) $factory[0], $factory[1]);
|
||||
} elseif ($factory[0] instanceof Definition) {
|
||||
$return[] = sprintf('@return object An instance returned by %s::%s().', $factory[0]->getClass(), $factory[1]);
|
||||
$return[] = sprintf('@return object An instance returned by %s::%s()', $factory[0]->getClass(), $factory[1]);
|
||||
}
|
||||
}
|
||||
} elseif ($definition->getFactoryClass(false)) {
|
||||
$return[] = sprintf('@return object An instance returned by %s::%s().', $definition->getFactoryClass(false), $definition->getFactoryMethod(false));
|
||||
$return[] = sprintf('@return object An instance returned by %s::%s()', $definition->getFactoryClass(false), $definition->getFactoryMethod(false));
|
||||
} elseif ($definition->getFactoryService(false)) {
|
||||
$return[] = sprintf('@return object An instance returned by %s::%s().', $definition->getFactoryService(false), $definition->getFactoryMethod(false));
|
||||
$return[] = sprintf('@return object An instance returned by %s::%s()', $definition->getFactoryService(false), $definition->getFactoryMethod(false));
|
||||
}
|
||||
|
||||
$scope = $definition->getScope(false);
|
||||
|
@ -682,8 +683,8 @@ EOF;
|
|||
$this->addServiceInlinedDefinitions($id, $definition).
|
||||
$this->addServiceInstance($id, $definition).
|
||||
$this->addServiceInlinedDefinitionsSetup($id, $definition).
|
||||
$this->addServiceMethodCalls($id, $definition).
|
||||
$this->addServiceProperties($id, $definition).
|
||||
$this->addServiceMethodCalls($id, $definition).
|
||||
$this->addServiceConfigurator($id, $definition).
|
||||
$this->addServiceReturn($id, $definition)
|
||||
;
|
||||
|
@ -977,6 +978,26 @@ EOF;
|
|||
throw new LogicException('You cannot compile a dumped frozen container.');
|
||||
}
|
||||
|
||||
EOF;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the isFrozen method for a frozen container.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function addIsFrozenMethod()
|
||||
{
|
||||
return <<<EOF
|
||||
|
||||
/*{$this->docStar}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isFrozen()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
EOF;
|
||||
}
|
||||
|
||||
|
@ -1123,7 +1144,7 @@ EOF;
|
|||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
private function exportParameters($parameters, $path = '', $indent = 12)
|
||||
private function exportParameters(array $parameters, $path = '', $indent = 12)
|
||||
{
|
||||
$php = array();
|
||||
foreach ($parameters as $key => $value) {
|
||||
|
@ -1288,10 +1309,17 @@ EOF;
|
|||
return true;
|
||||
}
|
||||
|
||||
if ($deep && !isset($visited[$argumentId])) {
|
||||
if ($deep && !isset($visited[$argumentId]) && 'service_container' !== $argumentId) {
|
||||
$visited[$argumentId] = true;
|
||||
|
||||
$service = $this->container->getDefinition($argumentId);
|
||||
|
||||
// if the proxy manager is enabled, disable searching for references in lazy services,
|
||||
// as these services will be instantiated lazily and don't have direct related references.
|
||||
if ($service->isLazy() && !$this->getProxyDumper() instanceof NullDumper) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$arguments = array_merge($service->getMethodCalls(), $service->getArguments(), $service->getProperties());
|
||||
|
||||
if ($this->hasReference($id, $arguments, $deep, $visited)) {
|
||||
|
|
|
@ -286,7 +286,7 @@ class XmlDumper extends Dumper
|
|||
* @param \DOMElement $parent
|
||||
* @param string $keyAttribute
|
||||
*/
|
||||
private function convertParameters($parameters, $type, \DOMElement $parent, $keyAttribute = 'key')
|
||||
private function convertParameters(array $parameters, $type, \DOMElement $parent, $keyAttribute = 'key')
|
||||
{
|
||||
$withKeys = array_keys($parameters) !== range(0, count($parameters) - 1);
|
||||
foreach ($parameters as $key => $value) {
|
||||
|
@ -335,7 +335,7 @@ class XmlDumper extends Dumper
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
private function escape($arguments)
|
||||
private function escape(array $arguments)
|
||||
{
|
||||
$args = array();
|
||||
foreach ($arguments as $k => $v) {
|
||||
|
|
|
@ -188,7 +188,7 @@ class YamlDumper extends Dumper
|
|||
return sprintf(" %s: '@%s'\n", $alias, $id);
|
||||
}
|
||||
|
||||
return sprintf(" %s:\n alias: %s\n public: false", $alias, $id);
|
||||
return sprintf(" %s:\n alias: %s\n public: false\n", $alias, $id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -327,7 +327,7 @@ class YamlDumper extends Dumper
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
private function prepareParameters($parameters, $escape = true)
|
||||
private function prepareParameters(array $parameters, $escape = true)
|
||||
{
|
||||
$filtered = array();
|
||||
foreach ($parameters as $key => $value) {
|
||||
|
@ -350,7 +350,7 @@ class YamlDumper extends Dumper
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
private function escape($arguments)
|
||||
private function escape(array $arguments)
|
||||
{
|
||||
$args = array();
|
||||
foreach ($arguments as $k => $v) {
|
||||
|
|
Reference in a new issue