Commit 73c6d441 authored by Guillaume Perréal's avatar Guillaume Perréal

Par défaut, utilise le filtre de sélection des entrées pour la décoration.

parent c89ed3ec
......@@ -106,13 +106,15 @@ class GenerateCommand extends ContainerAwareCommand
$config = $graphs[$name];
list($finder, $filter) = $this->buildFinder($config['sources']);
$graph = new Graph(
new ClassVisitor(
$this->buildDecorator($config['decoration']),
$this->buildDecorator($config['decoration'], $filter),
$this->buildFilter($config['layout']),
$this->buildNamespace($config['layout']['namespaces'])
),
$this->buildFinder($config['sources'])
$finder
);
$graph->visitAll();
......@@ -138,10 +140,10 @@ class GenerateCommand extends ContainerAwareCommand
$filter = $this->buildFilter($config);
if (!$filter) {
return $finder;
return [$finder, null];
}
return new FilteringFinder($finder, $filter);
return [new FilteringFinder($finder, $filter), $filter];
}
/**
......@@ -169,7 +171,7 @@ class GenerateCommand extends ContainerAwareCommand
* @return DecoratorInterface
* @throws RuntimeException
*/
protected function buildDecorator(array $config)
protected function buildDecorator(array $config, ClassFilterInterface $defaultFilter = null)
{
if (empty($config['decorators'])) {
return NullDecorator::instance();
......@@ -186,7 +188,7 @@ class GenerateCommand extends ContainerAwareCommand
$decorator = new CompositeDecorator($decorators);
}
$filter = $this->buildFilter($config);
$filter = $this->buildFilter($config) ?: $defaultFilter;
if ($filter) {
$decorator = new FilteringDecorator($decorator, $filter);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment