@@ -78,20 +78,20 @@ public function getLastModified(): int
78
78
{
79
79
return max (
80
80
filemtime (__FILE__ ),
81
- is_file ($ filename = (new \ReflectionClass ($ this ->class ))->getFileName ()) ? filemtime ($ filename ) : 0 ,
81
+ is_file ($ filename = (new \ReflectionClass ($ this ->getClass () ))->getFileName ()) ? filemtime ($ filename ) : 0 ,
82
82
);
83
83
}
84
84
85
85
private function initFromAttributes (): void
86
86
{
87
87
$ filters = $ functions = $ tests = [];
88
- $ reflectionClass = new \ReflectionClass ($ this ->class );
88
+ $ reflectionClass = new \ReflectionClass ($ this ->getClass () );
89
89
foreach ($ reflectionClass ->getMethods () as $ method ) {
90
90
foreach ($ method ->getAttributes (AsTwigFilter::class) as $ reflectionAttribute ) {
91
91
/** @var AsTwigFilter $attribute */
92
92
$ attribute = $ reflectionAttribute ->newInstance ();
93
93
94
- $ callable = new TwigFilter ($ attribute ->name , [$ this -> class , $ method ->getName ()], [
94
+ $ callable = new TwigFilter ($ attribute ->name , [$ reflectionClass -> name , $ method ->getName ()], [
95
95
'needs_context ' => $ attribute ->needsContext ?? false ,
96
96
'needs_environment ' => $ attribute ->needsEnvironment ?? $ this ->needsEnvironment ($ method ),
97
97
'needs_charset ' => $ attribute ->needsCharset ?? false ,
@@ -114,7 +114,7 @@ private function initFromAttributes(): void
114
114
/** @var AsTwigFunction $attribute */
115
115
$ attribute = $ reflectionAttribute ->newInstance ();
116
116
117
- $ callable = new TwigFunction ($ attribute ->name , [$ this -> class , $ method ->getName ()], [
117
+ $ callable = new TwigFunction ($ attribute ->name , [$ reflectionClass -> name , $ method ->getName ()], [
118
118
'needs_context ' => $ attribute ->needsContext ?? false ,
119
119
'needs_environment ' => $ attribute ->needsEnvironment ?? $ this ->needsEnvironment ($ method ),
120
120
'needs_charset ' => $ attribute ->needsCharset ?? false ,
@@ -136,7 +136,7 @@ private function initFromAttributes(): void
136
136
/** @var AsTwigTest $attribute */
137
137
$ attribute = $ reflectionAttribute ->newInstance ();
138
138
139
- $ callable = new TwigTest ($ attribute ->name , [$ this -> class , $ method ->getName ()], [
139
+ $ callable = new TwigTest ($ attribute ->name , [$ reflectionClass -> name , $ method ->getName ()], [
140
140
'needs_context ' => $ attribute ->needsContext ?? false ,
141
141
'needs_environment ' => $ attribute ->needsEnvironment ?? $ this ->needsEnvironment ($ method ),
142
142
'needs_charset ' => $ attribute ->needsCharset ?? false ,
0 commit comments