diff options
Diffstat (limited to 'vendor/ramsey/uuid/src/Provider/Node')
4 files changed, 14 insertions, 7 deletions
diff --git a/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php index f6e5e406d..cad01045c 100644 --- a/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php +++ b/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php @@ -41,7 +41,6 @@ class FallbackNodeProvider implements NodeProviderInterface { $lastProviderException = null; - /** @var NodeProviderInterface $provider */ foreach ($this->nodeProviders as $provider) { try { return $provider->getNode(); 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; + } + ); } } diff --git a/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php index 266c0b738..76141361b 100644 --- a/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php +++ b/vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php @@ -17,6 +17,7 @@ namespace Ramsey\Uuid\Provider\Node; use Ramsey\Uuid\Exception\RandomSourceException; use Ramsey\Uuid\Provider\NodeProviderInterface; use Ramsey\Uuid\Type\Hexadecimal; +use Throwable; use function bin2hex; use function dechex; @@ -38,7 +39,7 @@ class RandomNodeProvider implements NodeProviderInterface { try { $nodeBytes = random_bytes(6); - } catch (\Throwable $exception) { + } catch (Throwable $exception) { throw new RandomSourceException( $exception->getMessage(), (int) $exception->getCode(), diff --git a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php index 8234abaee..d512f22aa 100644 --- a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php +++ b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php @@ -132,7 +132,7 @@ class SystemNodeProvider implements NodeProviderInterface $node = $matches[1][0] ?? ''; } - return (string) $node; + return $node; } /** |