- /**
- * Processes service definitions for arguments to find relationships for the service graph.
- *
- * @param array $arguments An array of Reference or Definition objects relating to service definitions
- */
- private function processArguments(array $arguments)
- {
- foreach ($arguments as $argument) {
- if (is_array($argument)) {
- $this->processArguments($argument);
- } elseif ($argument instanceof Reference) {
- $this->graph->connect(
- $this->currentId,
- $this->currentDefinition,
- $this->getDefinitionId((string) $argument),
- $this->getDefinition((string) $argument),
- $argument
- );
- } elseif ($argument instanceof Definition) {
- $this->processArguments($argument->getArguments());
- $this->processArguments($argument->getMethodCalls());
- $this->processArguments($argument->getProperties());
-
- if (is_array($argument->getFactory())) {
- $this->processArguments($argument->getFactory());
- }
- if ($argument->getFactoryService(false)) {
- $this->processArguments(array(new Reference($argument->getFactoryService(false))));
- }
+ return $value;
+ }
+ if ($value instanceof Reference) {
+ $targetId = $this->getDefinitionId((string) $value);
+ $targetDefinition = $this->getDefinition($targetId);
+
+ $this->graph->connect(
+ $this->currentId,
+ $this->currentDefinition,
+ $targetId,
+ $targetDefinition,
+ $value,
+ $this->lazy || ($targetDefinition && $targetDefinition->isLazy()),
+ ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $value->getInvalidBehavior()
+ );
+
+ return $value;
+ }
+ if (!$value instanceof Definition) {
+ return parent::processValue($value, $isRoot);
+ }
+ if ($isRoot) {
+ if ($value->isSynthetic() || $value->isAbstract()) {
+ return $value;