Passed
Push — master ( a57761...826c30 )
by test
04:09
created

OfflinePushElem::setAndroidInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
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 1
    public function setPushFlag(int $value)
31
    {
32 1
        $this->setAttribute('PushFlag', $value);
33 1
        return $this;
34
    }
35
36
37
    /**
38
     *
39
     * @param string $value
40
     *
41
     * @return $this
42
     */
43 1
    public function setTitle(string $value)
44
    {
45 1
        $this->setAttribute('Title', $value);
46 1
        return $this;
47
    }
48
49
    /**
50
     *
51
     * @param string $value
52
     *
53
     * @return $this
54
     */
55 1
    public function setDesc(string $value)
56
    {
57 1
        $this->setAttribute('Desc', $value);
58 1
        return $this;
59
    }
60
61
    /**
62
     *
63
     * @param string $value
64
     *
65
     * @return $this
66
     */
67 1
    public function setExt(string $value)
68
    {
69 1
        $this->setAttribute('Ext', $value);
70 1
        return $this;
71
    }
72
73
    /**
74
     *
75
     * @param AndroidInfo $androidInfo
76
     *
77
     * @return $this
78
     * @throws \EasyIM\Kernel\Exceptions\InvalidArgumentException
79
     */
80 1
    public function setAndroidInfo(AndroidInfo $androidInfo)
81
    {
82 1
        $this->setAttribute('AndroidInfo', $androidInfo->transformToArray());
83 1
        return $this;
84
    }
85
86
87
    /**
88
     *
89
     * @param ApnsInfo $apnsInfo
90
     *
91
     * @return $this
92
     * @throws \EasyIM\Kernel\Exceptions\InvalidArgumentException
93
     */
94 1
    public function setApnsInfo(ApnsInfo $apnsInfo)
95
    {
96 1
        $this->setAttribute('ApnsInfo', $apnsInfo->transformToArray());
97 1
        return $this;
98
    }
99
}
100