From b89aa9dfab82f59e68286e1b0414f45d48881d01 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 27 Oct 2023 09:29:07 +0200 Subject: [PATCH] Transfer ramsey/collection patch from icinga-php-thirdparty --- composer.json | 14 ++++++++++++- patches/ramsey-collection.patch | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 patches/ramsey-collection.patch diff --git a/composer.json b/composer.json index 8cfce65..4588aa3 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,9 @@ "sort-packages": true, "platform": { "php": "7.2.9" + }, + "allow-plugins": { + "cweagans/composer-patches": true } }, "require": { @@ -19,7 +22,8 @@ "ipl/sql": "^0.7.0", "ipl/stdlib": "^0.13.0", "ipl/validator": "^0.5.0", - "ipl/web": "^0.9.0" + "ipl/web": "^0.9.0", + "cweagans/composer-patches": "~1.0" }, "require-dev": { }, @@ -30,5 +34,13 @@ "post-update-cmd": [ "AssetLoader::update" ] + }, + "extra": { + "composer-exit-on-patch-failure": true, + "patches": { + "ramsey/collection": { + "Collection: Add PHP 8.1 support": "patches/ramsey-collection.patch" + } + } } } diff --git a/patches/ramsey-collection.patch b/patches/ramsey-collection.patch new file mode 100644 index 0000000..b204e59 --- /dev/null +++ b/patches/ramsey-collection.patch @@ -0,0 +1,37 @@ +--- a/vendor/ramsey/collection/src/AbstractArray.php ++++ b/vendor/ramsey/collection/src/AbstractArray.php +@@ -84,6 +84,7 @@ abstract class AbstractArray implements ArrayInterface + * @return T|null the value stored at the offset, or null if the offset + * does not exist. + */ ++ #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->data[$offset] ?? null; +@@ -132,6 +133,11 @@ abstract class AbstractArray implements ArrayInterface + return serialize($this->data); + } + ++ public function __serialize() ++ { ++ return $this->serialize(); ++ } ++ + /** + * Converts a serialized string representation into an instance object. + * +@@ -149,6 +155,11 @@ abstract class AbstractArray implements ArrayInterface + $this->data = $data; + } + ++ public function __unserialize(array $data) ++ { ++ $this->unserialize($data); ++ } ++ + /** + * Returns the number of items in this array. + * +-- +2.41.0 +