getFilepath() public method

public getFilepath ( ) : string
return string
コード例 #1
0
ファイル: Context.php プロジェクト: necromant2005/phpsa
 /**
  * @param $type
  * @param $message
  * @param \PhpParser\NodeAbstract $expr
  * @return bool
  */
 public function notice($type, $message, \PhpParser\NodeAbstract $expr)
 {
     $code = file($this->scope->getFilepath());
     $this->output->writeln('<comment>Notice:  ' . $message . " in {$this->scope->getFilepath()} on {$expr->getLine()} [{$type}]</comment>");
     $this->output->writeln('');
     if ($this->application->getConfiguration()->valueIsTrue('blame')) {
         exec("git blame --show-email -L {$expr->getLine()},{$expr->getLine()} " . $this->scope->getFilepath(), $result);
         if ($result && isset($result[0])) {
             $result[0] = trim($result[0]);
             $this->output->writeln("<comment>\t {$result[0]}</comment>");
         }
     } else {
         $code = trim($code[$expr->getLine() - 1]);
         $this->output->writeln("<comment>\t {$code} </comment>");
     }
     $this->output->writeln('');
     unset($code);
     return true;
 }