Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
GeneratedCodeTimestampId | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
getReferenceFor | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
createFromMap | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | namespace Apie\StorageMetadataBuilder\Identifiers; |
3 | |
4 | use Apie\Core\Identifiers\IdentifierInterface; |
5 | use Apie\Core\Lists\StringHashmap; |
6 | use Apie\Core\ValueObjects\Md5Checksum; |
7 | use Apie\StorageMetadataBuilder\Resources\GeneratedCodeTimestamp; |
8 | use ReflectionClass; |
9 | |
10 | /** |
11 | * @implements IdentifierInterface<GeneratedCodeTimestamp> |
12 | */ |
13 | class GeneratedCodeTimestampId extends Md5Checksum implements IdentifierInterface |
14 | { |
15 | public static function getReferenceFor(): ReflectionClass |
16 | { |
17 | return new ReflectionClass(GeneratedCodeTimestamp::class); |
18 | } |
19 | |
20 | public static function createFromMap(StringHashmap $generatedCodeHashmap) |
21 | { |
22 | return self::fromNative(md5(json_encode($generatedCodeHashmap))); |
23 | } |
24 | } |