Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | abstract class Command implements CommandInterface |
||
8 | { |
||
9 | private $command; |
||
10 | private $parameters; |
||
11 | |||
12 | public function __construct($command, $parameters = []) |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * Wrap the string in quotes, and normalize whitespace. Also remove double quotes. |
||
20 | */ |
||
21 | protected function wrapInQuotes($string) |
||
22 | { |
||
23 | $string = preg_replace('/[\r\n\t"]/', ' ', $string); |
||
24 | $string = '"' . str_replace('"', '\"', $string) . '"'; |
||
25 | return $string; |
||
26 | } |
||
27 | |||
28 | public function __toString(): string |
||
31 | } |
||
32 | } |
||
33 |