Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getNodeTypes(): array
public function refactor(Node $node): ?Node
{
foreach ($this->oldToNewMethodsByClass as $type => $oldToNewMethods) {
if (! $this->isObjectType($node, $type)) {
if (! $this->isObjectType($node->var, $type)) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Rector/AbstractRector/NodeTypeResolverTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected function isMethodStaticCallOrClassMethodObjectType(Node $node, string
}

// method call is variable return
return $this->isObjectType($node, $type);
return $this->isObjectType($node->var, $type);
}

if ($node instanceof StaticCall) {
Expand Down