*/ private array $tokens, ) {} /** * @return non-empty-string */ public function name(): string { return $this->name; } /** * @return non-empty-string */ public function allAfter(int $offset): string { $tokens = $this->tokens; /** @var non-empty-string */ return implode('', array_splice($tokens, $offset)); } /** * @return non-empty-array */ public function filtered(): array { /** @var non-empty-array / We can force the type as we know for sure it contains at least one non-empty-string */ return array_filter( array_map(trim(...), $this->tokens), static fn ($value) => $value !== '', ); } /** * @return non-empty-string */ public function raw(): string { /** @var non-empty-string / We can force the type as we know for sure it contains at least one non-empty-string */ return implode('', $this->tokens); } }