Passed
Push — master ( c74e83...4330b5 )
by test
02:39
created

OfflinePushElem   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 85
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 20
c 1
b 0
f 0
dl 0
loc 85
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setAndroidInfo() 0 4 1
A setDesc() 0 4 1
A setTitle() 0 4 1
A setApnsInfo() 0 4 1
A setExt() 0 4 1
A setPushFlag() 0 4 1
1
<?php
2
3
namespace EasyIM\TencentIM\Kernel\OfflinePushInfo;
4
5
use EasyIM\Kernel\Parameter;
6
7
/**
8
 * Class OfflinePushElem
9
 *
10
 * @package EasyIM\TencentIM\Kernel\OfflinePushInfo
11
 * @author  longing <[email protected]>
12
 */
13
class OfflinePushElem extends Parameter
14
{
15
    protected $properties = [
16
        'PushFlag',
17
        'Title',
18
        'Desc',
19
        'Ext',
20
        'AndroidInfo',
21
        'ApnsInfo'
22
    ];
23
24
    /**
25
     *
26
     * @param int $value 0 or 1
27
     *
28
     * @return $this
29
     */
30
    public function setPushFlag(int $value)
31
    {
32
        $this->setAttribute('PushFlag', $value);
33
        return $this;
34
    }
35
36
37
    /**
38
     *
39
     * @param string $value
40
     *
41
     * @return $this
42
     */
43
    public function setTitle(string $value)
44
    {
45
        $this->setAttribute('Title', $value);
46
        return $this;
47
    }
48
49
    /**
50
     *
51
     * @param string $value
52
     *
53
     * @return $this
54
     */
55
    public function setDesc(string $value)
56
    {
57
        $this->setAttribute('Desc', $value);
58
        return $this;
59
    }
60
61
    /**
62
     *
63
     * @param string $value
64
     *
65
     * @return $this
66
     */
67
    public function setExt(string $value)
68
    {
69
        $this->setAttribute('Ext', $value);
70
        return $this;
71
    }
72
73
    /**
74
     *
75
     * @param AndroidInfo $androidInfo
76
     *
77
     * @return $this
78
     * @throws \EasyIM\Kernel\Exceptions\InvalidArgumentException
79
     */
80
    public function setAndroidInfo(AndroidInfo $androidInfo)
81
    {
82
        $this->setAttribute('AndroidInfo', $androidInfo->transformToArray());
83
        return $this;
84
    }
85
86
87
    /**
88
     *
89
     * @param ApnsInfo $apnsInfo
90
     *
91
     * @return $this
92
     * @throws \EasyIM\Kernel\Exceptions\InvalidArgumentException
93
     */
94
    public function setApnsInfo(ApnsInfo $apnsInfo)
95
    {
96
        $this->setAttribute('ApnsInfo', $apnsInfo->transformToArray());
97
        return $this;
98
    }
99
}
100