]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Helper/EntriesExport.php
Merge remote-tracking branch 'origin/master' into 2.3
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Helper / EntriesExport.php
index e16168b147ee0bc2f9568e792236f108e95a1f33..de259e7ffc25246acbab2299078b63afd38778cd 100644 (file)
@@ -2,12 +2,12 @@
 
 namespace Wallabag\CoreBundle\Helper;
 
-use JMS\Serializer;
 use JMS\Serializer\SerializationContext;
 use JMS\Serializer\SerializerBuilder;
 use PHPePub\Core\EPub;
 use PHPePub\Core\Structure\OPF\DublinCore;
 use Symfony\Component\HttpFoundation\Response;
+use Wallabag\CoreBundle\Entity\Entry;
 
 /**
  * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest.
@@ -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;
@@ -425,7 +427,7 @@ class EntriesExport
      *
      * @param string $format
      *
-     * @return Serializer
+     * @return string
      */
     private function prepareSerializingContent($format)
     {