@@ -77,7 +77,7 @@ private function validatePhp(CodeNode $node)
7777 $ text = str_replace ($ matches [0 ], '' , $ text );
7878 $ line = (int ) $ matches [1 ];
7979 }
80- $ this ->errorManager ->addIssue (new Issue ($ text , 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), $ line ));
80+ $ this ->errorManager ->addIssue (new Issue ($ node , $ text , 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), $ line ));
8181 }
8282
8383 private function validateXml (CodeNode $ node )
@@ -101,7 +101,7 @@ private function validateXml(CodeNode $node)
101101 return ;
102102 }
103103
104- $ this ->errorManager ->addIssue (new Issue ($ e ->getMessage (), 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), 0 ));
104+ $ this ->errorManager ->addIssue (new Issue ($ node , $ e ->getMessage (), 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), 0 ));
105105 }
106106 }
107107
@@ -116,7 +116,7 @@ private function validateYaml(CodeNode $node)
116116 return ;
117117 }
118118
119- $ this ->errorManager ->addIssue (new Issue ($ e ->getMessage (), 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), 0 ));
119+ $ this ->errorManager ->addIssue (new Issue ($ node , $ e ->getMessage (), 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), 0 ));
120120 }
121121 }
122122
@@ -132,7 +132,7 @@ private function validateTwig(CodeNode $node)
132132 // We cannot parse the TokenStream because we dont have all extensions loaded.
133133 $ this ->twig ->parse ($ tokens );
134134 } catch (SyntaxError $ e ) {
135- $ this ->errorManager ->addIssue (new Issue ($ e ->getMessage (), 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), 0 ));
135+ $ this ->errorManager ->addIssue (new Issue ($ node , $ e ->getMessage (), 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), 0 ));
136136 }
137137 }
138138
@@ -141,7 +141,7 @@ private function validateJson(CodeNode $node)
141141 try {
142142 $ data = json_decode ($ node ->getValue (), true , 512 , JSON_THROW_ON_ERROR );
143143 } catch (\JsonException $ e ) {
144- $ this ->errorManager ->addIssue (new Issue ($ e ->getMessage (), 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), 0 ));
144+ $ this ->errorManager ->addIssue (new Issue ($ node , $ e ->getMessage (), 'Invalid syntax ' , $ node ->getEnvironment ()->getCurrentFileName (), 0 ));
145145 }
146146 }
147147}
0 commit comments