예제 #1
0
 protected function executeOnPHPFile(File $file)
 {
     $command = "echo " . escapeshellarg($file->getContent()) . " | php -l 2>&1";
     exec($command, $output, $returnVal);
     if ($returnVal == 255 && $output) {
         $this->pushError(str_replace(' -', " " . $file->getPath(), implode(',', $output)));
     }
 }
예제 #2
0
 protected function executeOnPHPFile(File $file)
 {
     $code_sniffer = new \PHP_CodeSniffer($this->phpcs_verbosity, $this->phpcs_tab_width, $this->phpcs_encoding, self::PHPCS_NOT_INTERACTIVE_MODE);
     //Load the standard
     $code_sniffer->process(array(), $this->standard, array());
     $file_result = $code_sniffer->processFile($file->getPath(), $file->getContent());
     if ($file_result->getErrorCount()) {
         $this->handlePHPCSErrors($file, $file_result);
     }
 }