diff --git a/src/ArgvParser.php b/src/ArgvParser.php index 23bd136..ee26a9a 100644 --- a/src/ArgvParser.php +++ b/src/ArgvParser.php @@ -34,8 +34,8 @@ class ArgvParser public function __construct($name, $desc = null, $allowUnknown = false) { - $this->_name = $name; - $this->_desc = $desc; + $this->_name = $name; + $this->_desc = $desc; $this->_allowUnknown = $allowUnknown; $this->addDefaultOptions(); @@ -65,7 +65,7 @@ public function option($cmd, $desc = '', callable $filter = null, $default = nul } $this->_values[$option->attributeName()] = $option->default(); - $this->_options[$option->long()] = $option; + $this->_options[$option->long()] = $option; return $this; } @@ -83,7 +83,7 @@ public function parse(array $argv) { \array_shift($argv); - $argv = $this->normalize($argv); + $argv = $this->normalize($argv); $count = \count($argv); for ($i = 0; $i < $count; $i++) { @@ -110,10 +110,10 @@ protected function parseArgs($arg) protected function parseOptions($arg, $nextArg, &$i) { - $value = \substr($nextArg, 0, 1) === '-' ? null : $nextArg; + $value = \substr($nextArg, 0, 1) === '-' ? null : $nextArg; $isValue = $value !== null; - $this->_lastOption = $option = $this->optionFor($arg); + $this->_lastOption = $option = $this->optionFor($arg); $this->_wasVariadic = $option ? $option->variadic() : false; if (!$option) { diff --git a/src/Color.php b/src/Color.php index 47e4707..2e3b706 100644 --- a/src/Color.php +++ b/src/Color.php @@ -12,10 +12,10 @@ */ class Color { - const FG_RED = 31; - const FG_GREEN = 32; + const FG_RED = 31; + const FG_GREEN = 32; const FG_YELLOW = 33; - const FG_BLUE = 36; + const FG_BLUE = 36; // @todo protected static $format = "\033[:bold:;:fg:;:bg:m:text:\033[0m"; diff --git a/src/Option.php b/src/Option.php index c553da5..c529ff4 100644 --- a/src/Option.php +++ b/src/Option.php @@ -32,9 +32,9 @@ class Option public function __construct($cmd, $desc = '', $default = null, callable $filter = null) { - $this->desc = $desc; - $this->default = $default; - $this->filter = $filter; + $this->desc = $desc; + $this->default = $default; + $this->filter = $filter; $this->required = \strpos($cmd, '<') !== false; $this->optional = \strpos($cmd, '[') !== false; diff --git a/tests/ArgvParserTest.php b/tests/ArgvParserTest.php index 3412b41..0bee513 100644 --- a/tests/ArgvParserTest.php +++ b/tests/ArgvParserTest.php @@ -11,7 +11,7 @@ public function test_new() { $p = new ArgvParser('ArgvParser'); - $p->version('0.0.'.rand(1, 10)); + $p->version('0.0.' . rand(1, 10)); $data = $this->data(); foreach ($data['options'] as $option) { @@ -36,6 +36,6 @@ public function test_new() public function data() { - return require __DIR__.'/fixture.php'; + return require __DIR__ . '/fixture.php'; } } diff --git a/tests/OptionTest.php b/tests/OptionTest.php index ecb67a8..e2756cd 100644 --- a/tests/OptionTest.php +++ b/tests/OptionTest.php @@ -51,7 +51,7 @@ public function test_filter() $this->assertSame(10, $o->filter('10')); $in = 'apple'; - $o = new Option('-f, --fruit', 'Age', 'orange', 'strtoupper'); + $o = new Option('-f, --fruit', 'Age', 'orange', 'strtoupper'); $this->assertNotSame($o->filter($in), $in); $this->assertSame('APPLE', $o->filter($in)); @@ -64,7 +64,7 @@ public function test_filter() public function data() { - $f = require __DIR__.'/fixture.php'; + $f = require __DIR__ . '/fixture.php'; return $f['options']; } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index e91cc12..6c8c4f5 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,3 +1,3 @@