Conditions | 2 |
Paths | 2 |
Total Lines | 20 |
Code Lines | 6 |
Lines | 20 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
31 | public function compile(JsCompiler $compiler, \Twig_NodeInterface $node) |
||
32 | { |
||
33 | if (!$node instanceof \Twig_Node_SetTemp) { |
||
34 | throw new \RuntimeException( |
||
35 | sprintf( |
||
36 | '$node must be an instanceof of \Twig_Node_SetTemp, but got "%s".', |
||
37 | get_class($node) |
||
38 | ) |
||
39 | ); |
||
40 | } |
||
41 | |||
42 | /* |
||
43 | This method has been gutted as part of schmittjoh/twig.js#12 |
||
44 | |||
45 | Assigning context variables to temporary "tmp_" variables is a |
||
46 | performance optimization that was misbehaving and causing trouble with |
||
47 | variables in different scopes, so it has been removed until it can be |
||
48 | implemented reliably. |
||
49 | */ |
||
50 | } |
||
51 | } |
||
52 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.