Skip to content

Commit

Permalink
Add version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
wapmorgan committed May 9, 2019
1 parent 89d06ea commit 0efd0ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/phpca
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ require $vendor_dir.'/autoload.php';

use wapmorgan\PhpCodeAnalyzer\PhpCodeAnalyzer;

$version = file_exists(__DIR__.'/version.txt') ? trim(file_get_contents(__DIR__.'/version.txt')) : null;
$version = file_exists(__DIR__.'/version.txt') ? trim(file_get_contents(__DIR__.'/version.txt')) : PhpCodeAnalyzer::VERSION;
$doc = <<<DOC
PhpCodeAnalyzer $version
Usage:
phpca [-v] [-q] [--output=<path>] [--no-report] [--no-progress] [--since-version=<version>] FILES...
phpca [-v] [-q] [--output=<path>] --extension=<ext> FILES...
phpca -h
phpca --version
Options:
-h --help Show this text
-v --verbose Show more debug text
--version Show version.
-q --quiet Don't print any messages
--output=<path> Path where to generate XML report
--extension=<ext> Look for usage a specific extension
Expand All @@ -26,7 +28,7 @@ Options:
DOC;

$args = Docopt::handle($doc);
$args = Docopt::handle($doc, ['version' => $version]);

if (isset($args['--verbose']) && $args['--verbose'])
$_ENV['verbose'] = true;
Expand Down
2 changes: 2 additions & 0 deletions src/PhpCodeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ function array_filter_by_column($source, $needle, $column) {
}

class PhpCodeAnalyzer {
const VERSION = '1.0.6';

private $functionsSet = array();
private $classesSet = array();
private $constantsSet = array();
Expand Down

0 comments on commit 0efd0ab

Please sign in to comment.