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;
|
||||
|
||||
return parent::__construct(sprintf(
|
||||
'missing %s %s%s',
|
||||
$input->getType(),
|
||||
'option' == $input->getType() ? '-' : '',
|
||||
'option' == $input->getType() ? $input->name() : strtoupper($input->name())
|
||||
'missing %s',
|
||||
$input->getDisplayName()
|
||||
), $code, $previous);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,11 +15,10 @@ class RequiredInputMissingValueException extends \Exception
|
|||
$this->input = $input;
|
||||
|
||||
return parent::__construct(sprintf(
|
||||
'%s %s%s is missing a value',
|
||||
$input->getType(),
|
||||
'option' == $input->getType() ? '-' : '',
|
||||
'option' == $input->getType() ? $input->name() : strtoupper($input->name())
|
||||
'a value is required for %s',
|
||||
$input->getDisplayName()
|
||||
), $code, $previous);
|
||||
|
||||
}
|
||||
|
||||
public function getInput(): Input\AbstractInputType
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue