Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
60.00% covered (warning)
60.00%
3 / 5
60.00% covered (warning)
60.00%
3 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
AuditLogIdentifier
60.00% covered (warning)
60.00%
3 / 5
60.00% covered (warning)
60.00%
3 / 5
6.60
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getEntityReference
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getMicrotime
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSeparator
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getReferenceFor
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2namespace Apie\Common\Other;
3
4use Apie\Core\Identifiers\IdentifierInterface;
5use Apie\Core\ValueObjects\EntityReference;
6use Apie\Core\ValueObjects\IdFriendlyEntityReference;
7use Apie\Core\ValueObjects\SnowflakeIdentifier;
8use ReflectionClass;
9
10/**
11 * @implements IdentifierInterface<AuditLog>
12 */
13class AuditLogIdentifier extends SnowflakeIdentifier implements IdentifierInterface
14{
15    public function __construct(
16        private IdFriendlyEntityReference $entityReference,
17        private float $microtime
18    ) {
19    }
20
21    public function getEntityReference(): IdFriendlyEntityReference
22    {
23        return $this->entityReference;
24    }
25
26    public function getMicrotime(): float
27    {
28        return $this->microtime;
29    }
30
31    protected static function getSeparator(): string
32    {
33        return '.-.';
34    }
35
36    public static function getReferenceFor(): ReflectionClass
37    {
38        return new ReflectionClass(AuditLog::class);
39    }
40}