Character::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 17

Duplication

Lines 17
Ratio 100 %

Importance

Changes 0
Metric Value
dl 17
loc 17
rs 9.7
c 0
b 0
f 0
cc 1
nc 1
nop 6
1
<?php
2
3
namespace Igorsgm\TibiaDataApi\Models\Guild;
4
5
use Carbon\Carbon;
6
use Igorsgm\TibiaDataApi\Exceptions\ImmutableException;
7
use Igorsgm\TibiaDataApi\Traits\ImmutableTrait;
8
use Igorsgm\TibiaDataApi\Traits\SerializableTrait;
9
10 View Code Duplication
class Character
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    use ImmutableTrait, SerializableTrait;
13
14
    /**
15
     * @var string
16
     */
17
    private $name;
18
19
    /**
20
     * @var string
21
     */
22
    private $nick;
23
24
    /**
25
     * @var int
26
     */
27
    private $level;
28
29
    /**
30
     * @var string
31
     */
32
    private $vocation;
33
34
    /**
35
     * @var Carbon
36
     */
37
    private $joined;
38
39
    /**
40
     * @var string
41
     */
42
    private $status;
43
44
    /**
45
     * Character constructor.
46
     *
47
     * @param  string  $name
48
     * @param  string  $nick
49
     * @param  int  $level
50
     * @param  string  $vocation
51
     * @param  Carbon  $joined
52
     * @param  string  $status
53
     * @throws ImmutableException
54
     */
55
    public function __construct(
56
        string $name,
57
        string $nick,
58
        int $level,
59
        string $vocation,
60
        Carbon $joined,
61
        string $status
62
    ) {
63
        $this->handleImmutableConstructor();
64
65
        $this->name = $name;
66
        $this->nick = $nick;
67
        $this->level = $level;
68
        $this->vocation = $vocation;
69
        $this->joined = $joined;
70
        $this->status = $status;
71
    }
72
73
    /**
74
     * @return string
75
     */
76
    public function getName(): string
77
    {
78
        return $this->name;
79
    }
80
81
    /**
82
     * @return string
83
     */
84
    public function getNick(): string
85
    {
86
        return $this->nick;
87
    }
88
89
    /**
90
     * @return int
91
     */
92
    public function getLevel(): int
93
    {
94
        return $this->level;
95
    }
96
97
    /**
98
     * @return string
99
     */
100
    public function getVocation(): string
101
    {
102
        return $this->vocation;
103
    }
104
105
    /**
106
     * @return Carbon
107
     */
108
    public function getJoined(): Carbon
109
    {
110
        return $this->joined;
111
    }
112
113
    /**
114
     * @return string
115
     */
116
    public function getStatus(): string
117
    {
118
        return $this->status;
119
    }
120
}
121