aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Provider
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ramsey/uuid/src/Provider')
-rw-r--r--vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php7
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php1
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/NodeProviderCollection.php15
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/RandomNodeProvider.php3
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php2
5 files changed, 17 insertions, 11 deletions
diff --git a/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php b/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php
index 1a1f4cf2e..6d6240b7a 100644
--- a/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php
+++ b/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php
@@ -177,8 +177,7 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
return '';
}
- /** @var string $sid */
- $sid = str_getcsv(trim($response))[1] ?? '';
+ $sid = str_getcsv(trim((string) $response))[1] ?? '';
if (($lastHyphen = strrpos($sid, '-')) === false) {
return '';
@@ -207,7 +206,7 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
}
/** @var string[] $userGroups */
- $userGroups = preg_split('/\s{2,}/', $response, -1, PREG_SPLIT_NO_EMPTY);
+ $userGroups = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY);
$firstGroup = trim($userGroups[1] ?? '', "* \t\n\r\0\x0B");
@@ -222,7 +221,7 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
}
/** @var string[] $userGroup */
- $userGroup = preg_split('/\s{2,}/', $response, -1, PREG_SPLIT_NO_EMPTY);
+ $userGroup = preg_split('/\s{2,}/', (string) $response, -1, PREG_SPLIT_NO_EMPTY);
$sid = $userGroup[1] ?? '';
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;
}
/**