Skip to content

Commit

Permalink
Merge pull request #11 from WebFiori/dev
Browse files Browse the repository at this point in the history
Update CommandArgument.php
  • Loading branch information
usernane authored Feb 1, 2023
2 parents 066564b + 3b07ddb commit 32ff302
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions webfiori/cli/CommandArgument.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,25 @@ class CommandArgument {
private $isOptional;
private $name;
private $value;
public function __construct(string $name = 'arg') {
/**
* Creates new instance of the class.
*
* @param string $name The name of the argument such as '--version'.
*
* @param string $description A short description of the argument and how
* it affects the execution of the command that it belongs to.
*
* @param bool $optional If set to true, the argument will be considered as
* optional.
*/
public function __construct(string $name = 'arg', string $description = '', bool $optional = false) {
if (!$this->setName($name)) {
$this->name = 'arg';
}
$this->isOptional = false;
$this->isOptional = $optional;
$this->allowedVals = [];
$this->default = '';
$this->description = '';
$this->description = $description;
}
/**
* Adds a value to the set of allowed argument values.
Expand Down

0 comments on commit 32ff302

Please sign in to comment.