| Conditions | 7 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 57 | protected function format($text) |
||
| 58 | { |
||
| 59 | if (empty($text)) { |
||
| 60 | return $text; |
||
| 61 | } |
||
| 62 | |||
| 63 | if (!empty($this->formattingOptions)) { |
||
| 64 | $format = ""; |
||
| 65 | foreach ($this->formattingOptions as $option => $optionValue) { |
||
| 66 | if ($optionValue === "italic") { |
||
| 67 | $text = "<i>$text</i>"; |
||
| 68 | } else if ($optionValue === "bold") { |
||
| 69 | $text = "<b>$text</b>"; |
||
| 70 | } else { |
||
| 71 | $format .= "$option:$optionValue;"; |
||
| 72 | } |
||
| 73 | } |
||
| 74 | if (!empty($format)) { |
||
| 75 | $text = '<span style="' . $format . '">' . $text . '</span>'; |
||
| 76 | } |
||
| 77 | } |
||
| 78 | return $text; |
||
| 79 | } |
||
| 80 | } |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.