Completed
Push — master ( 65ec1d...8a8a83 )
by Jakub
05:39
created

ChatMessage::setMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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