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 20, 2021
1 parent 7f81d8c commit 0f30c5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PhpParser\Node;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\StaticCall;
use Rector\Core\Rector\AbstractRector;
use Rector\DowngradePhp73\Tokenizer\FollowedByCommaAnalyzer;
Expand Down Expand Up @@ -65,7 +66,7 @@ public function __construct(string $value)
*/
public function getNodeTypes(): array
{
return [FuncCall::class, MethodCall::class, StaticCall::class, Node\Expr\New_::class];
return [FuncCall::class, MethodCall::class, StaticCall::class, New_::class];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function refactor(Node $node): ?Node

$node->setAttribute(AttributeKey::CREATED_BY_RULE, self::class);
return new Ternary(
$this->nodeFactory->createFuncCall('method_exists', [$node->var, 'getType']),
$this->nodeFactory->createFuncCall('method_exists', fn (): string => $node->var->getType()),
$node,
$this->nodeFactory->createNull()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function refactor(Node $node): ?Node

$node->setAttribute(AttributeKey::CREATED_BY_RULE, self::class);
return new Ternary(
$this->nodeFactory->createFuncCall('method_exists', [$node->var, 'getAttributes']),
$this->nodeFactory->createFuncCall('method_exists', fn (): array => $node->var->getAttributes()),
$node,
new Array_([])
);
Expand Down

0 comments on commit 0f30c5d

Please sign in to comment.