Skip to content

Commit

Permalink
Fixes for ArrayDimFetchToMethodCallRector (#5727)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfox committed Mar 16, 2024
1 parent d1ed5f0 commit d9b64c7
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -58,13 +58,13 @@ public function refactor(Node $node): ?MethodCall
return null;
}

foreach ($this->arrayDimFetchToMethodCalls as $arrayDimFetchToMethodCall) {
if (! $node->dim instanceof Node) {
return null;
}
if (! $node->dim instanceof Node) {
return null;
}

foreach ($this->arrayDimFetchToMethodCalls as $arrayDimFetchToMethodCall) {
if (! $this->isObjectType($node->var, new ObjectType($arrayDimFetchToMethodCall->getClass()))) {
return null;
continue;
}

return new MethodCall($node->var, $arrayDimFetchToMethodCall->getMethod(), [new Arg($node->dim)]);
Expand Down

0 comments on commit d9b64c7

Please sign in to comment.