Add test case for skipping $this in AddDefaultValueForUndefinedVariableRector

This commit is contained in:
Joyce Babu 2019-12-11 22:00:01 +05:30
parent 3fcf2c106c
commit 9563e6c3a8

View File

@ -0,0 +1,15 @@
<?php
namespace Rector\Php56\Tests\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector\Fixture;
class SkipThisAssign
{
private $val = 2;
}
$fn = function() {
return $this->val;
};
$closure = Closure::bind($fn, new SkipThisAssign(), 'SkipThisAssign');
echo $closure(), "\n";