ChatCharacter   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 44.44%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 3 1
A getId() 0 3 1
A setId() 0 3 1
A __construct() 0 3 1
A getName() 0 3 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
{
13
    use \Nette\SmartObject;
14
15
    /** @var int|string */
16
    public $id;
17
18
    /**
19
     * @param int|string $id
20
     */
21 1
    public function __construct($id, public string $name)
22
    {
23 1
        $this->id = $id;
24 1
    }
25
26
    /**
27
     * @return int|string
28
     * @deprecated Access the property directly
29
     */
30
    public function getId()
31
    {
32
        return $this->id;
33
    }
34
35
    /**
36
     * @param int|string $id
37
     * @deprecated Access the property directly
38
     */
39
    protected function setId($id): void
40
    {
41
        $this->id = $id;
42
    }
43
44
    /**
45
     * @deprecated Access the property directly
46
     */
47
    public function getName(): string
48
    {
49
        return $this->name;
50
    }
51
52
    /**
53
     * @deprecated Access the property directly
54
     */
55
    protected function setName(string $name): void
56
    {
57
        $this->name = $name;
58
    }
59
}
60