aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php')
-rw-r--r--vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php27
1 files changed, 23 insertions, 4 deletions
diff --git a/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php b/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php
index 37ba78131..aca8c5db7 100644
--- a/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/DceSecurityGenerator.php
@@ -52,11 +52,29 @@ class DceSecurityGenerator implements DceSecurityGeneratorInterface
*/
private const CLOCK_SEQ_LOW = 0;
+ /**
+ * @var NumberConverterInterface
+ */
+ private $numberConverter;
+
+ /**
+ * @var TimeGeneratorInterface
+ */
+ private $timeGenerator;
+
+ /**
+ * @var DceSecurityProviderInterface
+ */
+ private $dceSecurityProvider;
+
public function __construct(
- private NumberConverterInterface $numberConverter,
- private TimeGeneratorInterface $timeGenerator,
- private DceSecurityProviderInterface $dceSecurityProvider
+ NumberConverterInterface $numberConverter,
+ TimeGeneratorInterface $timeGenerator,
+ DceSecurityProviderInterface $dceSecurityProvider
) {
+ $this->numberConverter = $numberConverter;
+ $this->timeGenerator = $timeGenerator;
+ $this->dceSecurityProvider = $dceSecurityProvider;
}
public function generate(
@@ -135,7 +153,8 @@ class DceSecurityGenerator implements DceSecurityGeneratorInterface
// Replace bytes in the time-based UUID with DCE Security values.
$bytes = substr_replace($bytes, $identifierBytes, 0, 4);
+ $bytes = substr_replace($bytes, $domainByte, 9, 1);
- return substr_replace($bytes, $domainByte, 9, 1);
+ return $bytes;
}
}