Invited   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getInvitee() 0 4 1
1
<?php
2
3
4
namespace Igorsgm\TibiaDataApi\Models\Guild;
5
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 Invited
12
{
13
    use ImmutableTrait, SerializableTrait;
14
15
    /**
16
     * @var Invitee[]
17
     */
18
    private $invitee;
19
20
    /**
21
     * Invited constructor.
22
     * @param  array  $invitee
23
     * @throws ImmutableException
24
     */
25
    public function __construct(Collection $invitee)
26
    {
27
        $this->handleImmutableConstructor();
28
29
        $this->invitee = $invitee;
0 ignored issues
show
Documentation Bug introduced by
It seems like $invitee of type object<Illuminate\Support\Collection> is incompatible with the declared type array<integer,object<Igo...\Models\Guild\Invitee>> of property $invitee.

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...
30
    }
31
32
    /**
33
     * @return Invitee[]
34
     */
35
    public function getInvitee(): Collection
36
    {
37
        return $this->invitee;
38
    }
39
}
40