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.
Passed
Push — master ( e6911b...12118e )
by Gallice
04:03
created

PostbackEvent::hasPostbackReferral()   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\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