SendMessage::getMandatoryFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace leocata\M1\Methods\Request;
4
5
use leocata\M1\Abstracts\RequestMethods;
6
7
/**
8
 * Class SendMessage
9
 * Sending message from the client to the server.
10
 */
11
class SendMessage extends RequestMethods
12
{
13
    /**
14
     * Session identifier.
15
     *
16
     * @var string
17
     */
18
    public $sessionid;
19
20
    /**
21
     * List of the message recipients IDs.
22
     *
23
     * @var array
24
     */
25
    public $dest;
26
27
    /**
28
     * Message content.
29
     *
30
     * @var string
31
     */
32
    public $content;
33
34
    /**
35
     * Message type.
36
     *
37
     * @var int
38
     */
39
    public $type;
40
41
    /**
42
     * Stamp. Mark the important message.
43
     *
44
     * @var bool
45
     */
46
    public $code;
47
48
    /**
49
     * Message lifetime in seconds (for the self-removed messages).
50
     *
51
     * @var int
52
     */
53
    public $lifetime;
54
55
    /**
56
     * Gets the name of all mandatory fields.
57
     *
58
     * @return array
59
     */
60 1
    public function getMandatoryFields(): array
61
    {
62
        return [
63 1
            'sessionid',
64
            'dest',
65
            'content',
66
            'type',
67
        ];
68
    }
69
}
70