From ebab71704acc10c15f73d0a379bf8f7d90694aa6 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 5 Sep 2017 11:27:13 +0200 Subject: [PATCH] fixes #94 --- Message/HeaderAbstract.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Message/HeaderAbstract.php b/Message/HeaderAbstract.php index bb9899d75..5320971d2 100644 --- a/Message/HeaderAbstract.php +++ b/Message/HeaderAbstract.php @@ -33,6 +33,33 @@ abstract class HeaderAbstract * @since 1.0.0 */ protected static $isLocked = false; + + /** + * Response status. + * + * @var int + * @since 1.0.0 + */ + protected $status = 0; + + /** + * {@inheritdoc} + * todo: shouldn't this only be available in the header?! + */ + public function setStatusCode(int $status) /* : void */ + { + $this->status = $status; + $this->header->generate($status); + } + + /** + * {@inheritdoc} + * todo: shouldn't this only be available in the header?! + */ + public function getStatusCode() : int + { + return $this->status; + } /** * Set header. @@ -98,4 +125,4 @@ abstract class HeaderAbstract { return self::$isLocked; } -} \ No newline at end of file +}