GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#16)
by Gallice
02:58
created

Entry::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Tgallice\FBMessenger\Model\Callback;
4
5
use Tgallice\FBMessenger\Callback\CallbackEvent;
6
use Tgallice\FBMessenger\CallbackEventFactory;
7
8
class Entry
9
{
10
    /**
11
     * @var string
12
     */
13
    private $pageId;
14
    /**
15
     * @var int
16
     */
17
    private $time;
18
19
    /**
20
     * @var CallbackEvent
21
     */
22
    private $events;
23
24
    /**
25
     * @param string $pageId
26
     * @param int $time
27
     * @param CallbackEvent[] $events
28
     */
29
    public function __construct($pageId, $time, array $events)
30
    {
31
        $this->pageId = $pageId;
32
        $this->time = $time;
33
        $this->events = $events;
0 ignored issues
show
Documentation Bug introduced by
It seems like $events of type array<integer,object<Tga...allback\CallbackEvent>> is incompatible with the declared type object<Tgallice\FBMessen...Callback\CallbackEvent> of property $events.

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...
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getPageId()
40
    {
41
        return $this->pageId;
42
    }
43
44
    /**
45
     * @return int
46
     */
47
    public function getTime()
48
    {
49
        return $this->time;
50
    }
51
52
    /**
53
     * @return CallbackEvent[]
54
     */
55
    public function getCallbackEvents()
56
    {
57
        return $this->events;
58
    }
59
60
    /**
61
     * @param array $raw
62
     *
63
     * @return static
64
     */
65
    public static function create(array $raw)
66
    {
67
        $events = [];
68
69
        foreach ($raw['messaging'] as $rawEvent) {
70
            $events[] = CallbackEventFactory::create($rawEvent);
71
        }
72
73
        return new static($raw['id'], $raw['time'], $events);
74
    }
75
}
76