Video   A
last analyzed

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 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 24
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 Video extends Message
17
{
18
    /**
19
     * Message type.
20
     *
21
     * @var string
22
     */
23
    protected $type = self::TYPE_VIDEO;
24
25
    protected $properties = ['filename', 'thumb', 'length', 'secret', 'file_length', 'thumb_secret', 'url'];
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 2
    protected function validateSelf()
31
    {
32 2
        parent::validateSelf();
33 1
        foreach ($this->properties as $prop) {
34 1
            if (empty($this->{$prop})) {
35
                throw new InvalidArgumentException("{$prop} can not be null");
36
            }
37 1
        }
38 1
    }
39
}
40