Exemplo n.º 1
0
 /**
  * @param string $path
  * @param array $config
  * @param AbstractLogger $logger
  * @return Result
  */
 private function executeGadgets($path, array $config, AbstractLogger $logger)
 {
     $result = new Result();
     foreach ($config as $type => $options) {
         $gadget = $this->repository->get($type);
         $gadgetResult = $this->executeGadget($gadget, $path, $options, $logger);
         $result->merge($gadgetResult);
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * @param RepositoryInterface $repository
  * @return NodeInterface
  */
 public function createTree(RepositoryInterface $repository)
 {
     $builder = new TreeBuilder();
     $rootNode = $builder->root('simpspector', 'array', new NodeBuilder());
     $children = $rootNode->children();
     foreach ($repository->all() as $gadget) {
         $gadgetNode = $children->arrayNode($gadget->getName());
         $gadget->configure($gadgetNode);
     }
     return $builder->buildTree();
 }