Skip to content

Commit

Permalink
Refactor getImages method to simplify array return logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
murdercode committed Mar 2, 2024
1 parent e2fb703 commit 0cfde18
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Readability.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getImage(): string
$this->checkContent();
$image = $this->content->getImage();

return $image !== null ? $image : '';
return $image ?? '';
}

/**
Expand All @@ -87,9 +87,8 @@ public function getImage(): string
public function getImages(): array
{
$this->checkContent();
$images = $this->content->getImages();

return $images !== null ? array_values($images) : [];
return $this->content->getImages();
}

/**
Expand Down

0 comments on commit 0cfde18

Please sign in to comment.