type = $type; $this->callback = $callback; } /** @inheritDoc */ protected function generateMatches( ComponentValueList $values, $start, array $options ) { // @phan-suppress-next-line PhanCoalescingNeverNull $cv = $values[$start] ?? null; if ( $cv instanceof Token && $cv->type() === $this->type && ( !$this->callback || ( $this->callback )( $cv ) ) ) { yield $this->makeMatch( $values, $start, $this->next( $values, $start, $options ) ); } } }