diff --git a/composer.json b/composer.json index 2d4d53c..a206286 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ "Fix ArrayObject::unserialize()": "zendframework/zend-stdlib/ArrayObject-unserialize-continue.patch" }, "sunra/php-simple-html-dom-parser:1.5.2": { - "Fix minus in regular expressions": "sunra/php-simple-html-dom-parser/minus-in-regular-expressions.patch" + "Fix minus in regular expressions": "sunra/php-simple-html-dom-parser/minus-in-regular-expressions.patch", + "Add PHP 8.1 compability to league/url version 3.3.5": "sunra/php-simple-html-dom-parser/php8.1-compatibility.patch" }, "phpunit/phpunit:4.8.36": { "Avoid each() in Getopt": "phpunit/phpunit/Getopt-each.patch" @@ -57,6 +58,9 @@ }, "lcobucci/jwt:3.4.6": { "Adds php 8 compability to jwt version 3.4.6": "lcobucci/jwt/php8-compatibility.patch" + }, + "league/url:3.3.5": { + "Add PHP 8.1 compability to league/url version 3.3.5": "league/url/php8.1-compatibility.patch" } } } diff --git a/league/url/php8.1-compatibility.patch b/league/url/php8.1-compatibility.patch new file mode 100644 index 0000000..89ec640 --- /dev/null +++ b/league/url/php8.1-compatibility.patch @@ -0,0 +1,81 @@ +From: Michele Locati +Date: Tue, 15 Mar 2022 12:11:04 +0100 +Subject: [PATCH] Fix PHP 8.1 compatibility + + +--- a/src/Components/AbstractArray.php ++++ b/src/Components/AbstractArray.php +@@ -60,6 +60,7 @@ abstract class AbstractArray implements IteratorAggregate, Countable + * + * @return ArrayIterator + */ ++ #[\ReturnTypeWillChange] + public function getIterator() + { + return new ArrayIterator($this->data); +@@ -72,6 +73,7 @@ abstract class AbstractArray implements IteratorAggregate, Countable + * + * @return integer + */ ++ #[\ReturnTypeWillChange] + public function count($mode = COUNT_NORMAL) + { + return count($this->data, $mode); +@@ -84,6 +86,7 @@ abstract class AbstractArray implements IteratorAggregate, Countable + * + * @return bool + */ ++ #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return isset($this->data[$offset]); +@@ -94,6 +97,7 @@ abstract class AbstractArray implements IteratorAggregate, Countable + * + * @param int|string $offset + */ ++ #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + unset($this->data[$offset]); +@@ -106,6 +110,7 @@ abstract class AbstractArray implements IteratorAggregate, Countable + * + * @return null + */ ++ #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + if (isset($this->data[$offset])) { + +--- a/src/Components/AbstractComponent.php ++++ b/src/Components/AbstractComponent.php +@@ -64,7 +64,7 @@ abstract class AbstractComponent implements ComponentInterface + */ + public function __toString() + { +- return str_replace(null, '', $this->get()); ++ return (string) $this->get(); + } + + /** + +--- a/src/Components/AbstractSegment.php ++++ b/src/Components/AbstractSegment.php +@@ -115,6 +115,7 @@ abstract class AbstractSegment extends AbstractArray implements ArrayAccess + * @param int|string $offset + * @param mixed $value + */ ++ #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + $data = $this->data; + +--- a/src/Components/Query.php ++++ b/src/Components/Query.php +@@ -133,6 +133,7 @@ class Query extends AbstractArray implements QueryInterface, ArrayAccess + /** + * {@inheritdoc} + */ ++ #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + if (is_null($offset)) { diff --git a/sunra/php-simple-html-dom-parser/php8.1-compatibility.patch b/sunra/php-simple-html-dom-parser/php8.1-compatibility.patch new file mode 100644 index 0000000..4ad5901 --- /dev/null +++ b/sunra/php-simple-html-dom-parser/php8.1-compatibility.patch @@ -0,0 +1,16 @@ +From: Michele Locati +Date: Tue, 15 Mar 2022 14:28:50 +0100 +Subject: [PATCH] Fix PHP 8.1 compatibility + + +--- a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php ++++ b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php +@@ -715,7 +715,7 @@ class simple_html_dom_node + if (!empty($m[6])) {$val=$m[6];} + + // convert to lowercase +- if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower($key);} ++ if ($this->dom->lowercase) {$tag=strtolower($tag); $key=strtolower((string) $key);} + //elements that do NOT have the specified attribute + if (isset($key[0]) && $key[0]==='!') {$key=substr($key, 1); $no_key=true;} +