Passed
Push — master ( f881c5...014efc )
by Leo
02:57
created

SendMessage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 49
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMandatoryFields() 0 7 1
1
<?php
2
3
namespace leocata\M1\Methods\Request;
4
5
use leocata\M1\Methods\MessageMethods;
6
7
/**
8
 * Class SendMessage
9
 * Sending message from the client to the server
10
 * @package leocata\M1\Methods
11
 */
12
class SendMessage extends MessageMethods
13
{
14
    /**
15
     * Session identifier.
16
     * @var string
17
     */
18
    public $sessionid;
19
20
    /**
21
     * List of the message recipients IDs.
22
     * @var array
23
     */
24
    public $dest;
25
26
    /**
27
     * Message content.
28
     * @var string
29
     */
30
    public $content;
31
32
    /**
33
     * Message type.
34
     * @var integer
35
     */
36
    public $type;
37
38
    /**
39
     * Stamp. Mark the important message.
40
     * @var boolean
41
     */
42
    public $code;
43
44
    /**
45
     * Message lifetime in seconds (for the self-removed messages).
46
     * @var integer
47
     */
48
    public $lifetime;
49
50
    /**
51
     * Gets the name of all mandatory fields
52
     * @return array
53
     */
54
    public function getMandatoryFields(): array
55
    {
56
        return [
57
            'sessionid',
58
            'dest',
59
            'content',
60
            'type',
61
        ];
62
    }
63
}
64