public function getContentUntil(AbstractToken $token)
    {
        if ($this === $token) {
            return '';
        }

        $content = $this->getContent();
        $next = $this->nextToken;

        while ($next && $next !== $token) {
            $content .= $next->getContent();
            $next = $next->nextToken;
        }

        if (null === $next) {
            throw new \RuntimeException(sprintf('Could not find token "%s".', $token));
        }

        return $content;
    }
public function getContentUntil(AbstractToken $token)
    {
        if ($this === $token) {
            return '';
        }

        $content = $this->getContent();
        $next = $this->nextToken;

        while ($next && $next !== $token) {
            $content .= $next->getContent();
            $next = $next->nextToken;
        }

        if (null === $next) {
            throw new \RuntimeException(sprintf('Could not find token "%s".', $token));
        }

        return $content;
    }
public function getContentUntil ( AbstractToken $ token ) { if ( $ this === $ token ) { return '' ; } $ content = $ this -> getContent ( ) ; $ next = $ this -> nextToken ; while ( $ next && $ next !== $ token ) { $ content .= $ next -> getContent ( ) ; $ next = $ next -> nextToken ; } if ( null === $ next ) { throw new \ RuntimeException ( sprintf ( 'Could not find token "%s".' , $ token ) ) ; } return $ content ; }
Returns the content from this Token until the passed token.

The content of this token is included, and the content of the passed token
is excluded.

@param \JMS\CodeReview\Analysis\PhpParser\TokenStream\AbstractToken $token

@return string
Returns the content from this Token until the passed token .