Пример #1
0
 /**
  * @param string $path
  * @return array
  */
 public function load($path)
 {
     $config = $this->loader->load($path);
     $tree = (new TreeFactory())->createTree($this->repository);
     $config = $tree->normalize($config);
     $config = $tree->finalize($config);
     return $config;
 }
Пример #2
0
 /**
  * @param string $path
  * @return array
  */
 public function load($path)
 {
     try {
         return $this->loader->load($path);
     } catch (MissingSimpSpectorConfigException $e) {
         return $this->loader->load($this->defaultConfigPath);
     }
 }
Пример #3
0
 /**
  * @param string $path
  * @return array
  */
 public function load($path)
 {
     try {
         return $this->loader->load($path);
     } catch (MissingSimpSpectorConfigException $e) {
         $path = str_replace('.simpspector.yml', 'simpspector.yml', $path);
         return $this->loader->load($path);
     }
 }
Пример #4
0
 /**
  * @param string $path
  * @param string|null $configFile
  * @param AbstractLogger $logger
  * @return Result
  */
 public function analyse($path, $configFile = null, AbstractLogger $logger = null)
 {
     $logger = $logger ?: new NullLogger();
     $path = Path::makeAbsolute($path, getcwd());
     if (!$configFile) {
         $configFile = Path::join([$path, '.simpspector.yml']);
     }
     $config = $this->loader->load($configFile);
     return $this->executor->run($path, $config, $logger);
 }
Пример #5
0
 /**
  * @param string $path
  * @param AbstractLogger $logger
  * @return Result
  */
 private function getResult($path, AbstractLogger $logger)
 {
     if (is_file($path)) {
         $logger->writeln(sprintf('import file "%s"', $path));
         return $this->importer->import($path);
     }
     $file = Path::join($path, '.simpspector.yml');
     $logger->writeln(sprintf('load config "%s"', $file));
     $config = $this->loader->load($file);
     $logger->writeln('execute gadgets');
     return $this->executor->run($path, $config, $logger);
 }