Skip to content

Commit

Permalink
fix: update DOMDocument return values to support PHP 8.3
Browse files Browse the repository at this point in the history
Previously, the return value was \DOMDocument for the static calls, but
it has been changed to just bool in PHP 8.3. Also, starting from PHP 8.0,
static calls to those methods throw an error, so changing the types
should not break previous versions.
  • Loading branch information
yusufkandemir committed May 1, 2024
1 parent 491ef79 commit 6798796
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MicrodataDOMDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function getItems(): \DOMNodeList
* {@inheritdoc}
* Also assigns $xpath with DOMXPath of the freshly loaded DOMDocument.
*/
public function loadHTML($source, $options = 0): \DOMDocument|bool
public function loadHTML($source, $options = 0): bool
{
$return = parent::loadHTML($source, $options);

Expand All @@ -35,7 +35,7 @@ public function loadHTML($source, $options = 0): \DOMDocument|bool
* {@inheritdoc}
* Also assigns $xpath with DOMXPath of the freshly loaded DOMDocument.
*/
public function loadHTMLFile($filename, $options = 0): \DOMDocument|bool
public function loadHTMLFile($filename, $options = 0): bool
{
$return = parent::loadHTMLFile($filename, $options);

Expand Down

0 comments on commit 6798796

Please sign in to comment.