getAllTokenSeparators()); return '~(' . $sChars . ')~'; } /** * Overridden to /not/ advance when the end token matches a start token for * a sub-consumer. */ protected function advanceToNextToken(Iterator $tokens, bool $isStartToken) : static { if ($isStartToken) { $tokens->next(); } elseif ($tokens->valid() && !$this->isEndToken($tokens->current())) { foreach ($this->subConsumers as $consumer) { if ($consumer->isStartToken($tokens->current())) { return $this; } } $tokens->next(); } return $this; } /** * @param \ZBateson\MailMimeParser\Header\IHeaderPart[] $parts * @return \ZBateson\MailMimeParser\Header\IHeaderPart[] */ protected function processParts(array $parts) : array { // filtering out tokens (filters out the names, e.g. 'by' or 'with') return \array_values(\array_filter($parts, fn ($p) => !$p instanceof Token)); } }