mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit a67952f6d15ef954da70898c58aa10567b51c11e
a67952f6d1
[Php81] Skip on property and class const on FirstClassCallableRector (#5813)
This commit is contained in:
parent
e56fb5adb0
commit
d495dc4fe7
|
@ -10,7 +10,10 @@ use PhpParser\Node\Expr\MethodCall;
|
||||||
use PhpParser\Node\Expr\PropertyFetch;
|
use PhpParser\Node\Expr\PropertyFetch;
|
||||||
use PhpParser\Node\Expr\StaticCall;
|
use PhpParser\Node\Expr\StaticCall;
|
||||||
use PhpParser\Node\Expr\Variable;
|
use PhpParser\Node\Expr\Variable;
|
||||||
|
use PhpParser\Node\Stmt\ClassConst;
|
||||||
|
use PhpParser\Node\Stmt\Property;
|
||||||
use PhpParser\Node\VariadicPlaceholder;
|
use PhpParser\Node\VariadicPlaceholder;
|
||||||
|
use PhpParser\NodeTraverser;
|
||||||
use PHPStan\Analyser\Scope;
|
use PHPStan\Analyser\Scope;
|
||||||
use PHPStan\Reflection\ClassReflection;
|
use PHPStan\Reflection\ClassReflection;
|
||||||
use PHPStan\Reflection\ReflectionProvider;
|
use PHPStan\Reflection\ReflectionProvider;
|
||||||
|
@ -79,14 +82,17 @@ CODE_SAMPLE
|
||||||
*/
|
*/
|
||||||
public function getNodeTypes() : array
|
public function getNodeTypes() : array
|
||||||
{
|
{
|
||||||
return [Array_::class];
|
return [Property::class, ClassConst::class, Array_::class];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param Array_ $node
|
* @param Property|ClassConst|Array_ $node
|
||||||
* @return null|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\MethodCall
|
* @return int|null|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\MethodCall
|
||||||
*/
|
*/
|
||||||
public function refactorWithScope(Node $node, Scope $scope)
|
public function refactorWithScope(Node $node, Scope $scope)
|
||||||
{
|
{
|
||||||
|
if ($node instanceof Property || $node instanceof ClassConst) {
|
||||||
|
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
|
||||||
|
}
|
||||||
$arrayCallable = $this->arrayCallableMethodMatcher->match($node, $scope);
|
$arrayCallable = $this->arrayCallableMethodMatcher->match($node, $scope);
|
||||||
if (!$arrayCallable instanceof ArrayCallable) {
|
if (!$arrayCallable instanceof ArrayCallable) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '1bbb3faaed01bd234f8e53564d1686529551e75a';
|
public const PACKAGE_VERSION = 'a67952f6d15ef954da70898c58aa10567b51c11e';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2024-04-08 20:16:33';
|
public const RELEASE_DATE = '2024-04-08 20:32:48';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue