Skip to content

Commit

Permalink
fix implicitly nullable via default value null
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Brahmer <[email protected]>
  • Loading branch information
Grotax committed Jan 9, 2025
1 parent f64e2e7 commit 6c17dc1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lib/Db/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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));
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 6c17dc1

Please sign in to comment.