Added findBinary, fixes #115

This commit is contained in:
Dan Cryer 2013-10-08 08:50:10 +01:00
commit 0c8d9c0f74
12 changed files with 112 additions and 33 deletions

View file

@ -105,7 +105,14 @@ class PhpCodeSniffer implements \PHPCI\Plugin
$encoding = ' --encoding='.$this->encoding;
}
$cmd = PHPCI_BIN_DIR . 'phpcs %s %s %s %s %s "%s"';
$phpcs = $this->phpci->findBinary('phpcs');
if (!$phpcs) {
$this->phpci->logFailure('Could not find phpcs.');
return false;
}
$cmd = $phpcs . ' %s %s %s %s %s "%s"';
$success = $this->phpci->executeCommand($cmd, $standard, $suffixes, $ignore, $tab_width, $encoding, $this->phpci->buildPath . $this->path);
$output = $this->phpci->getLastOutput();