Cmd   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 23
ccs 6
cts 7
cp 0.8571
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateSelf() 0 9 3
1
<?php
2
3
/*
4
 * This file is part of the light/easemob.
5
 *
6
 * (c) lichunqiang <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace light\Easemob\Message;
13
14
use light\Easemob\Exception\InvalidArgumentException;
15
16
class Cmd extends Message
17
{
18
    /**
19
     * Message type.
20
     *
21
     * @var string
22
     */
23
    protected $type = self::TYPE_CMD;
24
25
    protected $properties = ['action'];
26
    /**
27
     * {@inheritdoc}
28
     */
29 2
    protected function validateSelf()
30
    {
31 2
        parent::validateSelf();
32 2
        foreach ($this->properties as $prop) {
33 2
            if (empty($this->{$prop})) {
34
                throw new InvalidArgumentException("{$prop} can not be null");
35
            }
36 2
        }
37 2
    }
38
}
39