Completed
Push — master ( ac9c3e...191d3f )
by Jeroen
01:42
created

NameReplyMessage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Jerodev\PhpIrcClient\Messages;
4
5
class NameReplyMessage extends IrcMessage
6
{
7
    /** @var string */
8
    public $channel;
9
10
    /** @var string[] */
11
    public $names;
12
13
    public function __construct(string $message)
14
    {
15
        parent::__construct($message);
16
17
        $this->channel = preg_replace('/^[^\#]+(\#.*?)$/', '$1', $this->commandsuffix);
18
        $this->names = preg_split('/\s+/', $this->payload, -1, PREG_SPLIT_NO_EMPTY);
0 ignored issues
show
Documentation Bug introduced by
It seems like preg_split('/\s+/', $thi...es\PREG_SPLIT_NO_EMPTY) of type false is incompatible with the declared type string[] of property $names.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
19
    }
20
}
21