RemexHtml/Tokenizer/TokenGenerator.php
public static function generate( $text, $options ) {
		$tg = new self( $text, $options );
		$tg->tokenizer->beginStepping();
		while ( $tg->tokenizer->step() ) {
			foreach ( $tg->handler->tokens as $token ) {
				yield $token;
			}
			$tg->handler->tokens = [];
		}
		foreach ( $tg->handler->tokens as $token ) {
			yield $token;
		}
	}
public static function generate( $text, $options ) {
		$tg = new self( $text, $options );
		$tg->tokenizer->beginStepping();
		while ( $tg->tokenizer->step() ) {
			foreach ( $tg->handler->tokens as $token ) {
				yield $token;
			}
			$tg->handler->tokens = [];
		}
		foreach ( $tg->handler->tokens as $token ) {
			yield $token;
		}
	}
public static function generate ( $ text , $ options ) { $ tg = new self ( $ text , $ options ) ; $ tg -> tokenizer -> beginStepping ( ) ; while ( $ tg -> tokenizer -> step ( ) ) { foreach ( $ tg -> handler -> tokens as $ token ) { yield $ token ; } $ tg -> handler -> tokens = [ ] ; } foreach ( $ tg -> handler -> tokens as $ token ) { yield $ token ; } }
Get a Generator which iterates over all tokens in the supplied HTML

@param string $text The HTML
@param array $options The Tokenizer options, see Tokenizer::__construct()
@return Generator
Get a Generator which iterates over all tokens in the supplied HTML