Completed
Push — master ( 640da7...eb7508 )
by Danilo
03:54
created

Message::getMessageId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of the PhpBotFramework.
5
 *
6
 * PhpBotFramework is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Lesser General Public License as
8
 * published by the Free Software Foundation, version 3.
9
 *
10
 * PhpBotFramework is distributed in the hope that it will be useful, but
11
 * WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public License
16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
namespace PhpBotFramework\Entities;
20
21
/**
22
 * \addtogroup Entities Entities
23
 * @{
24
 */
25
26
/** \class Message
27
 * \brief This object represents a message.
28
 */
29 View Code Duplication
class Message implements \ArrayAccess
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
{
31
    /** @} */
32
33
    use EntityAccess;
34
35
    public function getText() : string
36
    {
37
        // Get text of the message if any
38
        return isset($this->container['text']) ? $this->container['text'] : null;
39
    }
40
41
    public function getChatID()
42
    {
43
        // Return the chat id
44
        return $this->container['chat']['id'];
45
    }
46
47
    public function getMessageId() : int
48
    {
49
        return $this->container['message_id'];
50
    }
51
}
52