From bec7bef408e599c6e953bab9952fc5c29beb304b Mon Sep 17 00:00:00 2001 From: Max Cohen Date: Tue, 27 Oct 2020 21:03:47 +0100 Subject: [PATCH 1/4] setName --- src/PHPHtmlParser/Dom/Tag.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/PHPHtmlParser/Dom/Tag.php b/src/PHPHtmlParser/Dom/Tag.php index 29b68bf7..b607f87b 100644 --- a/src/PHPHtmlParser/Dom/Tag.php +++ b/src/PHPHtmlParser/Dom/Tag.php @@ -90,6 +90,16 @@ public function name(): string return $this->name; } + /** + * Sets the name of this tag. + */ + public function setName(string $name): string + { + $this->name = $name; + + return clone $this; + } + /** * Sets the tag to be self closing. */ From fc871e66045d13434b5c7ae9e09b932b3896eaed Mon Sep 17 00:00:00 2001 From: Max Cohen Date: Wed, 28 Oct 2020 09:39:43 +0100 Subject: [PATCH 2/4] added setName to be able to replace Tag names --- src/PHPHtmlParser/Dom/Tag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PHPHtmlParser/Dom/Tag.php b/src/PHPHtmlParser/Dom/Tag.php index b607f87b..1a99cf52 100644 --- a/src/PHPHtmlParser/Dom/Tag.php +++ b/src/PHPHtmlParser/Dom/Tag.php @@ -93,7 +93,7 @@ public function name(): string /** * Sets the name of this tag. */ - public function setName(string $name): string + public function setName(string $name): Tag { $this->name = $name; From 8ccc94bdc35875abae14b6bd43f563b8c9bb36c2 Mon Sep 17 00:00:00 2001 From: max cohen Date: Wed, 25 Jan 2023 17:32:12 +0100 Subject: [PATCH 3/4] Update Collection.php return type mixed --- src/PHPHtmlParser/Dom/Node/Collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PHPHtmlParser/Dom/Node/Collection.php b/src/PHPHtmlParser/Dom/Node/Collection.php index ff447259..15cb5b4b 100644 --- a/src/PHPHtmlParser/Dom/Node/Collection.php +++ b/src/PHPHtmlParser/Dom/Node/Collection.php @@ -130,7 +130,7 @@ public function offsetUnset($offset): void * * @return mixed */ - public function offsetGet($offset) + public function offsetGet($offset): mixed { return $this->collection[$offset] ?? null; } From fc14fe966cb80b53c5214a794a3d02d2989f905c Mon Sep 17 00:00:00 2001 From: Dominik Dassow Date: Fri, 9 Aug 2024 12:26:57 +0200 Subject: [PATCH 4/4] Allow composer dependency guzzlehttp/psr7 with version ^2.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 166886f7..3e9b7c78 100755 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "paquettg/string-encode": "~1.0.0", "php-http/httplug": "^2.1", "guzzlehttp/guzzle": "^7.0", - "guzzlehttp/psr7": "^1.6", + "guzzlehttp/psr7": "^1.6|^2.0", "myclabs/php-enum": "^1.7" }, "require-dev": {