aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorÉtienne Gilli <etienne.gilli@gmail.com>2017-07-10 09:58:18 +0200
committerÉtienne Gilli <etienne.gilli@gmail.com>2017-07-10 10:08:20 +0200
commiteeabca8090ebf9a084b6b823ddf7c6493b956d4c (patch)
tree0db0a24a8bd0b85bed4c7941c4732c7ca1e9a90a
parentc57f69d967dea05e507e997193a783fed991de8e (diff)
downloadwallabag-eeabca8090ebf9a084b6b823ddf7c6493b956d4c.tar.gz
wallabag-eeabca8090ebf9a084b6b823ddf7c6493b956d4c.tar.zst
wallabag-eeabca8090ebf9a084b6b823ddf7c6493b956d4c.zip
Make updateAuthor code simpler to read
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php18
1 files changed, 10 insertions, 8 deletions
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
83 */ 83 */
84 public function updateAuthor($method) 84 public function updateAuthor($method)
85 { 85 {
86 $this->author = $method.' authors'; 86 if ('entry' !== $method) {
87 $this->author = $method . ' authors';
87 88
88 if ('entry' === $method) { 89 return $this;
89 $publishedBy = $this->entries[0]->getPublishedBy(); 90 }
90 if (!empty($publishedBy)) { 91
91 $this->author = implode(', ', $this->entries[0]->getPublishedBy()); 92 $this->author = $this->entries[0]->getDomainName();
92 } else { 93
93 $this->author = $this->entries[0]->getDomainName(); 94 $publishedBy = $this->entries[0]->getPublishedBy();
94 } 95 if (!empty($publishedBy)) {
96 $this->author = implode(', ', $publishedBy);
95 } 97 }
96 98
97 return $this; 99 return $this;