Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
40.00% |
2 / 5 |
|
40.00% |
2 / 5 |
CRAP | |
0.00% |
0 / 1 |
| SequentialBackgroundProcessIdentifier | |
40.00% |
2 / 5 |
|
40.00% |
2 / 5 |
10.40 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 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\Attributes\Description; |
| 5 | use Apie\Core\Identifiers\IdentifierInterface; |
| 6 | use Apie\Core\Identifiers\PascalCaseSlug; |
| 7 | use Apie\Core\Identifiers\Ulid; |
| 8 | use Apie\Core\ValueObjects\SnowflakeIdentifier; |
| 9 | use ReflectionClass; |
| 10 | |
| 11 | /** |
| 12 | * @implements IdentifierInterface<SequentialBackgroundProcess> |
| 13 | */ |
| 14 | #[Description('A reference to a background process.')] |
| 15 | class SequentialBackgroundProcessIdentifier extends SnowflakeIdentifier implements IdentifierInterface |
| 16 | { |
| 17 | public function __construct( |
| 18 | private PascalCaseSlug $className, |
| 19 | private Ulid $ulid |
| 20 | ) { |
| 21 | $this->toNative(); |
| 22 | } |
| 23 | |
| 24 | protected static function getSeparator(): string |
| 25 | { |
| 26 | return ','; |
| 27 | } |
| 28 | |
| 29 | public function getClassName(): PascalCaseSlug |
| 30 | { |
| 31 | return $this->className; |
| 32 | } |
| 33 | |
| 34 | public function getUlid(): Ulid |
| 35 | { |
| 36 | return $this->ulid; |
| 37 | } |
| 38 | |
| 39 | public static function getReferenceFor(): ReflectionClass |
| 40 | { |
| 41 | return new ReflectionClass(SequentialBackgroundProcess::class); |
| 42 | } |
| 43 | } |