Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function __construct(string $message) |
||
23 | { |
||
24 | $this->rawMessage = $message; |
||
25 | |||
26 | if (preg_match('/^(?::(?<source>[^\s]+)\s*)?(?<command>[^\s]+)\s*(?<commandsuffix>[^:$]+)?\s*(?::(?<payload>.*?))?$/', $message, $matches)) { |
||
27 | $this->source = $matches['source'] ?? null; |
||
28 | $this->command = $matches['command'] ?? null; |
||
29 | $this->commandsuffix = trim($matches['commandsuffix'] ?? null); |
||
30 | $this->payload = $matches['payload'] ?? null; |
||
31 | } |
||
44 |