public function isClassProperty(File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();

        if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_VARIABLE) {
            return false;
        }

        // Note: interfaces can not declare properties.
        $validScopes = array(
            'T_CLASS'      => true,
            'T_ANON_CLASS' => true,
            'T_TRAIT'      => true,
        );

        $scopePtr = $this->validDirectScope($phpcsFile, $stackPtr, $validScopes);
        if ($scopePtr !== false) {
            // Make sure it's not a method parameter.
            if (empty($tokens[$stackPtr]['nested_parenthesis']) === true) {
                return true;
            } else {
                $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']);
                $deepestOpen = array_pop($parenthesis);
                if ($deepestOpen < $scopePtr
                    || isset($tokens[$deepestOpen]['parenthesis_owner']) === false
                    || $tokens[$tokens[$deepestOpen]['parenthesis_owner']]['code'] !== \T_FUNCTION
                ) {
                    return true;
                }
            }
        }

        return false;
    }