Skip to content

Commit

Permalink
[ci-review] Rector Rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 6, 2021
1 parent db1cd40 commit 5735849
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
namespace Rector\DowngradePhp74\Rector\MethodCall;

use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
use PHPStan\Type\ObjectType;
use Rector\Core\Rector\AbstractRector;
use ReflectionProperty;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

Expand Down Expand Up @@ -52,23 +54,23 @@ public function run(ReflectionProperty $reflectionProperty)
}

/**
* @return array<class-string<\PhpParser\Node>>
* @return array<class-string<Node>>
*/
public function getNodeTypes(): array
{
return [\PhpParser\Node\Expr\MethodCall::class];
return [MethodCall::class];
}

/**
* @param \PhpParser\Node\Expr\MethodCall $node
* @param MethodCall $node
*/
public function refactor(Node $node): ?Node
{
if (! $this->isName($node->name, 'getType')) {
return null;
}

if (! $this->isObjectType($node->var, new ObjectType(\ReflectionProperty::class))) {
if (! $this->isObjectType($node->var, new ObjectType(ReflectionProperty::class))) {
return null;
}

Expand Down

0 comments on commit 5735849

Please sign in to comment.