Members::getCharacters()   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\Guild;
4
5
use Igorsgm\TibiaDataApi\Exceptions\ImmutableException;
6
use Igorsgm\TibiaDataApi\Traits\ImmutableTrait;
7
use Igorsgm\TibiaDataApi\Traits\SerializableTrait;
8
use Illuminate\Support\Collection;
9
10
class Members
11
{
12
    use ImmutableTrait, SerializableTrait;
13
14
    /**
15
     * @var string
16
     */
17
    private $rankTitle;
18
19
    /**
20
     * @var Character[]
21
     */
22
    private $characters;
23
24
    /**
25
     * Members constructor.
26
     * @param  string  $rankTitle
27
     * @param  array  $characters
28
     * @throws ImmutableException
29
     */
30
    public function __construct(string $rankTitle, Collection $characters)
31
    {
32
        $this->handleImmutableConstructor();
33
34
        $this->rankTitle = $rankTitle;
35
        $this->characters = $characters;
0 ignored issues
show
Documentation Bug introduced by
It seems like $characters of type object<Illuminate\Support\Collection> is incompatible with the declared type array<integer,object<Igo...odels\Guild\Character>> of property $characters.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getRankTitle(): string
42
    {
43
        return $this->rankTitle;
44
    }
45
46
    /**
47
     * @return Character[]
48
     */
49
    public function getCharacters(): Collection
50
    {
51
        return $this->characters;
52
    }
53
}
54