Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Strip the cli prefix

  • Loading branch information...
commit d2392ede33f784af7d0654d8c6cf5cfc06830022 1 parent b73a65b
@walle walle authored
View
5 generate.php
@@ -57,7 +57,7 @@ function gettext($str)
}
// Start
-$cli = new cliCli('wsdl2php', '[OPTIONS] -i wsdlfile -o directory', '1.4.1');
+$cli = new Cli('wsdl2php', '[OPTIONS] -i wsdlfile -o directory', '1.4.1');
$cli->addFlag('-e', _('If all classes should be guarded with if(!class_exists) statements'), true, false);
$cli->addFlag('-t', _('If no type constructor should be generated'), true, false);
$cli->addFlag('-s', _('If the output should be a single file'), true, false);
@@ -179,4 +179,5 @@ function gettext($str)
$config = new wsdl2phpConfig($inputFile, $outputDir, $verbose, $singleFile, $classExists, $noTypeConstructor, $namespaceName, $optionsArray, $wsdlCache, $gzip, $classNames, $prefix, $suffix);
$generator = new wsdl2phpGenerator();
-$generator->generate($config);
+$generator->generate($config);
+
View
17 lib/cli/Cli.php
@@ -16,7 +16,7 @@
* @author Fredrik Wallgren <fredrik@wallgren.me>
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
-class cliCli extends cliCliParser
+class Cli extends CliParser
{
/**
*
@@ -41,7 +41,7 @@ class cliCli extends cliCliParser
* @var array An array of accepted Flags, all the flags that have a meaning
*/
private $acceptedFlags;
-
+
/**
*
* @var array An array of the requred Flag objects
@@ -72,7 +72,7 @@ public function __construct($programName, $usage, $version)
* @param string $description
* @param bool $isBool If the flag has to have a parameter
* @param bool $reqired If the flag is required
- *
+ *
* @throws Exception If the flag is already used
*
* @return void
@@ -98,8 +98,8 @@ public function addFlag($flag, $description, $isBool = false, $required = false)
}
// Not busy, add it
- $this->acceptedFlags[$flag] = new cliFlag($flag, $description, $isBool);
-
+ $this->acceptedFlags[$flag] = new Flag($flag, $description, $isBool);
+
if ($required)
{
$this->requiredFlags[$flag] = $this->acceptedFlags[$flag];
@@ -170,7 +170,7 @@ public function validate(array $argv)
// Add the help flag if not defined
if (array_key_exists('-h', $this->acceptedFlags) === false)
{
- $this->acceptedFlags['-h'] = new cliFlag('-h', _('Help'), true);
+ $this->acceptedFlags['-h'] = new Flag('-h', _('Help'), true);
}
if ($this->getValue('-h'))
@@ -239,7 +239,7 @@ public function getValue($flag)
/**
*
* @param string $flag
- * @return cliFlag|null Returns the flag either by name or alias
+ * @return Flag|null Returns the flag either by name or alias
*/
private function getFlag($flag)
{
@@ -260,4 +260,5 @@ private function getFlag($flag)
return null;
}
-}
+}
+
View
7 lib/cli/CliParser.php
@@ -10,7 +10,7 @@
* @author Fredrik Wallgren <fredrik@wallgren.me>
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
-class cliCliParser
+class CliParser
{
/**
* Flags is stored flag => value
@@ -77,7 +77,7 @@ public function parse(array $argv)
$this->flags['-'.$str[$j]] = true;
}
}
- else
+ else
{
$parts = explode('=', $str);
$this->flags[$parts[0]] = true;
@@ -100,4 +100,5 @@ public function getValue($flag)
{
return isset($this->flags[$flag]) ? $this->flags[$flag] : false;
}
-}
+}
+
View
5 lib/cli/Flag.php
@@ -10,7 +10,7 @@
* @author Fredrik Wallgren <fredrik@wallgren.me>
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
-class cliFlag
+class Flag
{
/**
*
@@ -115,4 +115,5 @@ public function isBool()
{
return $this->isBool;
}
-}
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.