/**
  * @param \SplFileInfo $patchFile
  * @param OutputInterface $output
  * @return array
  * @throws \Exception
  */
 private function loadRegex(\SplFileInfo $patchFile, OutputInterface $output)
 {
     $arr = array();
     try {
         $files = $this->fileLoader->load($patchFile);
     } catch (FileLoadException $e) {
         $output->writeln('<error>Regex patch load failed with message ' . $e->getMessage() . '</error>');
         return false;
     }
     foreach ($files as $filename => $content) {
         $output->writeln("Loaded file: {$filename}");
         $arr = array_merge_recursive($arr, $this->translator->translate($content));
     }
     if (!$arr) {
         $output->writeln("<error>No regexes were found</error>");
         return false;
     }
     return $arr;
 }
Beispiel #2
0
 /**
  * @param $testFile
  * @param OutputInterface $output
  * @return array
  */
 private function loadTestFiles($testFile, OutputInterface $output)
 {
     $loader = new FileLoader();
     $arr = array();
     foreach ($loader->load($testFile) as $file => $content) {
         if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
             $output->writeln("Loaded file: {$file}");
         }
         $arr = array_merge_recursive($this->yamlParser->parse(file_get_contents($file)), $arr);
     }
     return $arr;
 }