private function GraphvizDumper::findNodes

Finds all nodes.

Return value

array An array of all nodes

1 call to GraphvizDumper::findNodes()
GraphvizDumper::dump in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php
Dumps the service container as a graphviz graph.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php, line 158

Class

GraphvizDumper
GraphvizDumper dumps a service container as a graphviz file.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

private function findNodes() {
  $nodes = array();
  $container = clone $this->container;
  foreach ($container
    ->getDefinitions() as $id => $definition) {
    $nodes[$id] = array(
      'class' => str_replace('\\', '\\\\', $this->container
        ->getParameterBag()
        ->resolveValue($definition
        ->getClass())),
      'attributes' => array_merge($this->options['node.definition'], array(
        'style' => ContainerInterface::SCOPE_PROTOTYPE !== $definition
          ->getScope() ? 'filled' : 'dotted',
      )),
    );
    $container
      ->setDefinition($id, new Definition('stdClass'));
  }
  foreach ($container
    ->getServiceIds() as $id) {
    $service = $container
      ->get($id);
    if (in_array($id, array_keys($container
      ->getAliases()))) {
      continue;
    }
    if (!$container
      ->hasDefinition($id)) {
      $nodes[$id] = array(
        'class' => str_replace('\\', '\\\\', get_class($service)),
        'attributes' => $this->options['node.instance'],
      );
    }
  }
  return $nodes;
}