Completed
Push — master ( a6a584...311c12 )
by Camilo
02:12
created

Update::mapSubObjects()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 9.4286
cc 1
eloc 5
nc 1
nop 0
crap 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 18 and the first side effect is on line 3.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\Telegram\Types;
6
7
use unreal4u\InternalFunctionality\AbstractFiller;
8
use unreal4u\Telegram\Types\Message;
9
10
/**
11
 * This object represents an incoming update.
12
 * Only one of the optional parameters can be present in any given update.
13
 *
14
 * Objects defined as-is january 2016
15
 *
16
 * @see https://core.telegram.org/bots/api#update
17
 */
18
class Update extends AbstractFiller
19
{
20
    /**
21
     * The update‘s unique identifier. Update identifiers start from a certain positive number and increase
22
     * sequentially. This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated
23
     * updates or to restore the correct update sequence, should they get out of order.
24
     * @var int
25
     */
26
    public $update_id = 0;
27
28
    /**
29
     * Optional. New incoming message of any kind — text, photo, sticker, etc.
30
     * @var Message
31
     */
32
    public $message = null;
33
34
    /**
35
     * Optional. New incoming inline query
36
     * @var null
37
     */
38
    public $inline_query = null;
39
40
    /**
41
     * Optional. The result of a inline query that was chosen by a user and sent to their chat partner
42
     * @var null
43
     */
44
    public $chosen_inline_result = null;
45
46 1
    protected function mapSubObjects(): array
47
    {
48
        return [
49 1
            'message' => 'Message',
50
            'inline_query' => '', // TODO
51
            'chosen_inline_result' => '', // TODO
52
        ];
53
    }
54
}
55