Death::getInvolved()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Igorsgm\TibiaDataApi\Models\Character;
4
5
use Carbon\Carbon;
6
use Igorsgm\TibiaDataApi\Exceptions\ImmutableException;
7
use Igorsgm\TibiaDataApi\Traits\ImmutableTrait;
8
use Igorsgm\TibiaDataApi\Traits\SerializableTrait;
9
use Illuminate\Support\Collection;
10
11
class Death
12
{
13
    use ImmutableTrait, SerializableTrait;
14
15
    /**
16
     * @var Carbon
17
     */
18
    private $date;
19
20
    /**
21
     * @var int
22
     */
23
    private $level;
24
25
    /**
26
     * @var string
27
     */
28
    private $reason;
29
30
    /**
31
     * @var Collection
32
     */
33
    private $involved;
34
35
    /**
36
     * Death constructor.
37
     * @param  Carbon  $date
38
     * @param  int  $level
39
     * @param  string  $reason
40
     * @param  array  $involved
41
     * @throws ImmutableException
42
     */
43
    public function __construct(Carbon $date, int $level, string $reason, Collection $involved)
44
    {
45
        $this->handleImmutableConstructor();
46
47
        $this->date = $date;
48
        $this->level = $level;
49
        $this->reason = $reason;
50
        $this->involved = $involved;
51
    }
52
53
    /**
54
     * @return Carbon
55
     */
56
    public function getDate(): Carbon
57
    {
58
        return $this->date;
59
    }
60
61
    /**
62
     * @return int
63
     */
64
    public function getLevel(): int
65
    {
66
        return $this->level;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getReason(): string
73
    {
74
        return $this->reason;
75
    }
76
77
    /**
78
     * @return array
79
     */
80
    public function getInvolved(): Collection
81
    {
82
        return $this->involved;
83
    }
84
}
85