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.

PostbackEvent   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 2
dl 0
loc 73
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getTimestamp() 0 4 1
A getPostback() 0 4 1
A getPostbackPayload() 0 4 1
A hasPostbackReferral() 0 4 1
A getPostbackReferral() 0 4 1
A getName() 0 4 1
1
<?php
2
3
namespace Tgallice\FBMessenger\Callback;
4
5
use Tgallice\FBMessenger\Model\Callback\Postback;
6
use Tgallice\FBMessenger\Model\Callback\Referral;
7
8
class PostbackEvent extends CallbackEvent
9
{
10
    const NAME = 'postback_event';
11
12
    /**
13
     * @var int
14
     */
15
    private $timestamp;
16
    /**
17
     * @var Postback
18
     */
19
    private $postback;
20
21
    /**
22
     * @param string $senderId
23
     * @param string $recipientId
24
     * @param int $timestamp
25
     */
26 10
    public function __construct($senderId, $recipientId, $timestamp, Postback $postback)
27
    {
28 10
        parent::__construct($senderId, $recipientId);
29 10
        $this->timestamp = $timestamp;
30 10
        $this->postback = $postback;
31 10
    }
32
33
    /**
34
     * @return int
35
     */
36 1
    public function getTimestamp()
37
    {
38 1
        return $this->timestamp;
39
    }
40
41
    /**
42
     * @return Postback
43
     */
44 2
    public function getPostback()
45
    {
46 2
        return $this->postback;
47
    }
48
49
    /**
50
     * @return string
51
     */
52 1
    public function getPostbackPayload()
53
    {
54 1
        return $this->postback->getPayload();
55
    }
56
57
    /**
58
     * @return boolean
59
     */
60 1
    public function hasPostbackReferral()
61
    {
62 1
        return (bool) $this->getPostback()->hasReferral();
63
    }
64
65
    /**
66
     * @return Referral|null
67
     */
68 1
    public function getPostbackReferral()
69
    {
70 1
        return $this->postback->getReferral();
71
    }
72
73
    /**
74
     * @return string
75
     */
76 1
    public function getName()
77
    {
78 1
        return self::NAME;
79
    }
80
}
81