aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-11 18:41:34 +0000
committerMario <mario@mariovavti.com>2022-10-11 18:41:34 +0000
commit10ba98c4f5ec4efe6272516de47f0ce128ef2902 (patch)
treefbbde69114acba764cf6b735433c53e099fd19c5 /vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php
parent108a3efe0b6d37a7ed394a84c69b924ca727f17a (diff)
downloadvolse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.tar.gz
volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.tar.bz2
volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.zip
Revert "update composer libs"
This reverts commit 108a3efe0b6d37a7ed394a84c69b924ca727f17a.
Diffstat (limited to 'vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php')
-rw-r--r--vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php27
1 files changed, 12 insertions, 15 deletions
diff --git a/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php b/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php
index 316f780c4..cee55fbef 100644
--- a/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php
+++ b/vendor/ramsey/uuid/src/Rfc4122/VersionTrait.php
@@ -14,8 +14,6 @@ declare(strict_types=1);
namespace Ramsey\Uuid\Rfc4122;
-use Ramsey\Uuid\Uuid;
-
/**
* Provides common functionality for handling the version, as defined by RFC 4122
*
@@ -29,11 +27,6 @@ trait VersionTrait
abstract public function getVersion(): ?int;
/**
- * Returns true if these fields represent a max UUID
- */
- abstract public function isMax(): bool;
-
- /**
* Returns true if these fields represent a nil UUID
*/
abstract public function isNil(): bool;
@@ -45,16 +38,20 @@ trait VersionTrait
*/
private function isCorrectVersion(): bool
{
- if ($this->isNil() || $this->isMax()) {
+ if ($this->isNil()) {
return true;
}
- return match ($this->getVersion()) {
- Uuid::UUID_TYPE_TIME, Uuid::UUID_TYPE_DCE_SECURITY,
- Uuid::UUID_TYPE_HASH_MD5, Uuid::UUID_TYPE_RANDOM,
- Uuid::UUID_TYPE_HASH_SHA1, Uuid::UUID_TYPE_REORDERED_TIME,
- Uuid::UUID_TYPE_UNIX_TIME => true,
- default => false,
- };
+ switch ($this->getVersion()) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ return true;
+ }
+
+ return false;
}
}