Passed
Push — master ( 06b70e...4674d4 )
by Jeroen
01:32
created

TopicChangeMessage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Jerodev\PhpIrcClient\Messages;
4
5
class TopicChangeMessage extends IrcMessage
6
{
7
    /** @var string */
8
    public $channel;
9
10
    /** @var string */
11
    public $topic;
12
13
    public function __construct(string $message)
14
    {
15
        parent::__construct($message);
16
17
        $this->channel = preg_replace('/^[^\#]+(\#.*?)$/', '$1', $this->commandsuffix);
18
        $this->topic = $this->payload;
19
    }
20
}
21