ChatCharacter   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 44.44%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
eloc 8
c 2
b 0
f 0
dl 0
loc 41
ccs 4
cts 9
cp 0.4444
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 2 1
A getId() 0 2 1
A setId() 0 2 1
A __construct() 0 2 1
A getName() 0 2 1
1
<?php
2
declare(strict_types=1);
3
4
namespace HeroesofAbenez\Chat;
5
6
/**
7
 * ChatCharacter
8
 *
9
 * @author Jakub Konečný
10
 */
11 1
class ChatCharacter {
12
  use \Nette\SmartObject;
13
  
14
  /** @var int|string */
15
  public $id;
16
  
17
  /**
18
   * @param int|string $id
19
   */
20 1
  public function __construct($id, public string $name) {
21 1
    $this->id = $id;
22 1
  }
23
  
24
  /**
25
   * @deprecated Access the property directly
26
   * @return int|string
27
   */
28
  public function getId() {
29
    return $this->id;
30
  }
31
32
  /**
33
   * @deprecated Access the property directly
34
   * @param int|string $id
35
   */
36
  protected function setId($id): void {
37
    $this->id = $id;
38
  }
39
40
  /**
41
   * @deprecated Access the property directly
42
   */
43
  public function getName(): string {
44
    return $this->name;
45
  }
46
47
  /**
48
   * @deprecated Access the property directly
49
   */
50
  protected function setName(string $name): void {
51
    $this->name = $name;
52
  }
53
}
54
?>