From: Michael Wallner Date: Thu, 3 Sep 2015 10:51:49 +0000 (+0200) Subject: s/CliArgs/Cli\Args/g X-Git-Tag: v4.1.0~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ef9078606945dbc55d85a50614bbc25734aa378a;p=pharext%2Fpharext s/CliArgs/Cli\Args/g --- diff --git a/src/pharext/Cli/Args.php b/src/pharext/Cli/Args.php index 2c148bf..c248a74 100644 --- a/src/pharext/Cli/Args.php +++ b/src/pharext/Cli/Args.php @@ -79,7 +79,7 @@ class Args implements \ArrayAccess /** * Compile the original spec * @param array|Traversable $spec - * @return pharext\CliArgs self + * @return pharext\Cli\Args self */ public function compile($spec) { foreach ($spec as $arg) { @@ -118,7 +118,7 @@ class Args implements \ArrayAccess * * The Generator yields any parsing errors. * Parsing will stop when all arguments are processed or the first option - * flagged CliArgs::HALT was encountered. + * flagged Cli\Args::HALT was encountered. * * @param int $argc * @param array $argv diff --git a/src/pharext/Cli/Command.php b/src/pharext/Cli/Command.php index e8d0ee0..01c50c4 100644 --- a/src/pharext/Cli/Command.php +++ b/src/pharext/Cli/Command.php @@ -3,7 +3,6 @@ namespace pharext\Cli; use pharext\Archive; -use pharext\Cli\Args as CliArgs; use Phar; @@ -11,7 +10,7 @@ trait Command { /** * Command line arguments - * @var pharext\CliArgs + * @var pharext\Cli\Args */ private $args; diff --git a/src/pharext/Command.php b/src/pharext/Command.php index 7664a35..0d30b55 100644 --- a/src/pharext/Command.php +++ b/src/pharext/Command.php @@ -30,7 +30,7 @@ interface Command /** * Retrieve command line arguments - * @return pharext\CliArgs + * @return pharext\Cli\Args */ public function getArgs(); diff --git a/src/pharext/Installer.php b/src/pharext/Installer.php index b5dba6d..4b9f87a 100644 --- a/src/pharext/Installer.php +++ b/src/pharext/Installer.php @@ -2,7 +2,6 @@ namespace pharext; -use pharext\Cli\Args as CliArgs; use pharext\Cli\Command as CliCommand; use Phar; @@ -25,37 +24,37 @@ class Installer implements Command * Create the command */ public function __construct() { - $this->args = new CliArgs([ + $this->args = new Cli\Args([ ["h", "help", "Display help", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], ["v", "verbose", "More output", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG], ["q", "quiet", "Less output", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG], ["p", "prefix", "PHP installation prefix if phpize is not in \$PATH, e.g. /opt/php7", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::REQARG], ["n", "common-name", "PHP common program name, e.g. php5 or zts-php", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG, + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::REQARG, "php"], ["c", "configure", "Additional extension configure flags, e.g. -c --with-flag", - CliArgs::OPTIONAL|CliArgs::MULTI|CliArgs::REQARG], + Cli\Args::OPTIONAL|Cli\Args::MULTI|Cli\Args::REQARG], ["s", "sudo", "Installation might need increased privileges", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::OPTARG, + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::OPTARG, "sudo -S %s"], ["i", "ini", "Activate in this php.ini instead of loaded default php.ini", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::REQARG], [null, "signature", "Show package signature", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], [null, "license", "Show package license", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], [null, "name", "Show package name", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], [null, "date", "Show package release date", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], [null, "release", "Show package release version", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], [null, "version", "Show pharext version", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], ]); } diff --git a/src/pharext/Packager.php b/src/pharext/Packager.php index 10542e4..c648d8a 100644 --- a/src/pharext/Packager.php +++ b/src/pharext/Packager.php @@ -3,7 +3,6 @@ namespace pharext; use Phar; -use pharext\Cli\Args as CliArgs; use pharext\Cli\Command as CliCommand; use pharext\Exception; @@ -30,42 +29,42 @@ class Packager implements Command * Create the command */ public function __construct() { - $this->args = new CliArgs([ + $this->args = new Cli\Args([ ["h", "help", "Display this help", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], ["v", "verbose", "More output", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG], ["q", "quiet", "Less output", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG], ["n", "name", "Extension name", - CliArgs::REQUIRED|CliArgs::SINGLE|CliArgs::REQARG], + Cli\Args::REQUIRED|Cli\Args::SINGLE|Cli\Args::REQARG], ["r", "release", "Extension release version", - CliArgs::REQUIRED|CliArgs::SINGLE|CliArgs::REQARG], + Cli\Args::REQUIRED|Cli\Args::SINGLE|Cli\Args::REQARG], ["s", "source", "Extension source directory", - CliArgs::REQUIRED|CliArgs::SINGLE|CliArgs::REQARG], + Cli\Args::REQUIRED|Cli\Args::SINGLE|Cli\Args::REQARG], ["g", "git", "Use `git ls-tree` to determine file list", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG], ["b", "branch", "Checkout this tag/branch", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::REQARG], ["p", "pecl", "Use PECL package.xml to determine file list, name and release", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG], ["d", "dest", "Destination directory", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG, + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::REQARG, "."], ["z", "gzip", "Create additional PHAR compressed with gzip", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG], ["Z", "bzip", "Create additional PHAR compressed with bzip", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG], ["S", "sign", "Sign the PHAR with a private key", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::REQARG], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::REQARG], ["E", "zend", "Mark as Zend Extension", - CliArgs::OPTIONAL|CliARgs::SINGLE|CliArgs::NOARG], + Cli\Args::OPTIONAL|CliARgs::SINGLE|Cli\Args::NOARG], [null, "signature", "Show pharext signature", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], [null, "license", "Show pharext license", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], [null, "version", "Show pharext version", - CliArgs::OPTIONAL|CliArgs::SINGLE|CliArgs::NOARG|CliArgs::HALT], + Cli\Args::OPTIONAL|Cli\Args::SINGLE|Cli\Args::NOARG|Cli\Args::HALT], ]); } @@ -107,8 +106,8 @@ class Packager implements Command } try { - /* source needs to be evaluated before CliArgs validation, - * so e.g. name and version can be overriden and CliArgs + /* source needs to be evaluated before Cli\Args validation, + * so e.g. name and version can be overriden and Cli\Args * does not complain about missing arguments */ $this->loadSource();