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 ( 5ac723...c719eb )
by Stan
07:02
created

Update::getMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Teebot\Api\Entity;
4
5
use Teebot\Api\Entity\Inline\InlineQuery;
6
use Teebot\Api\Entity\Inline\ChosenInlineResult;
7
8
class Update extends AbstractEntity
9
{
10
    const ENTITY_TYPE = 'Update';
11
12
    protected $updateType = Message::ENTITY_TYPE;
13
14
    protected $update_id;
15
16
    protected $message;
17
18
    protected $inline_query;
19
20
    protected $chosen_inline_result;
21
22
    protected $builtInEntities = [
23
        'message'              => Message::class,
24
        'inline_query'         => InlineQuery::class,
25
        'chosen_inline_result' => ChosenInlineResult::class
26
    ];
27
28
    /**
29
     * @return mixed
30
     */
31
    public function getUpdateId()
32
    {
33
        return $this->update_id;
34
    }
35
36
    /**
37
     * @param mixed $update_id
38
     */
39
    public function setUpdateId($update_id)
40
    {
41
        $this->update_id = $update_id;
42
    }
43
44
    /**
45
     * @return mixed
46
     */
47
    public function getMessage()
48
    {
49
        return $this->message;
50
    }
51
52
    /**
53
     * @param mixed $message
54
     */
55
    public function setMessage($message)
56
    {
57
        $this->message = $message;
58
        $this->setUpdateType($message);
59
    }
60
61
    /**
62
     * @return mixed
63
     */
64
    public function getInlineQuery()
65
    {
66
        return $this->inline_query;
67
    }
68
69
    /**
70
     * @param mixed $inline_query
71
     */
72
    public function setInlineQuery($inline_query)
73
    {
74
        $this->inline_query = $inline_query;
75
        $this->setUpdateType($inline_query);
76
    }
77
78
    /**
79
     * @return mixed
80
     */
81
    public function getChosenInlineResult()
82
    {
83
        return $this->chosen_inline_result;
84
    }
85
86
    /**
87
     * @param mixed $chosen_inline_result
88
     */
89
    public function setChosenInlineResult($chosen_inline_result)
90
    {
91
        $this->chosen_inline_result = $chosen_inline_result;
92
        $this->setUpdateType($chosen_inline_result);
93
    }
94
95
    /**
96
     * @return string
97
     */
98
    public function getUpdateType()
99
    {
100
        return $this->updateType;
101
    }
102
103
    /**
104
     * @param AbstractEntity $object
105
     */
106
    public function setUpdateType($object)
107
    {
108
        $this->updateType = static::ENTITY_TYPE;
109
110
        if ($object instanceof AbstractEntity) {
111
            $this->updateType = $object->getEntityType();
112
        }
113
    }
114
115
    public function getUpdateTypeEntity()
116
    {
117
        $updateTypeEntity = null;
118
119
        switch ($this->getUpdateType()) {
120
            case Message::ENTITY_TYPE:
121
                $updateTypeEntity = $this->message;
122
                break;
123
            case InlineQuery::ENTITY_TYPE:
124
                $updateTypeEntity = $this->inline_query;
125
                break;
126
            case ChosenInlineResult::ENTITY_TYPE:
127
                $updateTypeEntity = $this->chosen_inline_result;
128
                break;
129
        }
130
131
        return $updateTypeEntity;
132
    }
133
}
134