aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php')
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php b/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php
index 89d09178d..536cb6034 100644
--- a/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php
+++ b/vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php
@@ -15,14 +15,15 @@ declare(strict_types=1);
namespace Ramsey\Uuid\Provider\Node;
use Ramsey\Collection\AbstractCollection;
-use Ramsey\Collection\CollectionInterface;
use Ramsey\Uuid\Provider\NodeProviderInterface;
use Ramsey\Uuid\Type\Hexadecimal;
/**
* A collection of NodeProviderInterface objects
+ *
+ * @extends AbstractCollection<NodeProviderInterface>
*/
-class NodeProviderCollection extends AbstractCollection implements CollectionInterface
+class NodeProviderCollection extends AbstractCollection
{
public function getType(): string
{
@@ -36,10 +37,11 @@ class NodeProviderCollection extends AbstractCollection implements CollectionInt
* a UuidInterface instance
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
+ * @psalm-suppress RedundantConditionGivenDocblockType
*/
public function unserialize($serialized): void
{
- /** @var mixed[] $data */
+ /** @var array<array-key, NodeProviderInterface> $data */
$data = unserialize($serialized, [
'allowed_classes' => [
Hexadecimal::class,
@@ -49,6 +51,11 @@ class NodeProviderCollection extends AbstractCollection implements CollectionInt
],
]);
- $this->data = $data;
+ $this->data = array_filter(
+ $data,
+ function ($unserialized): bool {
+ return $unserialized instanceof NodeProviderInterface;
+ }
+ );
}
}