src = $src; $this->type = $type; $this->content = $content; $this->nonce = null; } function getCode(): string { $attributes = ["type" => $this->type]; if (!empty($this->src)) { $attributes["src"] = $this->src; } if (!empty($this->nonce)) { $attributes["nonce"] = $this->nonce; } $attributes = html_attributes($attributes); return ""; } public function setNonce(string $nonce) { $this->nonce = $nonce; } }