href = $href; $this->type = $type; $this->rel = $rel; $this->nonce = null; } function getCode(): string { $attributes = ["rel" => $this->rel, "href" => $this->href]; if (!empty($this->type)) { $attributes["type"] = $this->type; } if (!empty($this->nonce)) { $attributes["nonce"] = $this->nonce; } return html_tag_short("link", $attributes); } public function setNonce(string $nonce) { $this->nonce = $nonce; } }