public function ContainerBuilder::resolveServices

Replaces service references by the real service instance.

Parameters

mixed $value A value:

Return value

mixed The same value with all service references replaced by the real service instances

2 calls to ContainerBuilder::resolveServices()
ContainerBuilder::callMethod in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
ContainerBuilder::createService in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
Creates a service for a service definition.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php, line 1002

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

public function resolveServices($value) {
  if (is_array($value)) {
    foreach ($value as &$v) {
      $v = $this
        ->resolveServices($v);
    }
  }
  elseif ($value instanceof Reference) {
    $value = $this
      ->get((string) $value, $value
      ->getInvalidBehavior());
  }
  elseif ($value instanceof Definition) {
    $value = $this
      ->createService($value, null);
  }
  return $value;
}