Transfer ramsey/collection patch from icinga-php-thirdparty

This commit is contained in:
Johannes Meyer 2023-10-27 09:29:07 +02:00
parent 65a24000de
commit b89aa9dfab
2 changed files with 50 additions and 1 deletions

View File

@ -8,6 +8,9 @@
"sort-packages": true, "sort-packages": true,
"platform": { "platform": {
"php": "7.2.9" "php": "7.2.9"
},
"allow-plugins": {
"cweagans/composer-patches": true
} }
}, },
"require": { "require": {
@ -19,7 +22,8 @@
"ipl/sql": "^0.7.0", "ipl/sql": "^0.7.0",
"ipl/stdlib": "^0.13.0", "ipl/stdlib": "^0.13.0",
"ipl/validator": "^0.5.0", "ipl/validator": "^0.5.0",
"ipl/web": "^0.9.0" "ipl/web": "^0.9.0",
"cweagans/composer-patches": "~1.0"
}, },
"require-dev": { "require-dev": {
}, },
@ -30,5 +34,13 @@
"post-update-cmd": [ "post-update-cmd": [
"AssetLoader::update" "AssetLoader::update"
] ]
},
"extra": {
"composer-exit-on-patch-failure": true,
"patches": {
"ramsey/collection": {
"Collection: Add PHP 8.1 support": "patches/ramsey-collection.patch"
}
}
} }
} }

View File

@ -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