Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
20.00% |
1 / 5 |
|
20.00% |
1 / 5 |
CRAP | |
0.00% |
0 / 1 |
SequentialBackgroundProcessIdentifier | |
20.00% |
1 / 5 |
|
20.00% |
1 / 5 |
17.80 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getSeparator | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getClassName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getUlid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getReferenceFor | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | namespace Apie\Core\BackgroundProcess; |
3 | |
4 | use Apie\Core\Identifiers\IdentifierInterface; |
5 | use Apie\Core\Identifiers\PascalCaseSlug; |
6 | use Apie\Core\Identifiers\Ulid; |
7 | use Apie\Core\ValueObjects\SnowflakeIdentifier; |
8 | use ReflectionClass; |
9 | |
10 | /** |
11 | * @implements IdentifierInterface<SequentialBackgroundProcess> |
12 | */ |
13 | class SequentialBackgroundProcessIdentifier extends SnowflakeIdentifier implements IdentifierInterface |
14 | { |
15 | public function __construct( |
16 | private PascalCaseSlug $className, |
17 | private Ulid $ulid |
18 | ) { |
19 | $this->toNative(); |
20 | } |
21 | |
22 | protected static function getSeparator(): string |
23 | { |
24 | return ','; |
25 | } |
26 | |
27 | public function getClassName(): PascalCaseSlug |
28 | { |
29 | return $this->className; |
30 | } |
31 | |
32 | public function getUlid(): Ulid |
33 | { |
34 | return $this->ulid; |
35 | } |
36 | |
37 | public static function getReferenceFor(): ReflectionClass |
38 | { |
39 | return new ReflectionClass(SequentialBackgroundProcess::class); |
40 | } |
41 | } |