| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | protected function doEnterNode(\Twig_Node $node, \Twig_Environment $env) |
||
| 24 | { |
||
| 25 | // add wrapper instance as argument on all method calls |
||
| 26 | if ($node instanceof \Twig_Node_Expression_MethodCall) { |
||
| 27 | $keyNode = new \Twig_Node_Expression_Constant(PhpSpreadsheetWrapper::INSTANCE_KEY, $node->getTemplateLine()); |
||
| 28 | |||
| 29 | // add wrapper even if it not exists, we fix that later |
||
| 30 | $valueNode = new \Twig_Node_Expression_Name(PhpSpreadsheetWrapper::INSTANCE_KEY, $node->getTemplateLine()); |
||
| 31 | $valueNode->setAttribute('ignore_strict_check', true); |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var \Twig_Node_Expression_Array $argumentsNode |
||
| 35 | */ |
||
| 36 | $argumentsNode = $node->getNode('arguments'); |
||
| 37 | $argumentsNode->addElement($valueNode, $keyNode); |
||
| 38 | } |
||
| 39 | |||
| 40 | return $node; |
||
| 41 | } |
||
| 42 | |||
| 51 |