UpdateFriendParameter::setSnsItem()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
namespace EasyIM\TencentIM\Sns\Parameter;
4
5
use EasyIM\Kernel\Parameter;
6
use EasyIM\TencentIM\Kernel\Parameter\TagParameter;
7
8
/**
9
 * Class UpdateFriendParameter
10
 *
11
 * @package EasyIM\TencentIM\Sns\Parameter
12
 * @author  longing <[email protected]>
13
 */
14
class UpdateFriendParameter extends Parameter
15
{
16
    protected $properties = [
17
        'To_Account',
18
        'SnsItem'
19
    ];
20
21
    protected $required = ['To_Account', 'SnsItem'];
22
23
    /**
24
     *
25
     * @param TagParameter ...$tagParameters
26
     *
27
     * @return $this
28
     */
29
    public function setSnsItem(TagParameter ...$tagParameters)
30
    {
31
        $this->setAttribute('SnsItem', parameterList(...$tagParameters)());
32
        return $this;
33
    }
34
35
    public function setToAccount(string $account)
36
    {
37
        $this->setAttribute('To_Account', $account);
38
39
        return $this;
40
    }
41
}
42