File tree Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Original file line number Diff line number Diff line change 28
28
*/
29
29
class ControllerListener
30
30
{
31
- /**
32
- * @var SourceCodeExtension
33
- */
34
- protected $ twigExtension ;
31
+ private $ twigExtension ;
35
32
36
33
public function __construct (SourceCodeExtension $ twigExtension )
37
34
{
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ services:
2
2
code_explorer.twig.source_code_extension :
3
3
public : false
4
4
class : CodeExplorerBundle\Twig\SourceCodeExtension
5
- arguments : [@twig.loader, %kernel.root_dir%]
5
+ arguments : [%kernel.root_dir%]
6
6
tags :
7
7
- { name: twig.extension }
8
8
Original file line number Diff line number Diff line change 22
22
*/
23
23
class SourceCodeExtension extends \Twig_Extension
24
24
{
25
- protected $ loader ;
26
- protected $ controller ;
27
- protected $ kernelRootDir ;
25
+ private $ controller ;
26
+ private $ kernelRootDir ;
28
27
29
- public function __construct (\ Twig_LoaderInterface $ loader , $ kernelRootDir )
28
+ public function __construct ($ kernelRootDir )
30
29
{
31
30
$ this ->kernelRootDir = $ kernelRootDir ;
32
- $ this ->loader = $ loader ;
33
31
}
34
32
35
33
public function setController ($ controller )
@@ -101,12 +99,10 @@ private function getCallableReflector($callable)
101
99
102
100
private function getTemplateSource (\Twig_Template $ template )
103
101
{
104
- $ templateName = $ template ->getTemplateName ();
105
-
106
102
return array (
107
- 'file_path ' => $ this ->kernelRootDir .'/Resources/views/ ' .$ templateName ,
103
+ 'file_path ' => $ this ->kernelRootDir .'/Resources/views/ ' .$ template -> getTemplateName () ,
108
104
'starting_line ' => 1 ,
109
- 'source_code ' => $ this -> loader -> getSource ($ templateName ),
105
+ 'source_code ' => $ template -> getSource (),
110
106
);
111
107
}
112
108
You can’t perform that action at this time.
0 commit comments