Message::getTime()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the slince/smartqq package.
4
 *
5
 * (c) Slince <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Slince\SmartQQ\Message\Response;
12
13
use Slince\SmartQQ\Message\Message as BaseMessage;
14
use Slince\SmartQQ\Message\Content;
15
16
class Message extends BaseMessage
17
{
18
    /**
19
     * 发送时间,时间戳.
20
     *
21
     * @var int
22
     */
23
    protected $time;
24
25
    /**
26
     * 消息类型,作用不明.
27
     *
28
     * @var int
29
     */
30
    protected $msgType = 0;
31
32
    /**
33
     * Message constructor.
34
     *
35
     * @param Content $content 消息内容
36
     * @param int     $time    发信时间
37
     * @param int     $msgId   消息id
38
     * @param int     $msgType 消息类型
39
     */
40
    public function __construct(Content $content, $time, $msgId, $msgType)
41
    {
42
        $this->time = $time;
43
        $this->msgType = $msgType;
44
        parent::__construct($content, $msgId);
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function __toString()
51
    {
52
        return (string) $this->content->getContent();
53
    }
54
55
    /**
56
     * @param int $msgType
57
     */
58
    public function setMsgType($msgType)
59
    {
60
        $this->msgType = $msgType;
61
    }
62
63
    /**
64
     * @param int $time
65
     */
66
    public function setTime($time)
67
    {
68
        $this->time = $time;
69
    }
70
71
    /**
72
     * @return int
73
     */
74
    public function getMsgType()
75
    {
76
        return $this->msgType;
77
    }
78
79
    /**
80
     * @return int
81
     */
82
    public function getTime()
83
    {
84
        return $this->time;
85
    }
86
}
87