Conditions | 4 |
Paths | 4 |
Total Lines | 31 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
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\\s]++/', |
||
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 | $startTagPos = $matchPos; |
||
34 | $endTagPos = $matchPos + $matchLen; |
||
35 | |||
36 | $parts = explode('^', $match); |
||
37 | unset($parts[0]); |
||
38 | |||
39 | foreach ($parts as $part) |
||
40 | { |
||
41 | $this->parser->addTagPair('SUP', $startTagPos, 1, $endTagPos, 0); |
||
42 | $startTagPos += 1 + strlen($part); |
||
43 | } |
||
44 | } |
||
45 | } |
||
46 | } |