| Conditions | 7 |
| Paths | 4 |
| Total Lines | 24 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | protected function format($text) |
||
| 51 | { |
||
| 52 | if (empty($text)) { |
||
| 53 | return $text; |
||
| 54 | } |
||
| 55 | |||
| 56 | if (!empty($this->formattingOptions)) { |
||
| 57 | $format = ""; |
||
| 58 | foreach ($this->formattingOptions as $option => $optionValue) { |
||
| 59 | if ($optionValue === "italic") { |
||
| 60 | $text = "<i>$text</i>"; |
||
| 61 | } |
||
| 62 | else if ($optionValue === "bold") { |
||
| 63 | $text = "<b>$text</b>"; |
||
| 64 | } else { |
||
| 65 | $format .= "$option:$optionValue;"; |
||
| 66 | } |
||
| 67 | } |
||
| 68 | if (!empty($format)) { |
||
| 69 | $text = '<span style="' . $format . '">'.$text.'</span>'; |
||
| 70 | } |
||
| 71 | } |
||
| 72 | return $text; |
||
| 73 | } |
||
| 74 | } |
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.