Completed
Push — master ( 7c39f2...831177 )
by Jeroen
04:12
created

PrivmsgMessage   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 8
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
3
namespace Jerodev\PhpIrcClient\Messages;
4
5
use Jerodev\PhpIrcClient\IrcClient;
6
7
class PrivmsgMessage extends IrcMessage
8
{
9
    /** @var string */
10
    public $user;
11
    
12
    /** @var string */
13
    public $target;
14
    
15
    /** @var string */
16
    public $message;
17
    
18
    public function __construct(string $message)
19
    {
20
        parent::__construct($message);
21
        
22
        $this->user = preg_replace('/^([^!]+)!.*?$/', '$1', $this->source);
23
        $this->target = $this->commandsuffix;
24
        $this->message = $this->payload;
25
    }
26
}
27