@@ -28,11 +28,9 @@ final protected function setUpUuidTrait(): void
2828 $ this ->lastUuidValue = 0 ;
2929 }
3030
31- final protected function nextUuid ( ): string
31+ final protected static function uuidFromInteger ( int $ number ): string
3232 {
33- $ this ->lastUuidValue ??= 0 ;
34-
35- $ uuid = str_pad (dechex (++$ this ->lastUuidValue ), 32 , '0 ' , STR_PAD_LEFT );
33+ $ uuid = str_pad (dechex ($ number ), 32 , '0 ' , STR_PAD_LEFT );
3634 $ uuid = substr_replace ($ uuid , '- ' , 8 , 0 );
3735 $ uuid = substr_replace ($ uuid , '- ' , 13 , 0 );
3836 $ uuid = substr_replace ($ uuid , '- ' , 18 , 0 );
@@ -41,6 +39,13 @@ final protected function nextUuid(): string
4139 return (string ) Uuid::fromString ($ uuid );
4240 }
4341
42+ final protected function nextUuid (): string
43+ {
44+ $ this ->lastUuidValue ??= 0 ;
45+
46+ return self ::uuidFromInteger (++$ this ->lastUuidValue );
47+ }
48+
4449 final protected static function assertIsUuid (mixed $ actual , string $ message = '' ): void
4550 {
4651 self ::assertIsString ($ actual , $ message );
0 commit comments