示例#1
0
 /**
  * @return mixed
  */
 public function execute()
 {
     $result = $this->currentState->execute();
     if ($this->isValidState($result)) {
         return $this->changeState($result);
     }
     return $result;
 }
 /**
  * Generates the results to the libraryCheckResult by crawling among the
  * given file to find functions.
  * 
  * @param PhpLibraryCheckResult $result
  * @param string $file_path
  */
 public function scanFile(PhpLibraryCheckResult $result, $file_path)
 {
     echo "Checking file " . str_replace($this->_base_path, '__BASE__', $file_path) . "\n";
     $filehandle = fopen($file_path, 'r');
     $this->setState(new PhpLibraryCheckState($this));
     $i = 0;
     // line counter
     while (($line = fgets($filehandle)) !== false) {
         $i++;
         $this->_state->checkLine($result, $file_path, $line, $i);
     }
     fclose($filehandle);
 }