11
0
Fork 0
mirror of https://github.com/n3w/helpers-cli-input.git synced 2025-12-19 20:53:27 +00:00

Updated RequiredInputMissingException and RequiredInputMissingValueException exceptions to use getDisplayName() when producing their message

This commit is contained in:
Alannah Kearney 2019-05-25 11:58:33 +10:00
commit c5aa26b19d
2 changed files with 5 additions and 8 deletions

View file

@ -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);
}

View file

@ -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