Beispiel #1
0
 /**
  * @param array $files
  * @return Result
  */
 public function analyse(array $files)
 {
     foreach ($files as $file) {
         $this->currentFilePath = $file;
         $this->currentFile = [];
         $statements = $this->parser->parse(file_get_contents($file));
         if (is_array($statements) || $statements instanceof Node) {
             $this->traverser->traverse($statements);
         }
     }
     return $this->result;
 }
 /**
  * Run parser
  */
 private function runParser()
 {
     if (is_null($this->Parser)) {
         return;
     }
     $this->Parser->parse();
     if ($this->Parser->failed()) {
         $this->Errors = array_merge($this->Errors, $this->Parser->getErrors());
     }
     if ($this->numberOfTrainings() == 0) {
         $this->Errors[] = __('No activities could be found.');
     }
 }