Skip to content

Commit ce93426

Browse files
committed
[ci-review] Rector Rectify
1 parent 6639d5c commit ce93426

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

rules/Unambiguous/Rector/Expression/FluentSettersToStandaloneCallMethodRector.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Rector\Unambiguous\Rector\Expression;
66

7+
use PhpParser\Node\Stmt\Return_;
78
use PhpParser\Node;
89
use PhpParser\Node\Expr;
910
use PhpParser\Node\Expr\Assign;
@@ -67,15 +68,15 @@ public function run()
6768
}
6869

6970
/**
70-
* @return array<class-string<\PhpParser\Node>>
71+
* @return array<class-string<Node>>
7172
*/
7273
public function getNodeTypes(): array
7374
{
74-
return [Expression::class, Node\Stmt\Return_::class];
75+
return [Expression::class, Return_::class];
7576
}
7677

7778
/**
78-
* @param Expression|Node\Stmt\Return_ $node
79+
* @param Expression|Return_ $node
7980
*/
8081
public function refactor(Node $node): ?array
8182
{
@@ -126,10 +127,11 @@ public function refactor(Node $node): ?array
126127

127128
private function resolveVariableName(Expr $expr): string
128129
{
129-
if ($expr instanceof New_) {
130-
if ($expr->class instanceof Name) {
131-
return $this->propertyNaming->fqnToVariableName($expr->class);
132-
}
130+
if (!$expr instanceof New_) {
131+
return 'someVariable';
132+
}
133+
if ($expr->class instanceof Name) {
134+
return $this->propertyNaming->fqnToVariableName($expr->class);
133135
}
134136

135137
return 'someVariable';

0 commit comments

Comments
 (0)