private function GraphvizDumper::findEdges in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php \Symfony\Component\DependencyInjection\Dumper\GraphvizDumper::findEdges()
Finds all edges belonging to a specific service id.
Parameters
string $id The service id used to find edges:
array $arguments An array of arguments:
bool $required:
string $name:
Return value
array An array of edges
1 call to GraphvizDumper::findEdges()
- GraphvizDumper::dump in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ GraphvizDumper.php - Dumps the service container as a graphviz graph.
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Dumper/ GraphvizDumper.php, line 133
Class
- GraphvizDumper
- GraphvizDumper dumps a service container as a graphviz file.
Namespace
Symfony\Component\DependencyInjection\DumperCode
private function findEdges($id, $arguments, $required, $name) {
$edges = array();
foreach ($arguments as $argument) {
if ($argument instanceof Parameter) {
$argument = $this->container
->hasParameter($argument) ? $this->container
->getParameter($argument) : null;
}
elseif (is_string($argument) && preg_match('/^%([^%]+)%$/', $argument, $match)) {
$argument = $this->container
->hasParameter($match[1]) ? $this->container
->getParameter($match[1]) : null;
}
if ($argument instanceof Reference) {
if (!$this->container
->has((string) $argument)) {
$this->nodes[(string) $argument] = array(
'name' => $name,
'required' => $required,
'class' => '',
'attributes' => $this->options['node.missing'],
);
}
$edges[] = array(
'name' => $name,
'required' => $required,
'to' => $argument,
);
}
elseif (is_array($argument)) {
$edges = array_merge($edges, $this
->findEdges($id, $argument, $required, $name));
}
}
return $edges;
}