Text::validateSelf()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 5
cp 0.8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 2.032
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