From 4268ea02d39bd2b6d4766f495592af4783a9b31c Mon Sep 17 00:00:00 2001 From: Anton Vakhrushev Date: Fri, 10 Mar 2017 06:43:05 +0300 Subject: [PATCH] Add isSuccess and isFail shortcuts --- src/Reason.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Reason.php b/src/Reason.php index dc2d349..58302b6 100644 --- a/src/Reason.php +++ b/src/Reason.php @@ -50,6 +50,30 @@ class Reason return $this->messages; } + /** + * Checks is status successful. + * + * Shortcut for $this->getStatus()->isSuccess() + * + * @return bool + */ + public function isSuccess(): bool + { + return $this->status->isSuccess(); + } + + /** + * Checks is status failed. + * + * Shortcut for $this->getStatus()->isFail() + * + * @return bool + */ + public function isFail(): bool + { + return $this->status->isFail(); + } + /** * Appends reason to current and returns new reason. *