src/Tokenizer/Analyzer/CommentsAnalyzer.php
private function isValidLanguageConstruct(Tokens $tokens, Token $docsToken, $languageConstructIndex)
    {
        static $languageStructures = [
            T_LIST,
            T_PRINT,
            T_ECHO,
            CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN,
        ];

        if (!$tokens[$languageConstructIndex]->isGivenKind($languageStructures)) {
            return false;
        }

        $endKind = $tokens[$languageConstructIndex]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)
            ? [CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE]
            : ')'
        ;

        $endIndex = $tokens->getNextTokenOfKind($languageConstructIndex, [$endKind]);

        $docsContent = $docsToken->getContent();

        for ($index = $languageConstructIndex + 1; $index < $endIndex; ++$index) {
            $token = $tokens[$index];

            if ($token->isGivenKind(T_VARIABLE) && false !== strpos($docsContent, $token->getContent())) {
                return true;
            }
        }

        return false;
    }
private function isValidLanguageConstruct(Tokens $tokens, Token $docsToken, $languageConstructIndex)
    {
        static $languageStructures = [
            T_LIST,
            T_PRINT,
            T_ECHO,
            CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN,
        ];

        if (!$tokens[$languageConstructIndex]->isGivenKind($languageStructures)) {
            return false;
        }

        $endKind = $tokens[$languageConstructIndex]->isGivenKind(CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN)
            ? [CT::T_DESTRUCTURING_SQUARE_BRACE_CLOSE]
            : ')'
        ;

        $endIndex = $tokens->getNextTokenOfKind($languageConstructIndex, [$endKind]);

        $docsContent = $docsToken->getContent();

        for ($index = $languageConstructIndex + 1; $index < $endIndex; ++$index) {
            $token = $tokens[$index];

            if ($token->isGivenKind(T_VARIABLE) && false !== strpos($docsContent, $token->getContent())) {
                return true;
            }
        }

        return false;
    }
private function isValidLanguageConstruct ( Tokens $ tokens , Token $ docsToken , $ languageConstructIndex ) { static $ languageStructures = [ T_LIST , T_PRINT , T_ECHO , CT :: T_DESTRUCTURING_SQUARE_BRACE_OPEN , ] ; if ( ! $ tokens [ $ languageConstructIndex ] -> isGivenKind ( $ languageStructures ) ) { return false ; } $ endKind = $ tokens [ $ languageConstructIndex ] -> isGivenKind ( CT :: T_DESTRUCTURING_SQUARE_BRACE_OPEN ) ? [ CT :: T_DESTRUCTURING_SQUARE_BRACE_CLOSE ] : ')' ; $ endIndex = $ tokens -> getNextTokenOfKind ( $ languageConstructIndex , [ $ endKind ] ) ; $ docsContent = $ docsToken -> getContent ( ) ; for ( $ index = $ languageConstructIndex + 1 ; $ index < $ endIndex ; ++ $ index ) { $ token = $ tokens [ $ index ] ; if ( $ token -> isGivenKind ( T_VARIABLE ) && false !== strpos ( $ docsContent , $ token -> getContent ( ) ) ) { return true ; } } return false ; }
Checks variable assignments through `list()`, `print()` etc. calls for correct docblock usage.

@param Tokens $tokens
@param Token  $docsToken              docs Token
@param int    $languageConstructIndex index of variable Token

@return bool
Checks variable assignments through list () print () etc . calls for correct docblock usage .