private function parseTypeHint(Tokens $tokens, $index)
    {
        $allowsNull = false;
        if ($tokens[$index]->isGivenKind(CT::T_NULLABLE_TYPE)) {
            $allowsNull = true;
            $index = $tokens->getNextMeaningfulToken($index);
        }

        $type = '';
        while ($tokens[$index]->isGivenKind([T_NS_SEPARATOR, T_STRING, CT::T_ARRAY_TYPEHINT, T_CALLABLE])) {
            $type .= $tokens[$index]->getContent();

            $index = $tokens->getNextMeaningfulToken($index);
        }

        return [
            'type' => $type,
            'allows_null' => $allowsNull,
        ];
    }
private function parseTypeHint(Tokens $tokens, $index)
    {
        $allowsNull = false;
        if ($tokens[$index]->isGivenKind(CT::T_NULLABLE_TYPE)) {
            $allowsNull = true;
            $index = $tokens->getNextMeaningfulToken($index);
        }

        $type = '';
        while ($tokens[$index]->isGivenKind([T_NS_SEPARATOR, T_STRING, CT::T_ARRAY_TYPEHINT, T_CALLABLE])) {
            $type .= $tokens[$index]->getContent();

            $index = $tokens->getNextMeaningfulToken($index);
        }

        return [
            'type' => $type,
            'allows_null' => $allowsNull,
        ];
    }
private function parseTypeHint ( Tokens $ tokens , $ index ) { $ allowsNull = false ; if ( $ tokens [ $ index ] -> isGivenKind ( CT :: T_NULLABLE_TYPE ) ) { $ allowsNull = true ; $ index = $ tokens -> getNextMeaningfulToken ( $ index ) ; } $ type = '' ; while ( $ tokens [ $ index ] -> isGivenKind ( [ T_NS_SEPARATOR , T_STRING , CT :: T_ARRAY_TYPEHINT , T_CALLABLE ] ) ) { $ type .= $ tokens [ $ index ] -> getContent ( ) ; $ index = $ tokens -> getNextMeaningfulToken ( $ index ) ; } return [ 'type' => $ type , 'allows_null' => $ allowsNull , ] ; }
@param Tokens $tokens
@param int    $index  The index of the first token of the type hint

@return array
@param Tokens $tokens @param int $index The index of the first token of the type hint