aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/collection/src/AbstractArray.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-11-09 09:10:19 +0000
committerMario <mario@mariovavti.com>2021-11-09 09:10:19 +0000
commitfe7ecede700fe04631d23f36473e697ce2b364dc (patch)
treee713fc39dba500a25cb2acf8561e286fb8b41ff0 /vendor/ramsey/collection/src/AbstractArray.php
parent42de18d96d201d74e5df3ed1b8f6132cb00357b6 (diff)
parent089708ab9f90309a0c27ae633cf8f2604fce1170 (diff)
downloadvolse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.gz
volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.bz2
volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.zip
Merge branch '6.4RC'6.4
Diffstat (limited to 'vendor/ramsey/collection/src/AbstractArray.php')
-rw-r--r--vendor/ramsey/collection/src/AbstractArray.php34
1 files changed, 33 insertions, 1 deletions
diff --git a/vendor/ramsey/collection/src/AbstractArray.php b/vendor/ramsey/collection/src/AbstractArray.php
index 2c6e0dedd..d72dbe697 100644
--- a/vendor/ramsey/collection/src/AbstractArray.php
+++ b/vendor/ramsey/collection/src/AbstractArray.php
@@ -25,7 +25,7 @@ use function unserialize;
* the effort required to implement this interface.
*
* @template T
- * @template-implements ArrayInterface<T>
+ * @implements ArrayInterface<T>
*/
abstract class AbstractArray implements ArrayInterface
{
@@ -54,6 +54,8 @@ abstract class AbstractArray implements ArrayInterface
* Returns an iterator for this array.
*
* @link http://php.net/manual/en/iteratoraggregate.getiterator.php IteratorAggregate::getIterator()
+ *
+ * @return Traversable<array-key, T>
*/
public function getIterator(): Traversable
{
@@ -81,7 +83,10 @@ abstract class AbstractArray implements ArrayInterface
*
* @return T|null the value stored at the offset, or null if the offset
* does not exist.
+ *
+ * @psalm-suppress InvalidAttribute
*/
+ #[\ReturnTypeWillChange] // phpcs:ignore
public function offsetGet($offset)
{
return $this->data[$offset] ?? null;
@@ -121,6 +126,8 @@ abstract class AbstractArray implements ArrayInterface
/**
* Returns a serialized string representation of this array object.
*
+ * @deprecated The Serializable interface will go away in PHP 9.
+ *
* @link http://php.net/manual/en/serializable.serialize.php Serializable::serialize()
*
* @return string a PHP serialized string.
@@ -131,8 +138,23 @@ abstract class AbstractArray implements ArrayInterface
}
/**
+ * Returns data suitable for PHP serialization.
+ *
+ * @link https://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.serialize
+ * @link https://www.php.net/serialize
+ *
+ * @return array<array-key, T>
+ */
+ public function __serialize(): array
+ {
+ return $this->data;
+ }
+
+ /**
* Converts a serialized string representation into an instance object.
*
+ * @deprecated The Serializable interface will go away in PHP 9.
+ *
* @link http://php.net/manual/en/serializable.unserialize.php Serializable::unserialize()
*
* @param string $serialized A PHP serialized string to unserialize.
@@ -148,6 +170,16 @@ abstract class AbstractArray implements ArrayInterface
}
/**
+ * Adds unserialized data to the object.
+ *
+ * @param array<array-key, T> $data
+ */
+ public function __unserialize(array $data): void
+ {
+ $this->data = $data;
+ }
+
+ /**
* Returns the number of items in this array.
*
* @link http://php.net/manual/en/countable.count.php Countable::count()