ChatMessage   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Test Coverage

Coverage 21.43%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 9
eloc 10
c 3
b 0
f 0
dl 0
loc 60
ccs 3
cts 14
cp 0.2143
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setMessage() 0 2 1
A getCharacter() 0 2 1
A setCharacter() 0 2 1
A getMessage() 0 2 1
A setId() 0 2 1
A getId() 0 2 1
A __construct() 0 1 1
A getWhen() 0 2 1
A setWhen() 0 2 1
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
  use \Nette\SmartObject;
13
  
14 1
  public function __construct(public int $id, public string $message, public string $when, public ChatCharacter $character) {
0 ignored issues
show
introduced by
Line exceeds 120 characters; contains 125 characters
Loading history...
15 1
  }
16
17
  /**
18
   * @deprecated Access the property directly
19
   */
20
  public function getId(): int {
21
    return $this->id;
22
  }
23
24
  /**
25
   * @deprecated Access the property directly
26
   */
27
  protected function setId(int $id): void {
28
    $this->id = $id;
29
  }
30
31
  /**
32
   * @deprecated Access the property directly
33
   */
34
  public function getMessage(): string {
35
    return $this->message;
36
  }
37
38
  /**
39
   * @deprecated Access the property directly
40
   */
41
  protected function setMessage(string $message): void {
42
    $this->message = $message;
43
  }
44
45
  /**
46
   * @deprecated Access the property directly
47
   */
48
  public function getWhen(): string {
49
    return $this->when;
50
  }
51
52
  /**
53
   * @deprecated Access the property directly
54
   */
55
  protected function setWhen(string $when): void {
56
    $this->when = $when;
57
  }
58
59
  /**
60
   * @deprecated Access the property directly
61
   */
62
  public function getCharacter(): ChatCharacter {
63
    return $this->character;
64
  }
65
66
  /**
67
   * @deprecated Access the property directly
68
   */
69
  protected function setCharacter(ChatCharacter $character): void {
70
    $this->character = $character;
71
  }
72
}
73
?>