Completed
Push — master ( 42b611...b70ab3 )
by light
02:44
created

Cmd   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 85.71%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateSelf() 0 9 3
1
<?php
2
3
namespace light\Easemob\Message;
4
5
use light\Easemob\Exception\InvalidArgumentException;
6
7
class Cmd extends Message
8
{
9
    /**
10
     * Message type.
11
     *
12
     * @var string
13
     */
14
    protected $type = self::TYPE_CMD;
15
16
    protected $properties = ['action'];
17
    /**
18
     * @inheritdoc
19
     */
20 2
    protected function validateSelf()
21
    {
22 2
        parent::validateSelf();
23 2
        foreach($this->properties as $prop) {
24 2
            if (empty($this->{$prop})) {
25
                throw new InvalidArgumentException("{$prop} can not be null");
26
            }
27 2
        }
28 2
    }
29
30
}
31