mirror of
https://github.com/n3w/helpers-cli-input.git
synced 2025-12-19 12:43:23 +00:00
Updated RequiredInputMissingException and RequiredInputMissingValueException exceptions to use getDisplayName() when producing their message
This commit is contained in:
parent
50e56a8649
commit
c5aa26b19d
2 changed files with 5 additions and 8 deletions
|
|
@ -15,10 +15,8 @@ class RequiredInputMissingException extends \Exception
|
||||||
$this->input = $input;
|
$this->input = $input;
|
||||||
|
|
||||||
return parent::__construct(sprintf(
|
return parent::__construct(sprintf(
|
||||||
'missing %s %s%s',
|
'missing %s',
|
||||||
$input->getType(),
|
$input->getDisplayName()
|
||||||
'option' == $input->getType() ? '-' : '',
|
|
||||||
'option' == $input->getType() ? $input->name() : strtoupper($input->name())
|
|
||||||
), $code, $previous);
|
), $code, $previous);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,10 @@ class RequiredInputMissingValueException extends \Exception
|
||||||
$this->input = $input;
|
$this->input = $input;
|
||||||
|
|
||||||
return parent::__construct(sprintf(
|
return parent::__construct(sprintf(
|
||||||
'%s %s%s is missing a value',
|
'a value is required for %s',
|
||||||
$input->getType(),
|
$input->getDisplayName()
|
||||||
'option' == $input->getType() ? '-' : '',
|
|
||||||
'option' == $input->getType() ? $input->name() : strtoupper($input->name())
|
|
||||||
), $code, $previous);
|
), $code, $previous);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInput(): Input\AbstractInputType
|
public function getInput(): Input\AbstractInputType
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue