Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
43 | 7 | private function patch($string) |
|
44 | { |
||
45 | 7 | static $patterns = [ |
|
46 | '/(->display\()\$context(, array_merge\(\$this->blocks, \$blocks\)\);\n)/', |
||
47 | '/(\$this->displayBlock\(\'[^\']+\', )\$context(, \$blocks\);\n)/', |
||
48 | ]; |
||
49 | |||
50 | 7 | return !is_string($string) ? $string : preg_replace($patterns, '$1array_merge($originalContext, $context)$2', $string); |
|
51 | } |
||
53 |