diff --git a/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php index c578023..4c7fea9 100644 --- a/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php +++ b/core/lib/Drupal/Core/DependencyInjection/YamlFileLoader.php @@ -168,7 +168,7 @@ private function parseDefinition($id, $service, $file) } if (isset($service['synchronized'])) { - $definition->setSynchronized($service['synchronized']); + $definition->setSynchronized($service['synchronized'], 'request' !== $id); } if (isset($service['lazy'])) { @@ -188,12 +188,12 @@ private function parseDefinition($id, $service, $file) if (strpos($service['factory'], ':') !== false && strpos($service['factory'], '::') === false) { $parts = explode(':', $service['factory']); $definition->setFactory(array($this->resolveServices('@'.$parts[0]), $parts[1])); - } else { + } else { $definition->setFactory($service['factory']); + } + } else { + $definition->setFactory(array($this->resolveServices($service['factory'][0]), $service['factory'][1])); } - } else { - $definition->setFactory(array($this->resolveServices($service['factory'][0]), $service['factory'][1])); - } } if (isset($service['factory_class'])) { @@ -234,8 +234,15 @@ private function parseDefinition($id, $service, $file) } foreach ($service['calls'] as $call) { - $args = isset($call[1]) ? $this->resolveServices($call[1]) : array(); - $definition->addMethodCall($call[0], $args); + if (isset($call['method'])) { + $method = $call['method']; + $args = isset($call['arguments']) ? $this->resolveServices($call['arguments']) : array(); + } else { + $method = $call[0]; + $args = isset($call[1]) ? $this->resolveServices($call[1]) : array(); + } + + $definition->addMethodCall($method, $args); } }