ChatMessage::setWhen()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 1
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
declare(strict_types=1);
3
4
namespace HeroesofAbenez\Chat;
5
6
/**
7
 * ChatMessage
8
 *
9
 * @author Jakub Konečný
10
 */
11 1
class ChatMessage
12
{
13
    use \Nette\SmartObject;
14
15 1
    public function __construct(
16
        public int $id,
17
        public string $message,
18
        public string $when,
19
        public ChatCharacter $character
20
    ) {
21 1
    }
22
23
    /**
24
     * @deprecated Access the property directly
25
     */
26
    public function getId(): int
27
    {
28
        return $this->id;
29
    }
30
31
    /**
32
     * @deprecated Access the property directly
33
     */
34
    protected function setId(int $id): void
35
    {
36
        $this->id = $id;
37
    }
38
39
    /**
40
     * @deprecated Access the property directly
41
     */
42
    public function getMessage(): string
43
    {
44
        return $this->message;
45
    }
46
47
    /**
48
     * @deprecated Access the property directly
49
     */
50
    protected function setMessage(string $message): void
51
    {
52
        $this->message = $message;
53
    }
54
55
    /**
56
     * @deprecated Access the property directly
57
     */
58
    public function getWhen(): string
59
    {
60
        return $this->when;
61
    }
62
63
    /**
64
     * @deprecated Access the property directly
65
     */
66
    protected function setWhen(string $when): void
67
    {
68
        $this->when = $when;
69
    }
70
71
    /**
72
     * @deprecated Access the property directly
73
     */
74
    public function getCharacter(): ChatCharacter
75
    {
76
        return $this->character;
77
    }
78
79
    /**
80
     * @deprecated Access the property directly
81
     */
82
    protected function setCharacter(ChatCharacter $character): void
83
    {
84
        $this->character = $character;
85
    }
86
}
87