| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function compile(JsCompiler $compiler, \Twig_NodeInterface $node) |
||
| 32 | { |
||
| 33 | if (!$node instanceof \Twig_Node_Expression_AssignName) { |
||
| 34 | throw new \RuntimeException( |
||
| 35 | sprintf('$node must be an instanceof of \Expression_AssignName, but got "%s".', get_class($node)) |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | |||
| 39 | $compiler |
||
| 40 | ->raw('context[') |
||
| 41 | ->string($node->getAttribute('name')) |
||
| 42 | ->unsetVar($node->getAttribute('name')) |
||
| 43 | ->raw(']') |
||
| 44 | ; |
||
| 45 | } |
||
| 46 | } |
||
| 47 |