Skip to content

Commit

Permalink
Fix of UnusedPrivateMethod chained method calls #151
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeed Ahmed committed Jan 8, 2015
1 parent 7bc6dde commit 7e02f38
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/php/PHPMD/Rule/UnusedPrivateMethod.php
Expand Up @@ -149,10 +149,8 @@ private function removeUsedMethods(ClassNode $class, array $methods)
private function isClassScope(ClassNode $class, ASTNode $postfix)
{
$owner = $postfix->getParent()->getChild(0);
if ($owner->isInstanceOf('MethodPostfix')) {
$owner = $owner->getParent()->getParent()->getChild(0);
}
return (
$owner->isInstanceOf('MethodPostfix') ||
$owner->isInstanceOf('SelfReference') ||
$owner->isInstanceOf('StaticReference') ||
strcasecmp($owner->getImage(), '$this') === 0 ||
Expand Down

0 comments on commit 7e02f38

Please sign in to comment.