]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Make updateAuthor code simpler to read 3266/head
authorÉtienne Gilli <etienne.gilli@gmail.com>
Mon, 10 Jul 2017 07:58:18 +0000 (09:58 +0200)
committerÉtienne Gilli <etienne.gilli@gmail.com>
Mon, 10 Jul 2017 08:08:20 +0000 (10:08 +0200)
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;