@@ -70,27 +70,25 @@ private function loadNode(\Twig_Node $node)
70
70
'vars ' => $ node ->getAttribute ('vars ' ),
71
71
),
72
72
);
73
- } elseif ($ node instanceof \Twig_Node_Expression_Function ) {
73
+ } elseif ($ node instanceof AsseticFilterNode ) {
74
74
$ name = $ node ->getAttribute ('name ' );
75
75
76
- if ($ this ->twig ->getFunction ($ name ) instanceof AsseticFilterFunction) {
77
- $ arguments = array ();
78
- foreach ($ node ->getNode ('arguments ' ) as $ argument ) {
79
- $ arguments [] = eval ('return ' .$ this ->twig ->compile ($ argument ).'; ' );
80
- }
81
-
82
- $ invoker = $ this ->twig ->getExtension ('Assetic \\Extension \\Twig \\AsseticExtension ' )->getFilterInvoker ($ name );
76
+ $ arguments = array ();
77
+ foreach ($ node ->getNode ('arguments ' ) as $ argument ) {
78
+ $ arguments [] = eval ('return ' .$ this ->twig ->compile ($ argument ).'; ' );
79
+ }
83
80
84
- $ inputs = isset ($ arguments [0 ]) ? (array ) $ arguments [0 ] : array ();
85
- $ filters = $ invoker ->getFilters ();
86
- $ options = array_replace ($ invoker ->getOptions (), isset ($ arguments [1 ]) ? $ arguments [1 ] : array ());
81
+ $ invoker = $ this ->twig ->getExtension ('Assetic\Extension\Twig\AsseticExtension ' )->getFilterInvoker ($ name );
87
82
88
- if (! isset ($ options [ ' name ' ])) {
89
- $ options [ ' name ' ] = $ invoker ->getFactory ()-> generateAssetName ( $ inputs , $ filters , $ options );
90
- }
83
+ $ inputs = isset ($ arguments [ 0 ]) ? ( array ) $ arguments [ 0 ] : array ();
84
+ $ filters = $ invoker ->getFilters ( );
85
+ $ options = array_replace ( $ invoker -> getOptions (), isset ( $ arguments [ 1 ]) ? $ arguments [ 1 ] : array ());
91
86
92
- $ formulae [$ options ['name ' ]] = array ($ inputs , $ filters , $ options );
87
+ if (!isset ($ options ['name ' ])) {
88
+ $ options ['name ' ] = $ invoker ->getFactory ()->generateAssetName ($ inputs , $ filters , $ options );
93
89
}
90
+
91
+ $ formulae [$ options ['name ' ]] = array ($ inputs , $ filters , $ options );
94
92
}
95
93
96
94
foreach ($ node as $ child ) {
0 commit comments