Skip to content

Commit

Permalink
Transfer ramsey/collection patch from icinga-php-thirdparty
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Oct 27, 2023
1 parent 65a2400 commit b89aa9d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
14 changes: 13 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"sort-packages": true,
"platform": {
"php": "7.2.9"
},
"allow-plugins": {
"cweagans/composer-patches": true
}
},
"require": {
Expand All @@ -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": {
},
Expand All @@ -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"
}
}
}
}
37 changes: 37 additions & 0 deletions patches/ramsey-collection.patch
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b89aa9d

Please sign in to comment.