DeleteActivityLogMessage   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
c 0
b 0
f 0
dl 0
loc 51
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setRequestUrl() 0 3 1
A getDateTime() 0 3 1
A getUser() 0 3 1
A getActionName() 0 3 1
A getRequestUrl() 0 3 1
A __construct() 0 4 1
A setUser() 0 3 1
A getClassName() 0 3 1
A getObjectId() 0 3 1
1
<?php
2
3
namespace Locastic\Loggastic\Message;
4
5
use Locastic\Loggastic\Enum\ActivityLogAction;
6
7
final class DeleteActivityLogMessage implements DeleteActivityLogMessageInterface
8
{
9
    private \DateTime $dateTime;
10
    private string $actionName;
11
    private ?array $userInfo = null;
12
    private ?string $requestUrl = null;
13
14
    public function __construct(private $objectId, private readonly string $className, ?string $actionName = null)
15
    {
16
        $this->dateTime = new \DateTime();
17
        $this->actionName = $actionName ?? ActivityLogAction::DELETED;
18
    }
19
20
    public function getObjectId(): string
21
    {
22
        return $this->objectId;
23
    }
24
25
    public function getDateTime(): \DateTime
26
    {
27
        return $this->dateTime;
28
    }
29
30
    public function getActionName(): string
31
    {
32
        return $this->actionName;
33
    }
34
35
    public function getClassName(): string
36
    {
37
        return $this->className;
38
    }
39
40
    public function getUser(): ?array
41
    {
42
        return $this->userInfo;
43
    }
44
45
    public function setUser(?array $userInfo): void
46
    {
47
        $this->userInfo = $userInfo;
48
    }
49
50
    public function getRequestUrl(): ?string
51
    {
52
        return $this->requestUrl;
53
    }
54
55
    public function setRequestUrl(?string $requestUrl): void
56
    {
57
        $this->requestUrl = $requestUrl;
58
    }
59
}
60