title = $title; $this->message = $message; $this->dangerouslyUseHTMLString = $dangerouslyUseHTMLString; $this->type = $type; $this->icon = $icon; $this->duration = $duration; $this->position = $position; if (!empty($_attr)) { foreach ($_attr as $key => $value) { $this->$key = $value; } } } public function toArray(): array { return get_object_vars($this); } }