private function getValue(\Iterator $tokenIterator)
    {
        $message = '';
        $docToken = '';
        $docPart = '';

        for (; $tokenIterator->valid(); $tokenIterator->next()) {
            $t = $tokenIterator->current();
            if ('.' === $t) {
                // Concatenate with next token
                continue;
            }
            if (!isset($t[1])) {
                break;
            }

            switch ($t[0]) {
                case T_START_HEREDOC:
                    $docToken = $t[1];
                    break;
                case T_ENCAPSED_AND_WHITESPACE:
                case T_CONSTANT_ENCAPSED_STRING:
                    if ('' === $docToken) {
                        $message .= PhpStringTokenParser::parse($t[1]);
                    } else {
                        $docPart = $t[1];
                    }
                    break;
                case T_END_HEREDOC:
                    $message .= PhpStringTokenParser::parseDocString($docToken, $docPart);
                    $docToken = '';
                    $docPart = '';
                    break;
                case T_WHITESPACE:
                    break;
                default:
                    break 2;
            }
        }

        return $message;
    }
private function getValue(\Iterator $tokenIterator)
    {
        $message = '';
        $docToken = '';
        $docPart = '';

        for (; $tokenIterator->valid(); $tokenIterator->next()) {
            $t = $tokenIterator->current();
            if ('.' === $t) {
                // Concatenate with next token
                continue;
            }
            if (!isset($t[1])) {
                break;
            }

            switch ($t[0]) {
                case T_START_HEREDOC:
                    $docToken = $t[1];
                    break;
                case T_ENCAPSED_AND_WHITESPACE:
                case T_CONSTANT_ENCAPSED_STRING:
                    if ('' === $docToken) {
                        $message .= PhpStringTokenParser::parse($t[1]);
                    } else {
                        $docPart = $t[1];
                    }
                    break;
                case T_END_HEREDOC:
                    $message .= PhpStringTokenParser::parseDocString($docToken, $docPart);
                    $docToken = '';
                    $docPart = '';
                    break;
                case T_WHITESPACE:
                    break;
                default:
                    break 2;
            }
        }

        return $message;
    }
private function getValue ( \ Iterator $ tokenIterator ) { $ message = '' ; $ docToken = '' ; $ docPart = '' ; for ( ; $ tokenIterator -> valid ( ) ; $ tokenIterator -> next ( ) ) { $ t = $ tokenIterator -> current ( ) ; if ( '.' === $ t ) { // Concatenate with next token continue ; } if ( ! isset ( $ t [ 1 ] ) ) { break ; } switch ( $ t [ 0 ] ) { case T_START_HEREDOC : $ docToken = $ t [ 1 ] ; break ; case T_ENCAPSED_AND_WHITESPACE : case T_CONSTANT_ENCAPSED_STRING : if ( '' === $ docToken ) { $ message .= PhpStringTokenParser :: parse ( $ t [ 1 ] ) ; } else { $ docPart = $ t [ 1 ] ; } break ; case T_END_HEREDOC : $ message .= PhpStringTokenParser :: parseDocString ( $ docToken , $ docPart ) ; $ docToken = '' ; $ docPart = '' ; break ; case T_WHITESPACE : break ; default : break 2 ; } } return $ message ; }
Extracts the message from the iterator while the tokens
match allowed message tokens.
Extracts the message from the iterator while the tokens match allowed message tokens .