From: Étienne Gilli Date: Mon, 10 Jul 2017 07:58:18 +0000 (+0200) Subject: Make updateAuthor code simpler to read X-Git-Tag: 2.3.0~31^2~39^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=eeabca8090ebf9a084b6b823ddf7c6493b956d4c;p=github%2Fwallabag%2Fwallabag.git Make updateAuthor code simpler to read --- diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index e16168b1..64d82193 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -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;