Text   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 24
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateSelf() 0 7 2
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
/**
17
 * Class Text.
18
 *
19
 * @property string $msg
20
 */
21
class Text extends Message
22
{
23
    /**
24
     * Message type.
25
     *
26
     * @var string
27
     */
28
    protected $type = self::TYPE_TEXT;
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected $properties = ['msg'];
33
34
    /**
35
     * {@inheritdoc}
36
     */
37 5
    protected function validateSelf()
38
    {
39 5
        parent::validateSelf();
40 4
        if (empty($this->msg)) {
41
            throw new InvalidArgumentException('msg must be set.');
42
        }
43 4
    }
44
}
45