diff --git a/src/SeoManager.php b/src/SeoManager.php index f80a32f..8943345 100644 --- a/src/SeoManager.php +++ b/src/SeoManager.php @@ -183,7 +183,7 @@ public function setTitle(string $value): static return $this; } - public function setDescription(string $value): static + public function setDescription(?string $value): static { if ($this->standard) { $this->standard->description = $value; @@ -216,18 +216,18 @@ public function setUrl(string $value): static return $this; } - public function setImage(SeoImage|string $value): static + public function setImage(null|SeoImage|string $value): static { - $value = $value instanceof SeoImage ? $value : new SeoImage($value); + $value = is_string($value) ? new SeoImage($value) : $value; if ($this->opengraph) { - $this->opengraph->image = $value->toOpenGraph(); + $this->opengraph->image = $value?->toOpenGraph(); } if ($this->twitter instanceof Summary) { - $this->twitter->image = $value->toTwitter(); + $this->twitter->image = $value?->toTwitter(); } if ($this->webpage) { - $this->webpage->put('image', $value->secure_url ?? $value->url); + $this->webpage->put('image', $value?->secure_url ?? $value?->url); } return $this;