Skip to content

Commit

Permalink
Coding standard fixes + changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Dec 3, 2013
1 parent 811261b commit 4426c2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 3 additions & 7 deletions CodeSniffer/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class PHP_CodeSniffer_CLI
*/
public $dieOnUnknownArg = true;


/**
* Exits if the minimum requirements of PHP_CodSniffer are not met.
*
Expand Down Expand Up @@ -271,6 +272,7 @@ public function processShortArgument($arg, $pos, $values)
} else {
ini_set($ini[0], true);
}

break;
case 'n' :
$values['warningSeverity'] = 0;
Expand Down Expand Up @@ -303,28 +305,23 @@ public function processLongArgument($arg, $pos, $values)
case 'help':
$this->printUsage();
exit(0);
break;
case 'version':
echo 'PHP_CodeSniffer version '.PHP_CodeSniffer::VERSION.' ('.PHP_CodeSniffer::STABILITY.') ';
echo 'by Squiz (http://www.squiz.net)'.PHP_EOL;
exit(0);
break;
case 'config-set':
$key = $_SERVER['argv'][($pos + 1)];
$value = $_SERVER['argv'][($pos + 2)];
PHP_CodeSniffer::setConfigData($key, $value);
exit(0);
break;
case 'config-delete':
$key = $_SERVER['argv'][($pos + 1)];
PHP_CodeSniffer::setConfigData($key, null);
exit(0);
break;
case 'config-show':
$data = PHP_CodeSniffer::getAllConfigData();
print_r($data);
exit(0);
break;
case 'runtime-set':
$key = $_SERVER['argv'][($pos + 1)];
$value = $_SERVER['argv'][($pos + 2)];
Expand Down Expand Up @@ -817,10 +814,9 @@ public function printUsage()
echo ' [--report=<report>] [--report-file=<reportfile>] [--report-<report>=<reportfile>] ...'.PHP_EOL;
echo ' [--report-width=<reportWidth>] [--generator=<generator>] [--tab-width=<tabWidth>]'.PHP_EOL;
echo ' [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>]'.PHP_EOL;
echo ' [--config-set key value] [--config-delete key] [--config-show]'.PHP_EOL;
echo ' [--runtime-set key value] [--config-set key value] [--config-delete key] [--config-show]'.PHP_EOL;
echo ' [--standard=<standard>] [--sniffs=<sniffs>] [--encoding=<encoding>]'.PHP_EOL;
echo ' [--extensions=<extensions>] [--ignore=<patterns>] <file> ...'.PHP_EOL;
echo ' --runtime-set key value'.PHP_EOL;
echo ' Set runtime value (see --config-set) '.PHP_EOL;
echo ' -n Do not print warnings (shortcut for --warning-severity=0)'.PHP_EOL;
echo ' -w Print both warnings and errors (on by default)'.PHP_EOL;
Expand Down
3 changes: 3 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
</stability>
<license uri="https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt">BSD 3-Clause License</license>
<notes>
- Config values can now be set at runtime using the command line argument [--runtime-set key value]
-- Runtime values are the same as config values, but are not written to the main config file
-- Thanks to Wim Godden for the patch
- Generic ForbiddenFunctionsSniff now ignores object creation
-- This is a further fix for bug #20100 : incorrect Function mysql() has been deprecated report
- Fixed bug #20136 : Squiz_Sniffs_WhiteSpace_ScopeKeywordSpacingSniff and Traits
Expand Down

0 comments on commit 4426c2c

Please sign in to comment.