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.
*/
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;
*
* @param string $format
*
- * @return Serializer
+ * @return string
*/
private function prepareSerializingContent($format)
{