| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | protected function execute() |
||
| 16 | { |
||
| 17 | $pos = strpos($this->text, '~~'); |
||
| 18 | if ($pos === false) |
||
| 19 | { |
||
| 20 | return; |
||
| 21 | } |
||
| 22 | |||
| 23 | preg_match_all( |
||
| 24 | '/~~[^\\x17]+?~~/', |
||
| 25 | $this->text, |
||
| 26 | $matches, |
||
| 27 | PREG_OFFSET_CAPTURE, |
||
| 28 | $pos |
||
| 29 | ); |
||
| 30 | foreach ($matches[0] as list($match, $matchPos)) |
||
| 31 | { |
||
| 32 | $matchLen = strlen($match); |
||
| 33 | |||
| 34 | $this->parser->addTagPair('DEL', $matchPos, 2, $matchPos + $matchLen - 2, 2); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | } |