Skip to content

Commit

Permalink
Set $values['standard'] is set when generator is.
Browse files Browse the repository at this point in the history
This is to fix the following from happening:

    $ phpcs --generator=Markdown .
    PHP Warning:  Invalid argument supplied for foreach() in /usr/share/php/PHP/CodeSniffer/CLI.php on line 789
    PHP Stack trace:
    PHP   1. {main}() /usr/bin/phpcs:0
    PHP   2. PHP_CodeSniffer_CLI->runphpcs() /usr/bin/phpcs:25
    PHP   3. PHP_CodeSniffer_CLI->process() /usr/share/php/PHP/CodeSniffer/CLI.php:95
  • Loading branch information
kenguest committed Nov 19, 2015
1 parent e16cf78 commit 168804c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CodeSniffer/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,9 @@ public function process($values=array())

if ($values['generator'] !== '') {
$phpcs = new PHP_CodeSniffer($values['verbosity']);
if (is_null($values['standard'])) {
$values['standard'] = $this->validateStandard(null);
}
foreach ($values['standard'] as $standard) {
$phpcs->generateDocs(
$standard,
Expand Down

0 comments on commit 168804c

Please sign in to comment.