From a2d0d462a46e9c9242c5ed60ab04cadc2dc17061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20B=C3=A1lint?= Date: Wed, 23 Nov 2022 13:12:43 +0100 Subject: [PATCH 1/3] fix: Remove non defined, not used properties in Response and SetCookie classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ádám Bálint --- src/Header/SetCookie.php | 2 -- src/PhpEnvironment/Response.php | 1 - 2 files changed, 3 deletions(-) diff --git a/src/Header/SetCookie.php b/src/Header/SetCookie.php index 19096243..ac6b9e71 100644 --- a/src/Header/SetCookie.php +++ b/src/Header/SetCookie.php @@ -264,8 +264,6 @@ public function __construct( $version = null, $sameSite = null ) { - $this->type = 'Cookie'; - $this->setName($name) ->setValue($value) ->setVersion($version) diff --git a/src/PhpEnvironment/Response.php b/src/PhpEnvironment/Response.php index 55c7fcc1..9aa31ff3 100644 --- a/src/PhpEnvironment/Response.php +++ b/src/PhpEnvironment/Response.php @@ -110,7 +110,6 @@ public function sendHeaders() header($header->toString()); } - $this->headersSent = true; return $this; } From ee7fcb3c29e9a7e61b63c2c18a7cd6a1b89849c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20B=C3=A1lint?= Date: Wed, 23 Nov 2022 16:27:41 +0100 Subject: [PATCH 2/3] fix: Put back type, define the property as deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ádám Bálint --- src/Header/SetCookie.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Header/SetCookie.php b/src/Header/SetCookie.php index ac6b9e71..c615a488 100644 --- a/src/Header/SetCookie.php +++ b/src/Header/SetCookie.php @@ -67,6 +67,13 @@ class SetCookie implements MultipleHeaderInterface 'none' => self::SAME_SITE_NONE, ]; + /** + * @deprecated This property is deprecated, and will be removed + * + * @var string + */ + public $type; + /** * Cookie name * @@ -264,6 +271,8 @@ public function __construct( $version = null, $sameSite = null ) { + $this->type = 'Cookie'; + $this->setName($name) ->setValue($value) ->setVersion($version) From 3047f7e9b90e4a4a62b17564ececa9ea7135eaf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81d=C3=A1m=20B=C3=A1lint?= Date: Wed, 23 Nov 2022 16:41:23 +0100 Subject: [PATCH 3/3] fix: Put back headersSent in Response, define the property as deprecated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ádám Bálint --- src/PhpEnvironment/Response.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PhpEnvironment/Response.php b/src/PhpEnvironment/Response.php index 9aa31ff3..16ebe90b 100644 --- a/src/PhpEnvironment/Response.php +++ b/src/PhpEnvironment/Response.php @@ -15,6 +15,13 @@ */ class Response extends HttpResponse { + /** + * @deprecated This property is deprecated, and will be removed + * + * @var bool + */ + public $headersSent; + /** * The current used version * (The value will be detected on getVersion) @@ -110,6 +117,7 @@ public function sendHeaders() header($header->toString()); } + $this->headersSent = true; return $this; }