@@ -99,23 +99,15 @@ private function getCallableReflector($callable)
99
99
100
100
private function getTemplateSource (\Twig_Template $ template )
101
101
{
102
- // Twig templates are not always stored in files, and so there is no
103
- // API to get the filename from a template name in a generic way.
104
- // The logic used here works only for templates stored in app/Resources/views
105
- // and referenced via the "filename.html.twig" notation, not via the "::filename.html.twig"
106
- // one or stored in bundles. This is enough for the needs of the demo app.
107
- $ filePath = $ this ->kernelRootDir .'/Resources/views/ ' .$ template ->getTemplateName ();
108
- $ sourceCode = $ template ->getSource ();
109
-
110
- // Temporary workaround for https://github.com/twigphp/Twig/issues/2011
111
- if (null === $ sourceCode ) {
112
- $ sourceCode = @file_get_contents ($ filePath );
113
- }
114
-
115
102
return [
116
- 'file_path ' => $ filePath ,
103
+ // Twig templates are not always stored in files, and so there is no
104
+ // API to get the filename from a template name in a generic way.
105
+ // The logic used here works only for templates stored in app/Resources/views
106
+ // and referenced via the "filename.html.twig" notation, not via the "::filename.html.twig"
107
+ // one or stored in bundles. This is enough for the needs of the demo app.
108
+ 'file_path ' => $ this ->kernelRootDir .'/Resources/views/ ' .$ template ->getTemplateName (),
117
109
'starting_line ' => 1 ,
118
- 'source_code ' => $ sourceCode ,
110
+ 'source_code ' => $ template -> getSource () ,
119
111
];
120
112
}
121
113
0 commit comments