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

ChatCharacter   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 10
c 1
b 0
f 0
dl 0
loc 39
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 3 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
 * @property int|string $id
11
 * @property string $name
12
 */
13
class ChatCharacter {
14
  use \Nette\SmartObject;
15
  
16
  /** @var int|string */
17
  protected $id;
18
  /** @var string */
19
  protected string $name;
20
  
21
  /**
22
   * @param int|string $id
23
   */
24
  public function __construct($id, string $name) {
25
    $this->id = $id;
26
    $this->name = $name;
27
  }
28
  
29
  /**
30
   * @return int|string
31
   */
32
  public function getId() {
33
    return $this->id;
34
  }
35
36
  /**
37
   * @param int|string $id
38
   */
39
  protected function setId($id): void {
40
    $this->id = $id;
41
  }
42
  
43
  /**
44
   * @return string
45
   */
46
  public function getName(): string {
47
    return $this->name;
48
  }
49
50
  protected function setName(string $name): void {
51
    $this->name = $name;
52
  }
53
}
54
?>