Completed
Push — master ( 203d4a...ef9e39 )
by
unknown
04:46 queued 02:35
created

CallbackQuery::__construct()   D

Complexity

Conditions 10
Paths 134

Size

Total Lines 25
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 25
rs 4.606
c 1
b 0
f 0
cc 10
eloc 15
nc 134
nop 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A CallbackQuery::subEntities() 0 7 1

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * This file is part of the TelegramBot package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\TelegramBot\Entities;
12
13
/**
14
 * Class CallbackQuery.
15
 *
16
 * @link https://core.telegram.org/bots/api#callbackquery
17
 *
18
 * @method string  getId()              Unique identifier for this query
19
 * @method User    getFrom()            Sender
20
 * @method Message getMessage()         Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
21
 * @method string  getInlineMessageId() Optional. Identifier of the message sent via the bot in inline mode, that originated the query
22
 * @method string  getData()            Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field
23
 */
24
class CallbackQuery extends Entity
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function subEntities()
30
    {
31
        return [
32
            'from'    => User::class,
33
            'message' => Message::class,
34
        ];
35
    }
36
}
37