From c5aa26b19db7a13c3e0c6314637c193d0f14bcfd Mon Sep 17 00:00:00 2001 From: Alannah Kearney Date: Sat, 25 May 2019 11:58:33 +1000 Subject: [PATCH] Updated RequiredInputMissingException and RequiredInputMissingValueException exceptions to use getDisplayName() when producing their message --- src/Input/Exceptions/RequiredInputMissingException.php | 6 ++---- .../Exceptions/RequiredInputMissingValueException.php | 7 +++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Input/Exceptions/RequiredInputMissingException.php b/src/Input/Exceptions/RequiredInputMissingException.php index c13bfd4..d7c4b43 100644 --- a/src/Input/Exceptions/RequiredInputMissingException.php +++ b/src/Input/Exceptions/RequiredInputMissingException.php @@ -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); } diff --git a/src/Input/Exceptions/RequiredInputMissingValueException.php b/src/Input/Exceptions/RequiredInputMissingValueException.php index b04c292..03f97a8 100644 --- a/src/Input/Exceptions/RequiredInputMissingValueException.php +++ b/src/Input/Exceptions/RequiredInputMissingValueException.php @@ -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