for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TonicHealthCheck\Check;
/**
* Class CheckResult
*/
class CheckResult
{
const STATUS_OK = 0;
* @var int
protected $status;
* @var CheckException|null
protected $error;
* CheckResult constructor.
*
* @param int $status
* @param CheckException $error
public function __construct($status, CheckException $error = null)
$this->setStatus($status);
$this->setError($error);
}
* @return CheckResult
public static function okResult()
return new self(static::STATUS_OK);
public static function errorResult($status, CheckException $error)
return new self($status, $error);
* @return int
public function getStatus()
return $this->status;
* @return CheckException|null
public function getError()
return $this->error;
* @return bool
public function isOk()
return $this->getStatus() == static::STATUS_OK;
protected function setStatus($status)
$this->status = $status;
* @param CheckException|null $error
protected function setError(CheckException $error = null)
$this->error = $error;