private function isProperty(Tokens $tokens, $index, $endIndex)
    {
        if ($tokens[$index]->isGivenKind(T_VARIABLE)) {
            $nextIndex = $tokens->getNextMeaningfulToken($index);
            if (null === $nextIndex || !$tokens[$nextIndex]->isGivenKind(T_OBJECT_OPERATOR)) {
                return false;
            }
            $nextIndex = $tokens->getNextMeaningfulToken($nextIndex);
            $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex);
            if (null !== $nextNextIndex && $nextNextIndex < $endIndex) {
                return false;
            }

            return null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_STRING);
        }

        if ($tokens[$index]->isGivenKind([T_NS_SEPARATOR, T_STRING])) {
            $nextIndex = $tokens->getTokenNotOfKindSibling($index, 1, [[T_DOUBLE_COLON], [T_NS_SEPARATOR], [T_STRING]]);
            $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex);
            if (null !== $nextNextIndex && $nextNextIndex < $endIndex) {
                return false;
            }

            return null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_VARIABLE);
        }

        return false;
    }
private function isProperty(Tokens $tokens, $index, $endIndex)
    {
        if ($tokens[$index]->isGivenKind(T_VARIABLE)) {
            $nextIndex = $tokens->getNextMeaningfulToken($index);
            if (null === $nextIndex || !$tokens[$nextIndex]->isGivenKind(T_OBJECT_OPERATOR)) {
                return false;
            }
            $nextIndex = $tokens->getNextMeaningfulToken($nextIndex);
            $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex);
            if (null !== $nextNextIndex && $nextNextIndex < $endIndex) {
                return false;
            }

            return null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_STRING);
        }

        if ($tokens[$index]->isGivenKind([T_NS_SEPARATOR, T_STRING])) {
            $nextIndex = $tokens->getTokenNotOfKindSibling($index, 1, [[T_DOUBLE_COLON], [T_NS_SEPARATOR], [T_STRING]]);
            $nextNextIndex = $tokens->getNextMeaningfulToken($nextIndex);
            if (null !== $nextNextIndex && $nextNextIndex < $endIndex) {
                return false;
            }

            return null !== $nextIndex && $tokens[$nextIndex]->isGivenKind(T_VARIABLE);
        }

        return false;
    }
@param Tokens $tokens
@param int    $index
@param int    $endIndex

@return bool