Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Lines | 17 |
Ratio | 100 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 0 |
1 | <?php |
||
46 | 8 | View Code Duplication | public function writeln(Host $host, string $type, string $line) |
47 | { |
||
48 | 8 | $line = Printer::filterOutput($line); |
|
49 | |||
50 | // Omit empty lines |
||
51 | 8 | if (empty($line)) { |
|
52 | return; |
||
53 | } |
||
54 | |||
55 | 8 | if ($type === Process::ERR) { |
|
56 | 1 | $line = "[{$host->getAlias()}] err $line"; |
|
57 | } else { |
||
58 | 8 | $line = "[{$host->getAlias()}] $line"; |
|
59 | } |
||
60 | |||
61 | 8 | $this->log($line); |
|
62 | 8 | } |
|
63 | } |
||
64 |