Skip to content

Commit

Permalink
phpcs: support multiple standards. Close EdgedesignCZ#173
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhattan committed Jul 12, 2019
1 parent cc469fe commit 781e443
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Tools/Analyzer/Phpcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,18 @@ public function __invoke()
protected function buildPhpcs(array $installedStandards)
{
$this->tool->errorsType = $this->config->value('phpcs.ignoreWarnings') === true;
$standard = $this->config->value('phpcs.standard');
if (!in_array($standard, $installedStandards)) {
$standard = \Edge\QA\escapePath($this->config->path('phpcs.standard'));
$standards = $this->config->value('phpcs.standard');
if (!is_array($standards)) {
$standards = [$standards];
}
foreach ($standards as $standard) {
if (!in_array($standard, $installedStandards)) {
$standard = \Edge\QA\escapePath($this->config->path('phpcs.standard'));
}
}
$args = array(
'-p',
'standard' => $standard,
'standard' => implode(',', $standards),
$this->options->ignore->phpcs(),
$this->options->getAnalyzedDirs(' '),
'extensions' => $this->config->csv('extensions')
Expand Down

0 comments on commit 781e443

Please sign in to comment.