Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
CRAP
100.00% covered (success)
100.00%
1 / 1
AuditLog
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
5
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getReference
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getRawData
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getData
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\Attributes\AlwaysDisabled;
5use Apie\Core\Attributes\Context;
6use Apie\Core\Attributes\FakeCount;
7use Apie\Core\Attributes\Not;
8use Apie\Core\Attributes\Requires;
9use Apie\Core\Attributes\StaticCheck;
10use Apie\Core\Attributes\StoreOptions;
11use Apie\Core\Entities\EntityInterface;
12use Apie\Core\ValueObjects\EntityReference;
13use Apie\Core\ValueObjects\IdFriendlyEntityReference;
14use Apie\Serializer\PropertySerializer\SerializedProperties;
15
16#[FakeCount(0)]
17class AuditLog implements EntityInterface
18{
19    private AuditLogIdentifier $id;
20
21    #[StaticCheck(new AlwaysDisabled())]
22    public function __construct(
23        private readonly IdFriendlyEntityReference $reference,
24        #[Context()]
25        #[StoreOptions(alwaysMixedData: true)]
26        private readonly SerializedProperties $serializedProperties,
27    ) {
28        $this->id = new AuditLogIdentifier($reference, microtime(true));
29    }
30
31    public function getId(): AuditLogIdentifier
32    {
33        return $this->id;
34    }
35
36    public function getReference(): IdFriendlyEntityReference
37    {
38        return $this->reference;
39    }
40
41    /**
42     * @return array<string, mixed>
43     */
44    public function getRawData(): array
45    {
46        return $this->serializedProperties->jsonSerialize();
47    }
48
49    public function getData(): ?EntityInterface
50    {
51        // TODO
52        return null;
53    }
54}