37 $this->reportFile = $reportFile;
45 $this->blacklist = $blackList;
57 exec($this->getCommand() .
' --version',
$output, $exitCode);
58 return $exitCode === 0;
69 public function run(array $whiteList)
71 $blacklistedDirs = [];
72 $blacklistedFileNames = [];
73 foreach ($this->blacklist as $file) {
74 $file = escapeshellarg(trim($file));
78 $ext = pathinfo($file, PATHINFO_EXTENSION);
80 $blacklistedFileNames[] = $file;
82 $blacklistedDirs[] =
'--exclude ' . $file .
' ';
86 $command = $this->getCommand() .
' --log-pmd ' . escapeshellarg($this->reportFile)
87 .
' --names-exclude ' . join(
',', $blacklistedFileNames) .
' --min-lines 13 ' . join(
' ', $blacklistedDirs)
88 .
' ' . implode(
' ', $whiteList);
91 return !(bool)$exitCode;
99 private function getCommand()
exec($command, array &$output=null, &$return_var=null)
if(!file_exists(VENDOR_PATH)) $vendorDir