diff --git a/rules-tests/Php70/Rector/StaticCall/StaticCallOnNonStaticToInstanceCallRector/Fixture/skip_static_closure_same_class_call.php.inc b/rules-tests/Php70/Rector/StaticCall/StaticCallOnNonStaticToInstanceCallRector/Fixture/skip_static_closure_same_class_call.php.inc new file mode 100644 index 00000000000..62286271fdf --- /dev/null +++ b/rules-tests/Php70/Rector/StaticCall/StaticCallOnNonStaticToInstanceCallRector/Fixture/skip_static_closure_same_class_call.php.inc @@ -0,0 +1,18 @@ +getClassReflection(); if ($classReflection instanceof ClassReflection && $classReflection->getName() === $className) { + // detect any scope where $this is unavailable or possibly unavailable + if (! $scope->hasVariableType('this')->yes()) { + return null; + } + return new MethodCall(new Variable('this'), $node->name, $node->args); }