|
@@ -344,10 +344,16 @@ class Zend_Console_Getopt
|
|
|
* These are appended to those defined when the constructor was called.
|
|
* These are appended to those defined when the constructor was called.
|
|
|
*
|
|
*
|
|
|
* @param array $argv
|
|
* @param array $argv
|
|
|
|
|
+ * @throws Zend_Console_Getopt_Exception When not given an array as parameter
|
|
|
* @return Zend_Console_Getopt Provides a fluent interface
|
|
* @return Zend_Console_Getopt Provides a fluent interface
|
|
|
*/
|
|
*/
|
|
|
public function addArguments($argv)
|
|
public function addArguments($argv)
|
|
|
{
|
|
{
|
|
|
|
|
+ if(!is_array($argv)) {
|
|
|
|
|
+ require_once 'Zend/Console/Getopt/Exception.php';
|
|
|
|
|
+ throw new Zend_Console_Getopt_Exception(
|
|
|
|
|
+ "Parameter #1 to addArguments should be an array");
|
|
|
|
|
+ }
|
|
|
$this->_argv = array_merge($this->_argv, $argv);
|
|
$this->_argv = array_merge($this->_argv, $argv);
|
|
|
$this->_parsed = false;
|
|
$this->_parsed = false;
|
|
|
return $this;
|
|
return $this;
|
|
@@ -358,10 +364,16 @@ class Zend_Console_Getopt
|
|
|
* These replace any currently defined.
|
|
* These replace any currently defined.
|
|
|
*
|
|
*
|
|
|
* @param array $argv
|
|
* @param array $argv
|
|
|
|
|
+ * @throws Zend_Console_Getopt_Exception When not given an array as parameter
|
|
|
* @return Zend_Console_Getopt Provides a fluent interface
|
|
* @return Zend_Console_Getopt Provides a fluent interface
|
|
|
*/
|
|
*/
|
|
|
public function setArguments($argv)
|
|
public function setArguments($argv)
|
|
|
{
|
|
{
|
|
|
|
|
+ if(!is_array($argv)) {
|
|
|
|
|
+ require_once 'Zend/Console/Getopt/Exception.php';
|
|
|
|
|
+ throw new Zend_Console_Getopt_Exception(
|
|
|
|
|
+ "Parameter #1 to setArguments should be an array");
|
|
|
|
|
+ }
|
|
|
$this->_argv = $argv;
|
|
$this->_argv = $argv;
|
|
|
$this->_parsed = false;
|
|
$this->_parsed = false;
|
|
|
return $this;
|
|
return $this;
|