mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-19 23:55:32 +01:00
Updated Rector to commit b18da7d458c2d240dd50682b31670e134f2b1ed3
b18da7d458
[CodeQuality] Skip on property and class const on CallableThisArrayToAnonymousFunctionRector (#5869)
This commit is contained in:
parent
efb3c476c7
commit
5ca50de6b7
@ -5,6 +5,9 @@ namespace Rector\CodeQuality\Rector\Array_;
|
|||||||
|
|
||||||
use PhpParser\Node;
|
use PhpParser\Node;
|
||||||
use PhpParser\Node\Expr\Array_;
|
use PhpParser\Node\Expr\Array_;
|
||||||
|
use PhpParser\Node\Stmt\ClassConst;
|
||||||
|
use PhpParser\Node\Stmt\Property;
|
||||||
|
use PhpParser\NodeTraverser;
|
||||||
use PHPStan\Analyser\Scope;
|
use PHPStan\Analyser\Scope;
|
||||||
use PHPStan\Reflection\Php\PhpMethodReflection;
|
use PHPStan\Reflection\Php\PhpMethodReflection;
|
||||||
use Rector\NodeCollector\NodeAnalyzer\ArrayCallableMethodMatcher;
|
use Rector\NodeCollector\NodeAnalyzer\ArrayCallableMethodMatcher;
|
||||||
@ -89,13 +92,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|int|\PhpParser\Node
|
||||||
*/
|
*/
|
||||||
public function refactorWithScope(Node $node, Scope $scope) : ?Node
|
public function refactorWithScope(Node $node, Scope $scope)
|
||||||
{
|
{
|
||||||
|
if ($node instanceof Property || $node instanceof ClassConst) {
|
||||||
|
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
|
||||||
|
}
|
||||||
if ($this->shouldSkipTwigExtension($scope)) {
|
if ($this->shouldSkipTwigExtension($scope)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = 'ca2988edc997d76a1d7d4b2c6a4f7226478cac7c';
|
public const PACKAGE_VERSION = 'b18da7d458c2d240dd50682b31670e134f2b1ed3';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2024-05-10 16:36:07';
|
public const RELEASE_DATE = '2024-05-12 01:14:59';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user