PDepend\Source\Language\PHP\PHPTokenizerInternal::consumeNonePhpTokens PHP Method

consumeNonePhpTokens() private method

This method fetches all tokens until an opening php tag was found and it returns the collected content. The returned value will be null if there was no none php token.
private consumeNonePhpTokens ( array &$tokens ) : string
$tokens array
return string
    private function consumeNonePhpTokens(array &$tokens)
    {
        // The collected token content
        $content = null;
        // Fetch current token
        $token = (array) current($tokens);
        // Skipp all non open tags
        while ($token[0] !== T_OPEN_TAG_WITH_ECHO && $token[0] !== T_OPEN_TAG && $token[0] !== false) {
            $content .= isset($token[1]) ? $token[1] : $token[0];
            $token = (array) next($tokens);
        }
        // Set internal pointer one back when there was at least one none php token
        if ($token[0] !== false) {
            prev($tokens);
        }
        return $content;
    }