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
Push — master ( 912221...961991 )
by Gallice
05:44 queued 02:40
created

Entry::getPageId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
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 6
    public function __construct($pageId, $time, array $events)
30
    {
31 6
        $this->pageId = $pageId;
32 6
        $this->time = $time;
33 6
        $this->events = $events;
34 6
    }
35
36
    /**
37
     * @return string
38
     */
39 1
    public function getPageId()
40
    {
41 1
        return $this->pageId;
42
    }
43
44
    /**
45
     * @return int
46
     */
47 1
    public function getTime()
48
    {
49 1
        return $this->time;
50
    }
51
52
    /**
53
     * @return CallbackEvent[]
54
     */
55 2
    public function getCallbackEvents()
56
    {
57 2
        return $this->events;
58
    }
59
60
    /**
61
     * @param array $raw
62
     *
63
     * @return static
64
     */
65 2
    public static function create(array $raw)
66
    {
67 2
        $events = [];
68
69 2
        foreach ($raw['messaging'] as $rawEvent) {
70 2
            $events[] = CallbackEventFactory::create($rawEvent);
71 2
        }
72
73 2
        return new static($raw['id'], $raw['time'], $events);
74
    }
75
}
76