Skip to content

Commit

Permalink
Version information is now printed when installed via composer or run…
Browse files Browse the repository at this point in the history
… from a Git clone (request #20050)
  • Loading branch information
gsherwood committed Sep 5, 2013
1 parent bec30bc commit 44b0a9e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
14 changes: 14 additions & 0 deletions CodeSniffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@
class PHP_CodeSniffer
{

/**
* The current version.
*
* @var string
*/
const VERSION = '1.4.7';

/**
* Package stability; either stable or beta.
*
* @var string
*/
const STABILITY = 'stable';

/**
* The file or directory that is currently being processed.
*
Expand Down
5 changes: 3 additions & 2 deletions CodeSniffer/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ public function processLongArgument($arg, $pos, $values)
exit(0);
break;
case 'version':
echo 'PHP_CodeSniffer version @package_version@ (@package_state@) ';
echo 'by Squiz Pty Ltd. (http://www.squiz.com.au)'.PHP_EOL;
$phpcs = new PHP_CodeSniffer();
echo 'PHP_CodeSniffer version '.$phpcs::VERSION.' ('.$phpcs::STABILITY.') ';
echo 'by Squiz (http://www.squiz.net)'.PHP_EOL;
exit(0);
break;
case 'config-set':
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<notes>
- Added support for the PHP 5.4 callable type hint
- Fixed problem where some file content could be ignored when checking STDIN
- Version information is now printed when installed via composer or run from a Git clone (request #20050)
- PEAR MultiLineConditionSniff now has a setting to specify how many spaces code should be indented
-- Default remains at 4; override the 'indent' setting in a ruleset.xml file to change
-- Thanks to Szabolcs Sulik for the patch
Expand Down Expand Up @@ -2215,7 +2216,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
</dir>
<file baseinstalldir="PHP" name="CLI.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
<tasks:replace from="@package_state@" to="state" type="package-info" />
</file>
<file baseinstalldir="PHP" name="Exception.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
Expand Down

0 comments on commit 44b0a9e

Please sign in to comment.