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

1 call to ContainerBuilder::resolveServices()
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 814

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 (is_object($value) && $value instanceof Reference) {
    $value = $this
      ->get((string) $value, $value
      ->getInvalidBehavior());
  }
  elseif (is_object($value) && $value instanceof Definition) {
    $value = $this
      ->createService($value, null);
  }
  return $value;
}