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   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 1
dl 0
loc 68
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getPageId() 0 4 1
A getTime() 0 4 1
A getCallbackEvents() 0 4 1
A create() 0 10 2
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