| Conditions | 5 |
| Paths | 8 |
| Total Lines | 26 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 55 | public function render() |
||
| 56 | { |
||
| 57 | 1 | $textIsColored = ($this->getTextColor() !== null); |
|
| 58 | 1 | $backgroundIsColored = ($this->getBackgroundColor() !== null); |
|
| 59 | |||
| 60 | 1 | $styles = $this->getStyles(); |
|
| 61 | 1 | $stringHasStyles = (!empty($styles)); |
|
| 62 | |||
| 63 | 1 | $text = $this->getText(); |
|
| 64 | |||
| 65 | 1 | if ($textIsColored) { |
|
| 66 | 1 | $text = $this->frame($text, $this->getTextColor()->getEscapeCharacter()); |
|
| 67 | 1 | } |
|
| 68 | |||
| 69 | 1 | if ($backgroundIsColored) { |
|
| 70 | 1 | $text = $this->frame($text, $this->getBackgroundColor()->getEscapeCharacter()); |
|
| 71 | 1 | } |
|
| 72 | |||
| 73 | 1 | if ($stringHasStyles) { |
|
| 74 | 1 | foreach ($styles as $style) { |
|
| 75 | 1 | $text = $this->frame($text, $style->getEscapeCharacter()); |
|
| 76 | 1 | } |
|
| 77 | 1 | } |
|
| 78 | |||
| 79 | 1 | return $text; |
|
| 80 | } |
||
| 81 | |||
| 97 |