| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | public static function wrapByLines(string $text, string $tag): string |
||
| 50 | { |
||
| 51 | if (empty($text)) { |
||
| 52 | return ''; |
||
| 53 | } |
||
| 54 | |||
| 55 | $paragraphs = explode(PHP_EOL, $text); |
||
| 56 | |||
| 57 | $lines = []; |
||
| 58 | foreach ($paragraphs as $paragraph) { |
||
| 59 | if (empty($paragraph)) { |
||
| 60 | continue; |
||
| 61 | } |
||
| 62 | |||
| 63 | $lines[] = static::wrapInTag(trim($paragraph), $tag); |
||
| 64 | } |
||
| 65 | |||
| 66 | return implode(PHP_EOL, $lines); |
||
| 67 | } |
||
| 69 |