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\IdFriendlyEntityReference;
6use Apie\Core\ValueObjects\SnowflakeIdentifier;
7use ReflectionClass;
8
9/**
10 * @implements IdentifierInterface<AuditLog>
11 */
12class AuditLogIdentifier extends SnowflakeIdentifier implements IdentifierInterface
13{
14    public function __construct(
15        private IdFriendlyEntityReference $entityReference,
16        private float $microtime
17    ) {
18    }
19
20    public function getEntityReference(): IdFriendlyEntityReference
21    {
22        return $this->entityReference;
23    }
24
25    public function getMicrotime(): float
26    {
27        return $this->microtime;
28    }
29
30    protected static function getSeparator(): string
31    {
32        return '.-.';
33    }
34
35    public static function getReferenceFor(): ReflectionClass
36    {
37        return new ReflectionClass(AuditLog::class);
38    }
39}