PHPMD\Rule\UnusedPrivateField::isInScopeOfClass PHP Method

isInScopeOfClass() protected method

This method checks that the given property postfix is accessed on an instance or static reference to the given class.
protected isInScopeOfClass ( PHPMD\Node\ClassNode $class, PHPMD\Node\ASTNode $postfix ) : boolean
$class PHPMD\Node\ClassNode
$postfix PHPMD\Node\ASTNode
return boolean
    protected function isInScopeOfClass(ClassNode $class, ASTNode $postfix)
    {
        $owner = $postfix->getParent()->getChild(0);
        if ($owner->isInstanceOf('PropertyPostfix')) {
            $owner = $owner->getParent()->getParent()->getChild(0);
        }
        return $owner->isInstanceOf('SelfReference') || $owner->isInstanceOf('StaticReference') || strcasecmp($owner->getImage(), '$this') === 0 || strcasecmp($owner->getImage(), $class->getImage()) === 0;
    }