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