Ejemplo n.º 1
0
 /**
  * Creates a new exception object. 
  * 
  * @param ezcConsoleArgument $arg The violated argument.
  * @param mixed $value            The incorrect value.
  * @return void
  */
 public function __construct(ezcConsoleArgument $arg, $value)
 {
     $typeName = 'unknown';
     switch ($arg->type) {
         case ezcConsoleInput::TYPE_INT:
             $typeName = 'int';
             break;
     }
     parent::__construct("The argument '{$arg->name}' expects a value of type '{$typeName}', but received the value '{$value}'.");
 }
 /**
  * Creates a new exception object. 
  * 
  * @param ezcConsoleArgument $arg The argument object, the violation occured for.
  * @return void
  */
 public function __construct(ezcConsoleArgument $arg)
 {
     parent::__construct("Argument with name '{$arg->name}' is mandatory but was not submitted.");
 }
Ejemplo n.º 3
0
 /**
  * Creates a new exception object. 
  * 
  * @param array(string) $args Arguments array.
  * @param int $i                   Index in the arguments array.
  * @return void
  */
 public function __construct($args, $i)
 {
     parent::__construct("Only " . ($i - 1) . " arguments are expected, but " . (count($args) - 1) . " were submitted.");
 }