Skip to content

Commit

Permalink
Merge pull request #1031 from JustMisha/fix_call_to_undefined_getpare…
Browse files Browse the repository at this point in the history
…nt_method

Fix call to undefined getParent() method
  • Loading branch information
kylekatarnls committed Sep 15, 2023
2 parents 86c76e4 + 4900081 commit 1db8e56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/php/PHPMD/Rule/CleanCode/BooleanArgumentFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public function apply(AbstractNode $node)
}
}

$parent = $node->getNode()->getParent();
$currNode = $node->getNode();
$parent = is_callable(array($currNode, 'getParent')) ? $currNode->getParent() : null;

if ($parent &&
($parent instanceof AbstractASTClassOrInterface) &&
Expand Down

0 comments on commit 1db8e56

Please sign in to comment.