Character   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 2
dl 0
loc 89
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getName() 0 4 1
A getRank() 0 4 1
A getVocation() 0 4 1
A getPoints() 0 4 1
A getLevel() 0 4 1
1
<?php
2
3
namespace Igorsgm\TibiaDataApi\Models\Highscores;
4
5
use Igorsgm\TibiaDataApi\Exceptions\ImmutableException;
6
use Igorsgm\TibiaDataApi\Traits\ImmutableTrait;
7
use Igorsgm\TibiaDataApi\Traits\SerializableTrait;
8
9
class Character
10
{
11
    use ImmutableTrait, SerializableTrait;
12
13
    /**
14
     * @var string
15
     */
16
    private $name;
17
18
    /**
19
     * @var int
20
     */
21
    private $rank;
22
23
    /**
24
     * @var string
25
     */
26
    private $vocation;
27
28
    /**
29
     * @var float|null
30
     */
31
    private $points;
32
33
    /**
34
     * @var int|null
35
     */
36
    private $level;
37
38
    /**
39
     * Character constructor.
40
     * @param  string  $name
41
     * @param  int  $rank
42
     * @param  string  $vocation
43
     * @param  float|null  $points
44
     * @param  int|null  $level
45
     * @throws ImmutableException
46
     */
47
    public function __construct(string $name, int $rank, string $vocation, ?float $points, ?int $level)
48
    {
49
        $this->handleImmutableConstructor();
50
51
        $this->name = $name;
52
        $this->rank = $rank;
53
        $this->vocation = $vocation;
54
        $this->points = $points;
55
        $this->level = $level;
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getName(): string
62
    {
63
        return $this->name;
64
    }
65
66
    /**
67
     * @return int
68
     */
69
    public function getRank(): int
70
    {
71
        return $this->rank;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getVocation(): string
78
    {
79
        return $this->vocation;
80
    }
81
82
    /**
83
     * @return float|null
84
     */
85
    public function getPoints(): ?float
86
    {
87
        return $this->points;
88
    }
89
90
    /**
91
     * @return int|null
92
     */
93
    public function getLevel(): ?int
94
    {
95
        return $this->level;
96
    }
97
}
98