Skip to content

Commit

Permalink
Change newline char in bin/phpca
Browse files Browse the repository at this point in the history
  • Loading branch information
wapmorgan committed May 4, 2015
1 parent 989af01 commit 48da30a
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions bin/phpca
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
#!/usr/bin/php
<?php
// ? create-project installation : require installation
$vendor_dir = is_dir(dirname(dirname((__FILE__))).'/vendor') ? dirname(dirname((__FILE__))).'/vendor' : dirname(dirname(dirname(dirname(__FILE__))));
require $vendor_dir.'/autoload.php';

use wapmorgan\PhpCodeAnalyzer\PhpCodeAnalyzer;

$doc = <<<DOC
Usage:
phpca [-v] [--no-report] [--no-progress] [FILES ...]
phpca [-v] --extension=<ext> [FILES ...]
phpca -h
Options:
-h --help Show this text
-v --verbose Show more debug text
--extension=<ext> Look for usage a specific extension
--no-report Turn off summary report
--no-progress Turn off progress
DOC;

$args = Docopt::handle($doc);

if (isset($args['--verbose']) && $args['--verbose'])
$_ENV['verbose'] = true;
else
$_ENV['verbose'] = false;

if (isset($args['--no-progress']) && $args['--no-progress'])
$_ENV['--no-progress'] = true;
else
$_ENV['--no-progress'] = false;

$analyzer = new PhpCodeAnalyzer();
if (isset($args['--extension']))
$analyzer->loadOneExtensionData($args['--extension']);
else
$analyzer->loadData();

if (!empty($args['FILES'])) {
foreach ($args['FILES'] as $file) {
if (is_dir($file)) {
$analyzer->analyzeDir($file);
} else {
$analyzer->analyzeFile($file);
}
}
if ((!isset($args['--no-report']) || !$args['--no-report']) && !isset($args['--extension'])) {
echo PHP_EOL;
$analyzer->printUsedExtensions();
}
#!/usr/bin/php
<?php
// ? create-project installation : require installation
$vendor_dir = is_dir(dirname(dirname((__FILE__))).'/vendor') ? dirname(dirname((__FILE__))).'/vendor' : dirname(dirname(dirname(dirname(__FILE__))));
require $vendor_dir.'/autoload.php';

use wapmorgan\PhpCodeAnalyzer\PhpCodeAnalyzer;

$doc = <<<DOC
Usage:
phpca [-v] [--no-report] [--no-progress] [FILES ...]
phpca [-v] --extension=<ext> [FILES ...]
phpca -h
Options:
-h --help Show this text
-v --verbose Show more debug text
--extension=<ext> Look for usage a specific extension
--no-report Turn off summary report
--no-progress Turn off progress
DOC;

$args = Docopt::handle($doc);

if (isset($args['--verbose']) && $args['--verbose'])
$_ENV['verbose'] = true;
else
$_ENV['verbose'] = false;

if (isset($args['--no-progress']) && $args['--no-progress'])
$_ENV['--no-progress'] = true;
else
$_ENV['--no-progress'] = false;

$analyzer = new PhpCodeAnalyzer();
if (isset($args['--extension']))
$analyzer->loadOneExtensionData($args['--extension']);
else
$analyzer->loadData();

if (!empty($args['FILES'])) {
foreach ($args['FILES'] as $file) {
if (is_dir($file)) {
$analyzer->analyzeDir($file);
} else {
$analyzer->analyzeFile($file);
}
}
if ((!isset($args['--no-report']) || !$args['--no-report']) && !isset($args['--extension'])) {
echo PHP_EOL;
$analyzer->printUsedExtensions();
}
}

0 comments on commit 48da30a

Please sign in to comment.