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": { 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; } diff --git a/src/PHPHtmlParser/Dom/Tag.php b/src/PHPHtmlParser/Dom/Tag.php index 2aeb6aa8..a8739a4e 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): Tag + { + $this->name = $name; + + return clone $this; + } + /** * Sets the tag to be self closing. */