mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 09:31:04 +00:00
Make updateAuthor code simpler to read
This commit is contained in:
parent
c57f69d967
commit
eeabca8090
1 changed files with 10 additions and 8 deletions
|
@ -83,15 +83,17 @@ class EntriesExport
|
|||
*/
|
||||
public function updateAuthor($method)
|
||||
{
|
||||
$this->author = $method.' authors';
|
||||
if ('entry' !== $method) {
|
||||
$this->author = $method . ' authors';
|
||||
|
||||
if ('entry' === $method) {
|
||||
$publishedBy = $this->entries[0]->getPublishedBy();
|
||||
if (!empty($publishedBy)) {
|
||||
$this->author = implode(', ', $this->entries[0]->getPublishedBy());
|
||||
} else {
|
||||
$this->author = $this->entries[0]->getDomainName();
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
$this->author = $this->entries[0]->getDomainName();
|
||||
|
||||
$publishedBy = $this->entries[0]->getPublishedBy();
|
||||
if (!empty($publishedBy)) {
|
||||
$this->author = implode(', ', $publishedBy);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
Loading…
Reference in a new issue