partFactory->newInstance($token); } /** * Calls $tokens->next() and returns. * * The default implementation checks if the current token is an end token, * and will not advance past it. Because a comment part of a header can be * nested, its implementation must advance past its own 'end' token. */ protected function advanceToNextToken(Iterator $tokens, bool $isStartToken) : static { $tokens->next(); return $this; } /** * Post processing involves creating a single Part\CommentPart out of * generated parts from tokens. The Part\CommentPart is returned in an * array. * * @param IHeaderPart[] $parts * @return IHeaderPart[] */ protected function processParts(array $parts) : array { return [$this->partFactory->newCommentPart($parts)]; } }