aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Builder/BuilderCollection.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ramsey/uuid/src/Builder/BuilderCollection.php')
-rw-r--r--vendor/ramsey/uuid/src/Builder/BuilderCollection.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/vendor/ramsey/uuid/src/Builder/BuilderCollection.php b/vendor/ramsey/uuid/src/Builder/BuilderCollection.php
index b3e5f1dc9..89fa1e3c8 100644
--- a/vendor/ramsey/uuid/src/Builder/BuilderCollection.php
+++ b/vendor/ramsey/uuid/src/Builder/BuilderCollection.php
@@ -15,7 +15,6 @@ declare(strict_types=1);
namespace Ramsey\Uuid\Builder;
use Ramsey\Collection\AbstractCollection;
-use Ramsey\Collection\CollectionInterface;
use Ramsey\Uuid\Converter\Number\GenericNumberConverter;
use Ramsey\Uuid\Converter\Time\GenericTimeConverter;
use Ramsey\Uuid\Converter\Time\PhpTimeConverter;
@@ -27,8 +26,10 @@ use Traversable;
/**
* A collection of UuidBuilderInterface objects
+ *
+ * @extends AbstractCollection<UuidBuilderInterface>
*/
-class BuilderCollection extends AbstractCollection implements CollectionInterface
+class BuilderCollection extends AbstractCollection
{
public function getType(): string
{
@@ -52,10 +53,11 @@ class BuilderCollection extends AbstractCollection implements CollectionInterfac
* a UuidInterface instance
*
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
+ * @psalm-suppress RedundantConditionGivenDocblockType
*/
public function unserialize($serialized): void
{
- /** @var mixed[] $data */
+ /** @var array<array-key, UuidBuilderInterface> $data */
$data = unserialize($serialized, [
'allowed_classes' => [
BrickMathCalculator::class,
@@ -68,6 +70,11 @@ class BuilderCollection extends AbstractCollection implements CollectionInterfac
],
]);
- $this->data = $data;
+ $this->data = array_filter(
+ $data,
+ function ($unserialized): bool {
+ return $unserialized instanceof UuidBuilderInterface;
+ }
+ );
}
}