Add isSuccess and isFail shortcuts

This commit is contained in:
Anton Vakhrushev 2017-03-10 06:43:05 +03:00
parent 8a60c82bc6
commit 4268ea02d3

View File

@ -50,6 +50,30 @@ class Reason
return $this->messages; 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. * Appends reason to current and returns new reason.
* *