| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function parse($text) |
||
| 39 | { |
||
| 40 | $text = $this->hashBlock($text, ['code', 'a']); |
||
| 41 | $text = $this->hashInline($text, 'img'); |
||
| 42 | |||
| 43 | $text = Pattern::inject('(?<=^|[\n \>]|\.)(@)', [array_keys($this->smilies)]) |
||
| 44 | ->replace($text) |
||
| 45 | ->all() |
||
| 46 | ->callback(function ($match) { |
||
| 47 | $smiley = $match->get(1); |
||
| 48 | $link = $this->smilies[$smiley]; |
||
| 49 | return '<img class="img-smile" alt="' . $smiley . '" title="' . $smiley . '" src="/img/smilies/' . $link . '">'; |
||
| 50 | }); |
||
| 51 | |||
| 52 | $text = $this->unhash($text); |
||
| 53 | |||
| 54 | return $text; |
||
| 55 | } |
||
| 57 |