Skip to content

Commit b7ebcfa

Browse files
Merge pull request #19 from TheDragonCode/1.x
UUID generation has been moved to a separate class
2 parents 1641d81 + 0c15930 commit b7ebcfa

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/TrackerRequest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace DragonCode\RequestTracker;
66

77
use Closure;
8-
use Ramsey\Uuid\UuidFactory;
98
use Symfony\Component\HttpFoundation\Request;
109

1110
use function in_array;
@@ -70,7 +69,7 @@ public function getTraceId(): string
7069
return $id;
7170
}
7271

73-
return (new UuidFactory)->uuid7()->toString();
72+
return TrackerUuid::get();
7473
}
7574

7675
public function custom(string $header, Closure $callback): static

src/TrackerUuid.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DragonCode\RequestTracker;
6+
7+
use Ramsey\Uuid\UuidFactory;
8+
9+
class TrackerUuid
10+
{
11+
public static function get(): string
12+
{
13+
return (new UuidFactory)->uuid7()->toString();
14+
}
15+
}

0 commit comments

Comments
 (0)