]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/PocketImport.php
Merge remote-tracking branch 'origin/master' into 2.3
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / PocketImport.php
index 327e25001dc8c2605d446791e44d07d6bae07278..c1d5b6da0518c33bef64a621336406c1679ad716 100644 (file)
@@ -2,12 +2,9 @@
 
 namespace Wallabag\ImportBundle\Import;
 
-use Psr\Log\NullLogger;
-use Doctrine\ORM\EntityManager;
 use GuzzleHttp\Client;
 use GuzzleHttp\Exception\RequestException;
 use Wallabag\CoreBundle\Entity\Entry;
-use Wallabag\CoreBundle\Helper\ContentProxy;
 
 class PocketImport extends AbstractImport
 {
@@ -16,13 +13,6 @@ class PocketImport extends AbstractImport
 
     const NB_ELEMENTS = 5000;
 
-    public function __construct(EntityManager $em, ContentProxy $contentProxy)
-    {
-        $this->em = $em;
-        $this->contentProxy = $contentProxy;
-        $this->logger = new NullLogger();
-    }
-
     /**
      * Only used for test purpose.
      *
@@ -202,7 +192,7 @@ class PocketImport extends AbstractImport
         $entry->setUrl($url);
 
         // update entry with content (in case fetching failed, the given entry will be return)
-        $entry = $this->fetchContent($entry, $url);
+        $this->fetchContent($entry, $url);
 
         // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
         $entry->setArchived($importedEntry['status'] == 1 || $this->markAsRead);
@@ -225,7 +215,7 @@ class PocketImport extends AbstractImport
         }
 
         if (isset($importedEntry['tags']) && !empty($importedEntry['tags'])) {
-            $this->contentProxy->assignTagsToEntry(
+            $this->tagsAssigner->assignTagsToEntry(
                 $entry,
                 array_keys($importedEntry['tags']),
                 $this->em->getUnitOfWork()->getScheduledEntityInsertions()