]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Helper/EntriesExport.php
Make updateAuthor code simpler to read
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Helper / EntriesExport.php
index e16168b147ee0bc2f9568e792236f108e95a1f33..64d8219325d532e3eed2f8d88a7b31286489f26f 100644 (file)
@@ -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;