File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -765,10 +765,10 @@ protected function checkForThisWithinClass(
765765 }
766766
767767 foreach (array_reverse ($ token ['conditions ' ], true ) as $ scopePtr => $ scopeCode ) {
768- // $this within a closure is invalid
768+ // $this within a closure is valid
769769 // Note: have to fetch code from $tokens, T_CLOSURE isn't set for conditions codes.
770770 if ($ tokens [$ scopePtr ]['code ' ] === T_CLOSURE ) {
771- return false ;
771+ return true ;
772772 }
773773 if ($ scopeCode === T_CLASS ) {
774774 return true ;
Original file line number Diff line number Diff line change @@ -194,8 +194,6 @@ public function testFunctionWithClosureWarnings() {
194194 26 ,
195195 27 ,
196196 28 ,
197- 36 ,
198- 37 ,
199197 35 ,
200198 ];
201199 $ this ->assertEquals ($ expectedWarnings , $ lines );
You can’t perform that action at this time.
0 commit comments