content = $content; $this->plain = $plain; $this->nonce = $nonce; $this->scriptUrl = $scriptUrl; } public static function plain(string $content): self { return new self($content, true); } public static function withResizer(string $content, string $nonce, string $scriptUrl): self { return new self( $content, false, $nonce, $scriptUrl ); } /** * Inject scripts if not plain and return message html content. * * @return string message html content */ #[\Override] public function render(): string { if ($this->plain) { return $this->content; } return '' . $this->content . '
'; } }