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