Exemplo n.º 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)));
     }
 }
Exemplo n.º 2
0
 private function prepareFileContent(File $file)
 {
     $byLine = array();
     $lineNo = 1;
     foreach (preg_split('/[(\\r\\n)|(\\n)|(\\n\\r)]/', $file->getContent()) as $line) {
         $byLine[$lineNo++] = $line;
     }
     return $byLine;
 }