diff options
author | Mario <mario@mariovavti.com> | 2021-11-09 09:10:19 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-11-09 09:10:19 +0000 |
commit | fe7ecede700fe04631d23f36473e697ce2b364dc (patch) | |
tree | e713fc39dba500a25cb2acf8561e286fb8b41ff0 /vendor/ramsey/collection/src | |
parent | 42de18d96d201d74e5df3ed1b8f6132cb00357b6 (diff) | |
parent | 089708ab9f90309a0c27ae633cf8f2604fce1170 (diff) | |
download | volse-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')
19 files changed, 72 insertions, 36 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() diff --git a/vendor/ramsey/collection/src/AbstractCollection.php b/vendor/ramsey/collection/src/AbstractCollection.php index 2facf0e89..d2cd1151c 100644 --- a/vendor/ramsey/collection/src/AbstractCollection.php +++ b/vendor/ramsey/collection/src/AbstractCollection.php @@ -32,6 +32,7 @@ use function array_uintersect; use function current; use function end; use function in_array; +use function is_int; use function reset; use function sprintf; use function unserialize; @@ -42,8 +43,8 @@ use function usort; * minimize the effort required to implement this interface * * @template T - * @template-extends AbstractArray<T> - * @template-implements CollectionInterface<T> + * @extends AbstractArray<T> + * @implements CollectionInterface<T> */ abstract class AbstractCollection extends AbstractArray implements CollectionInterface { @@ -238,7 +239,7 @@ abstract class AbstractCollection extends AbstractArray implements CollectionInt public function merge(CollectionInterface ...$collections): CollectionInterface { - $temp = [$this->data]; + $mergedCollection = clone $this; foreach ($collections as $index => $collection) { if (!$collection instanceof static) { @@ -255,16 +256,16 @@ abstract class AbstractCollection extends AbstractArray implements CollectionInt ); } - $temp[] = $collection->toArray(); + foreach ($collection as $key => $value) { + if (is_int($key)) { + $mergedCollection[] = $value; + } else { + $mergedCollection[$key] = $value; + } + } } - /** @var array<array-key, T> $merge */ - $merge = array_merge(...$temp); - - $collection = clone $this; - $collection->data = $merge; - - return $collection; + return $mergedCollection; } /** diff --git a/vendor/ramsey/collection/src/AbstractSet.php b/vendor/ramsey/collection/src/AbstractSet.php index 3bd22965f..1126ccb0a 100644 --- a/vendor/ramsey/collection/src/AbstractSet.php +++ b/vendor/ramsey/collection/src/AbstractSet.php @@ -20,7 +20,7 @@ namespace Ramsey\Collection; * this specific type of collection. * * @template T - * @template-extends AbstractCollection<T> + * @extends AbstractCollection<T> */ abstract class AbstractSet extends AbstractCollection { diff --git a/vendor/ramsey/collection/src/ArrayInterface.php b/vendor/ramsey/collection/src/ArrayInterface.php index 19fbff336..27af6102b 100644 --- a/vendor/ramsey/collection/src/ArrayInterface.php +++ b/vendor/ramsey/collection/src/ArrayInterface.php @@ -23,6 +23,8 @@ use Serializable; * `ArrayInterface` provides traversable array functionality to data types. * * @template T + * @extends ArrayAccess<array-key, T> + * @extends IteratorAggregate<array-key, T> */ interface ArrayInterface extends ArrayAccess, diff --git a/vendor/ramsey/collection/src/Collection.php b/vendor/ramsey/collection/src/Collection.php index 2f8deddaa..1299c12c2 100644 --- a/vendor/ramsey/collection/src/Collection.php +++ b/vendor/ramsey/collection/src/Collection.php @@ -71,7 +71,7 @@ namespace Ramsey\Collection; * ``` * * @template T - * @template-extends AbstractCollection<T> + * @extends AbstractCollection<T> */ class Collection extends AbstractCollection { diff --git a/vendor/ramsey/collection/src/CollectionInterface.php b/vendor/ramsey/collection/src/CollectionInterface.php index dfef6ca86..aa86feb04 100644 --- a/vendor/ramsey/collection/src/CollectionInterface.php +++ b/vendor/ramsey/collection/src/CollectionInterface.php @@ -21,7 +21,7 @@ namespace Ramsey\Collection; * and others unordered. * * @template T - * @template-extends ArrayInterface<T> + * @extends ArrayInterface<T> */ interface CollectionInterface extends ArrayInterface { diff --git a/vendor/ramsey/collection/src/DoubleEndedQueue.php b/vendor/ramsey/collection/src/DoubleEndedQueue.php index 6ebdca5ad..c9c59502d 100644 --- a/vendor/ramsey/collection/src/DoubleEndedQueue.php +++ b/vendor/ramsey/collection/src/DoubleEndedQueue.php @@ -22,8 +22,8 @@ use Ramsey\Collection\Exception\NoSuchElementException; * minimize the effort required to implement this interface. * * @template T - * @template-extends Queue<T> - * @template-implements DoubleEndedQueueInterface<T> + * @extends Queue<T> + * @implements DoubleEndedQueueInterface<T> */ class DoubleEndedQueue extends Queue implements DoubleEndedQueueInterface { diff --git a/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php b/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php index 67aae5e2e..d7df53469 100644 --- a/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php +++ b/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php @@ -160,7 +160,7 @@ use Ramsey\Collection\Exception\NoSuchElementException; * empty. * * @template T - * @template-extends QueueInterface<T> + * @extends QueueInterface<T> */ interface DoubleEndedQueueInterface extends QueueInterface { diff --git a/vendor/ramsey/collection/src/GenericArray.php b/vendor/ramsey/collection/src/GenericArray.php index 9b95df387..2b079aa5e 100644 --- a/vendor/ramsey/collection/src/GenericArray.php +++ b/vendor/ramsey/collection/src/GenericArray.php @@ -17,7 +17,7 @@ namespace Ramsey\Collection; /** * `GenericArray` represents a standard array object. * - * @template-extends AbstractArray<mixed> + * @extends AbstractArray<mixed> */ class GenericArray extends AbstractArray { diff --git a/vendor/ramsey/collection/src/Map/AbstractMap.php b/vendor/ramsey/collection/src/Map/AbstractMap.php index 70f71160c..ae9f2fe61 100644 --- a/vendor/ramsey/collection/src/Map/AbstractMap.php +++ b/vendor/ramsey/collection/src/Map/AbstractMap.php @@ -26,8 +26,8 @@ use function in_array; * effort required to implement this interface. * * @template T - * @template-extends AbstractArray<T> - * @template-implements MapInterface<T> + * @extends AbstractArray<T> + * @implements MapInterface<T> */ abstract class AbstractMap extends AbstractArray implements MapInterface { diff --git a/vendor/ramsey/collection/src/Map/AbstractTypedMap.php b/vendor/ramsey/collection/src/Map/AbstractTypedMap.php index ff9f69177..551d2e6c6 100644 --- a/vendor/ramsey/collection/src/Map/AbstractTypedMap.php +++ b/vendor/ramsey/collection/src/Map/AbstractTypedMap.php @@ -22,11 +22,10 @@ use Ramsey\Collection\Tool\ValueToStringTrait; * This class provides a basic implementation of `TypedMapInterface`, to * minimize the effort required to implement this interface. * - * @phpstan-ignore-next-line - * @template K as array-key + * @template K * @template T - * @template-extends AbstractMap<T> - * @template-implements TypedMapInterface<T> + * @extends AbstractMap<T> + * @implements TypedMapInterface<T> */ abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface { @@ -64,6 +63,7 @@ abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface ); } + /** @psalm-suppress MixedArgumentTypeCoercion */ parent::offsetSet($offset, $value); } } diff --git a/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php b/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php index 3274dc9de..79a314d96 100644 --- a/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php +++ b/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php @@ -18,7 +18,7 @@ namespace Ramsey\Collection\Map; * `AssociativeArrayMap` represents a standard associative array object. * * @template T - * @template-extends AbstractMap<T> + * @extends AbstractMap<T> */ class AssociativeArrayMap extends AbstractMap { diff --git a/vendor/ramsey/collection/src/Map/MapInterface.php b/vendor/ramsey/collection/src/Map/MapInterface.php index 04e52a238..6ed0b2967 100644 --- a/vendor/ramsey/collection/src/Map/MapInterface.php +++ b/vendor/ramsey/collection/src/Map/MapInterface.php @@ -22,7 +22,7 @@ use Ramsey\Collection\ArrayInterface; * A map cannot contain duplicate keys; each key can map to at most one value. * * @template T - * @template-extends ArrayInterface<T> + * @extends ArrayInterface<T> */ interface MapInterface extends ArrayInterface { diff --git a/vendor/ramsey/collection/src/Map/NamedParameterMap.php b/vendor/ramsey/collection/src/Map/NamedParameterMap.php index ecc52f73a..9926ddd8c 100644 --- a/vendor/ramsey/collection/src/Map/NamedParameterMap.php +++ b/vendor/ramsey/collection/src/Map/NamedParameterMap.php @@ -26,7 +26,7 @@ use function is_int; * `NamedParameterMap` represents a mapping of values to a set of named keys * that may optionally be typed * - * @template-extends AbstractMap<mixed> + * @extends AbstractMap<mixed> */ class NamedParameterMap extends AbstractMap { diff --git a/vendor/ramsey/collection/src/Map/TypedMap.php b/vendor/ramsey/collection/src/Map/TypedMap.php index 752475fee..2e796377a 100644 --- a/vendor/ramsey/collection/src/Map/TypedMap.php +++ b/vendor/ramsey/collection/src/Map/TypedMap.php @@ -80,10 +80,9 @@ use Ramsey\Collection\Tool\TypeTrait; * } * ``` * - * @phpstan-ignore-next-line - * @template K as array-key + * @template K * @template T - * @template-extends AbstractTypedMap<K, T> + * @extends AbstractTypedMap<K, T> */ class TypedMap extends AbstractTypedMap { @@ -121,6 +120,8 @@ class TypedMap extends AbstractTypedMap { $this->keyType = $keyType; $this->valueType = $valueType; + + /** @psalm-suppress MixedArgumentTypeCoercion */ parent::__construct($data); } diff --git a/vendor/ramsey/collection/src/Map/TypedMapInterface.php b/vendor/ramsey/collection/src/Map/TypedMapInterface.php index 51b6a81a2..0308109cc 100644 --- a/vendor/ramsey/collection/src/Map/TypedMapInterface.php +++ b/vendor/ramsey/collection/src/Map/TypedMapInterface.php @@ -19,7 +19,7 @@ namespace Ramsey\Collection\Map; * typed. * * @template T - * @template-extends MapInterface<T> + * @extends MapInterface<T> */ interface TypedMapInterface extends MapInterface { diff --git a/vendor/ramsey/collection/src/Queue.php b/vendor/ramsey/collection/src/Queue.php index 4af2fdf76..93e032b43 100644 --- a/vendor/ramsey/collection/src/Queue.php +++ b/vendor/ramsey/collection/src/Queue.php @@ -24,8 +24,8 @@ use Ramsey\Collection\Tool\ValueToStringTrait; * the effort required to implement this interface. * * @template T - * @template-extends AbstractArray<T> - * @template-implements QueueInterface<T> + * @extends AbstractArray<T> + * @implements QueueInterface<T> */ class Queue extends AbstractArray implements QueueInterface { diff --git a/vendor/ramsey/collection/src/QueueInterface.php b/vendor/ramsey/collection/src/QueueInterface.php index 7ebbb5d06..8c7383df8 100644 --- a/vendor/ramsey/collection/src/QueueInterface.php +++ b/vendor/ramsey/collection/src/QueueInterface.php @@ -94,7 +94,7 @@ use Ramsey\Collection\Exception\NoSuchElementException; * `poll()` method to indicate that the queue contains no elements. * * @template T - * @template-extends ArrayInterface<T> + * @extends ArrayInterface<T> */ interface QueueInterface extends ArrayInterface { diff --git a/vendor/ramsey/collection/src/Set.php b/vendor/ramsey/collection/src/Set.php index ac1c5cbf0..6932f247a 100644 --- a/vendor/ramsey/collection/src/Set.php +++ b/vendor/ramsey/collection/src/Set.php @@ -36,7 +36,7 @@ namespace Ramsey\Collection; * ``` * * @template T - * @template-extends AbstractSet<T> + * @extends AbstractSet<T> */ class Set extends AbstractSet { |