| Conditions | 4 |
| Paths | 6 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function suffix(bool $result = true): string |
||
| 39 | { |
||
| 40 | $totalLen = \strlen($this->outPad . $this->outMessage); |
||
| 41 | $output = null; |
||
| 42 | |||
| 43 | //overwrite current line |
||
| 44 | $output .= "\033[" . $totalLen . 'D'; |
||
| 45 | $output .= \str_repeat(' ', $this->padding); |
||
| 46 | $output .= $this->outMessage; |
||
| 47 | |||
| 48 | $padLen = 74 - $totalLen; |
||
| 49 | if (0 < $padLen) { |
||
| 50 | $output .= \str_repeat(' ', $padLen); |
||
| 51 | } |
||
| 52 | if ($this->showResult) { |
||
| 53 | $output .= '['; |
||
| 54 | $output .= $result |
||
| 55 | ? "\e[32mOK" |
||
| 56 | : "\e[31mKO"; |
||
| 57 | $output .= "\e[0m" . ']'; |
||
| 58 | } |
||
| 59 | |||
| 60 | $output .= "\r"; |
||
| 61 | |||
| 62 | return $output; |
||
| 63 | } |
||
| 70 |