public function parse(string $html) : TokenCollection
    {
        self::$allHtml = $html;
        $tokens = new TokenCollection();
        $remainingHtml = trim($html);
        while (mb_strlen($remainingHtml) > 0) {
            $token = TokenFactory::buildFromHtml(
                $remainingHtml,
                null,
                $this->throwOnError
            );
            if (!$token instanceof Token) {
                // Error has occurred, so we stop.
                break;
            }

            $remainingHtml = $token->parse($remainingHtml);
            $tokens[] = $token;
        }

        return $tokens;
    }
public function parse(string $html) : TokenCollection
    {
        self::$allHtml = $html;
        $tokens = new TokenCollection();
        $remainingHtml = trim($html);
        while (mb_strlen($remainingHtml) > 0) {
            $token = TokenFactory::buildFromHtml(
                $remainingHtml,
                null,
                $this->throwOnError
            );
            if (!$token instanceof Token) {
                // Error has occurred, so we stop.
                break;
            }

            $remainingHtml = $token->parse($remainingHtml);
            $tokens[] = $token;
        }

        return $tokens;
    }
public function parse ( string $ html ) : TokenCollection { self :: $ allHtml = $ html ; $ tokens = new TokenCollection ( ) ; $ remainingHtml = trim ( $ html ) ; while ( mb_strlen ( $ remainingHtml ) > 0 ) { $ token = TokenFactory :: buildFromHtml ( $ remainingHtml , null , $ this -> throwOnError ) ; if ( ! $ token instanceof Token ) { // Error has occurred, so we stop. break ; } $ remainingHtml = $ token -> parse ( $ remainingHtml ) ; $ tokens [ ] = $ token ; } return $ tokens ; }
Will parse html into tokens.

@param $html string The HTML to tokenize.

@return TokenCollection
@throws \Kevintweber\HtmlTokenizer\Exceptions\TokenMatchingException
Will parse html into tokens .