aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/collection
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ramsey/collection')
-rw-r--r--vendor/ramsey/collection/LICENSE2
-rw-r--r--vendor/ramsey/collection/README.md8
-rw-r--r--vendor/ramsey/collection/composer.json9
-rw-r--r--vendor/ramsey/collection/src/AbstractArray.php34
-rw-r--r--vendor/ramsey/collection/src/AbstractCollection.php5
-rw-r--r--vendor/ramsey/collection/src/AbstractSet.php2
-rw-r--r--vendor/ramsey/collection/src/ArrayInterface.php2
-rw-r--r--vendor/ramsey/collection/src/Collection.php2
-rw-r--r--vendor/ramsey/collection/src/CollectionInterface.php2
-rw-r--r--vendor/ramsey/collection/src/DoubleEndedQueue.php4
-rw-r--r--vendor/ramsey/collection/src/DoubleEndedQueueInterface.php2
-rw-r--r--vendor/ramsey/collection/src/GenericArray.php2
-rw-r--r--vendor/ramsey/collection/src/Map/AbstractMap.php4
-rw-r--r--vendor/ramsey/collection/src/Map/AbstractTypedMap.php8
-rw-r--r--vendor/ramsey/collection/src/Map/AssociativeArrayMap.php2
-rw-r--r--vendor/ramsey/collection/src/Map/MapInterface.php2
-rw-r--r--vendor/ramsey/collection/src/Map/NamedParameterMap.php2
-rw-r--r--vendor/ramsey/collection/src/Map/TypedMap.php7
-rw-r--r--vendor/ramsey/collection/src/Map/TypedMapInterface.php2
-rw-r--r--vendor/ramsey/collection/src/Queue.php4
-rw-r--r--vendor/ramsey/collection/src/QueueInterface.php2
-rw-r--r--vendor/ramsey/collection/src/Set.php2
22 files changed, 72 insertions, 37 deletions
diff --git a/vendor/ramsey/collection/LICENSE b/vendor/ramsey/collection/LICENSE
index 0efc999bf..ae15f590c 100644
--- a/vendor/ramsey/collection/LICENSE
+++ b/vendor/ramsey/collection/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2015-2020 Ben Ramsey <ben@benramsey.com>
+Copyright (c) 2015-2021 Ben Ramsey <ben@benramsey.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/vendor/ramsey/collection/README.md b/vendor/ramsey/collection/README.md
index ce7a554d2..9124dd77e 100644
--- a/vendor/ramsey/collection/README.md
+++ b/vendor/ramsey/collection/README.md
@@ -8,17 +8,15 @@
<a href="https://github.com/ramsey/collection"><img src="http://img.shields.io/badge/source-ramsey/collection-blue.svg?style=flat-square" alt="Source Code"></a>
<a href="https://packagist.org/packages/ramsey/collection"><img src="https://img.shields.io/packagist/v/ramsey/collection.svg?style=flat-square&label=release" alt="Download Package"></a>
<a href="https://php.net"><img src="https://img.shields.io/packagist/php-v/ramsey/collection.svg?style=flat-square&colorB=%238892BF" alt="PHP Programming Language"></a>
+ <a href="https://github.com/ramsey/collection/blob/master/LICENSE"><img src="https://img.shields.io/packagist/l/ramsey/collection.svg?style=flat-square&colorB=darkcyan" alt="Read License"></a>
<a href="https://github.com/ramsey/collection/actions?query=workflow%3ACI"><img src="https://img.shields.io/github/workflow/status/ramsey/collection/CI?label=CI&logo=github&style=flat-square" alt="Build Status"></a>
<a href="https://codecov.io/gh/ramsey/collection"><img src="https://img.shields.io/codecov/c/gh/ramsey/collection?label=codecov&logo=codecov&style=flat-square" alt="Codecov Code Coverage"></a>
<a href="https://shepherd.dev/github/ramsey/collection"><img src="https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Framsey%2Fcollection%2Fcoverage" alt="Psalm Type Coverage"></a>
- <a href="https://github.com/ramsey/collection/blob/master/LICENSE"><img src="https://img.shields.io/packagist/l/ramsey/collection.svg?style=flat-square&colorB=darkcyan" alt="Read License"></a>
- <a href="https://packagist.org/packages/ramsey/collection/stats"><img src="https://img.shields.io/packagist/dt/ramsey/collection.svg?style=flat-square&colorB=darkmagenta" alt="Package downloads on Packagist"></a>
- <a href="https://phpc.chat/channel/ramsey"><img src="https://img.shields.io/badge/phpc.chat-%23ramsey-darkslateblue?style=flat-square" alt="Chat with the maintainers"></a>
</p>
## About
-ramsey/collection is a PHP 7.2+ library for representing and manipulating collections.
+ramsey/collection is a PHP library for representing and manipulating collections.
Much inspiration for this library came from the [Java Collections Framework][java].
@@ -44,7 +42,7 @@ Examples of how to use this framework can be found in the
Contributions are welcome! Before contributing to this project, familiarize
yourself with [CONTRIBUTING.md](CONTRIBUTING.md).
-To develop this project, you will need [PHP](https://www.php.net) 7.2 or greater
+To develop this project, you will need [PHP](https://www.php.net) 7.3 or greater
and [Composer](https://getcomposer.org).
After cloning this repository locally, execute the following commands:
diff --git a/vendor/ramsey/collection/composer.json b/vendor/ramsey/collection/composer.json
index 0c5d09578..73ec30142 100644
--- a/vendor/ramsey/collection/composer.json
+++ b/vendor/ramsey/collection/composer.json
@@ -1,7 +1,7 @@
{
"name": "ramsey/collection",
"type": "library",
- "description": "A PHP 7.2+ library for representing and manipulating collections.",
+ "description": "A PHP library for representing and manipulating collections.",
"keywords": [
"array",
"collection",
@@ -19,7 +19,8 @@
}
],
"require": {
- "php": "^7.2 || ^8"
+ "php": "^7.3 || ^8",
+ "symfony/polyfill-php81": "^1.23"
},
"require-dev": {
"captainhook/captainhook": "^5.3",
@@ -29,6 +30,7 @@
"hamcrest/hamcrest-php": "^2",
"jangregor/phpstan-prophecy": "^0.8",
"mockery/mockery": "^1.3",
+ "phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1",
"phpstan/phpstan": "^0.12.32",
"phpstan/phpstan-mockery": "^0.12.5",
@@ -50,7 +52,8 @@
"autoload-dev": {
"psr-4": {
"Ramsey\\Console\\": "resources/console/",
- "Ramsey\\Collection\\Test\\": "tests/"
+ "Ramsey\\Collection\\Test\\": "tests/",
+ "Ramsey\\Test\\Generics\\": "tests/generics/"
},
"files": [
"vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php"
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..b1df91923 100644
--- a/vendor/ramsey/collection/src/AbstractCollection.php
+++ b/vendor/ramsey/collection/src/AbstractCollection.php
@@ -42,8 +42,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
{
@@ -258,7 +258,6 @@ abstract class AbstractCollection extends AbstractArray implements CollectionInt
$temp[] = $collection->toArray();
}
- /** @var array<array-key, T> $merge */
$merge = array_merge(...$temp);
$collection = clone $this;
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
{