From 1685ee7006484d1587dadbd8ed5621f9646263b1 Mon Sep 17 00:00:00 2001 From: Benjamin Brahmer Date: Thu, 9 Jan 2025 20:13:38 +0100 Subject: [PATCH] fix implicitly nullable via default value null Signed-off-by: Benjamin Brahmer --- lib/Db/Item.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/Db/Item.php b/lib/Db/Item.php index 17bf4a0484..81c2df96a7 100644 --- a/lib/Db/Item.php +++ b/lib/Db/Item.php @@ -392,7 +392,7 @@ public function jsonSerialize(): array ]; } - public function setAuthor(string $author = null): self + public function setAuthor(?string $author = null): self { if (!is_null($author)) { $author = strip_tags($author); @@ -406,7 +406,7 @@ public function setAuthor(string $author = null): self return $this; } - public function setBody(string $body = null): self + public function setBody(?string $body = null): self { // FIXME: this should not happen if the target="_blank" is already // on the link @@ -420,7 +420,7 @@ public function setBody(string $body = null): self return $this; } - public function setContentHash(string $contentHash = null): self + public function setContentHash(?string $contentHash = null): self { if ($this->contentHash !== $contentHash) { $this->contentHash = $contentHash; @@ -430,7 +430,7 @@ public function setContentHash(string $contentHash = null): self return $this; } - public function setEnclosureLink(string $enclosureLink = null): self + public function setEnclosureLink(?string $enclosureLink = null): self { if ($this->enclosureLink !== $enclosureLink) { $this->enclosureLink = $enclosureLink; @@ -440,7 +440,7 @@ public function setEnclosureLink(string $enclosureLink = null): self return $this; } - public function setEnclosureMime(string $enclosureMime = null): self + public function setEnclosureMime(?string $enclosureMime = null): self { if ($this->enclosureMime !== $enclosureMime) { $this->enclosureMime = $enclosureMime; @@ -450,7 +450,7 @@ public function setEnclosureMime(string $enclosureMime = null): self return $this; } - public function setMediaThumbnail(string $mediaThumbnail = null): self + public function setMediaThumbnail(?string $mediaThumbnail = null): self { if ($this->mediaThumbnail !== $mediaThumbnail) { $this->mediaThumbnail = $mediaThumbnail; @@ -460,7 +460,7 @@ public function setMediaThumbnail(string $mediaThumbnail = null): self return $this; } - public function setMediaDescription(string $mediaDescription = null): self + public function setMediaDescription(?string $mediaDescription = null): self { if ($this->mediaDescription !== $mediaDescription) { $this->mediaDescription = $mediaDescription; @@ -480,7 +480,7 @@ public function setFeedId(int $feedId): self return $this; } - public function setFingerprint(string $fingerprint = null): self + public function setFingerprint(?string $fingerprint = null): self { if ($this->fingerprint !== $fingerprint) { $this->fingerprint = $fingerprint; @@ -510,7 +510,7 @@ public function setGuidHash(string $guidHash): self return $this; } - public function setLastModified(string $lastModified = null): self + public function setLastModified(?string $lastModified = null): self { if ($this->lastModified !== $lastModified) { $this->lastModified = $lastModified; @@ -520,7 +520,7 @@ public function setLastModified(string $lastModified = null): self return $this; } - public function setPubDate(int $pubDate = null): self + public function setPubDate(?int $pubDate = null): self { if ($this->pubDate !== $pubDate) { $this->pubDate = $pubDate; @@ -540,7 +540,7 @@ public function setRtl(bool $rtl): self return $this; } - public function setSearchIndex(string $searchIndex = null): self + public function setSearchIndex(?string $searchIndex = null): self { if ($this->searchIndex !== $searchIndex) { $this->searchIndex = $searchIndex; @@ -560,7 +560,7 @@ public function setStarred(bool $starred): self return $this; } - public function setTitle(string $title = null): self + public function setTitle(?string $title = null): self { if (!is_null($title)) { $title = trim(strip_tags($title)); @@ -574,7 +574,7 @@ public function setTitle(string $title = null): self return $this; } - public function setSharedBy(string $sharedBy = null): self + public function setSharedBy(?string $sharedBy = null): self { if ($this->sharedBy !== $sharedBy) { $this->sharedBy = $sharedBy; @@ -584,7 +584,7 @@ public function setSharedBy(string $sharedBy = null): self return $this; } - public function setSharedByDisplayName(string $sharedByDisplayName = null): self + public function setSharedByDisplayName(?string $sharedByDisplayName = null): self { if ($this->sharedByDisplayName !== $sharedByDisplayName) { $this->sharedByDisplayName = $sharedByDisplayName; @@ -603,7 +603,7 @@ public function setUnread(bool $unread): self return $this; } - public function setUrl(string $url = null): self + public function setUrl(?string $url = null): self { if (is_null($url)) { return $this; @@ -620,7 +620,7 @@ public function setUrl(string $url = null): self return $this; } - public function setCategoriesJson(string $categoriesJson = null): self + public function setCategoriesJson(?string $categoriesJson = null): self { if ($this->categoriesJson !== $categoriesJson) { $this->categoriesJson = $categoriesJson; @@ -630,7 +630,7 @@ public function setCategoriesJson(string $categoriesJson = null): self return $this; } - public function setCategories(array $categories = null): self + public function setCategories(?array $categories = null): self { $categoriesJson = !is_null($categories) ? json_encode($categories) : null; $this->setCategoriesJson($categoriesJson);