aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Consumer
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-09-04 21:49:21 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-09-11 21:58:31 +0200
commitc98db1b653b5dc8b701422190b02d9fbf10c4e68 (patch)
tree5f02de371264143a4e81231ad16f605435cb4d22 /src/Wallabag/ImportBundle/Consumer
parentef75e1220ebb76a8df019d946460ad612759f0bb (diff)
downloadwallabag-c98db1b653b5dc8b701422190b02d9fbf10c4e68.tar.gz
wallabag-c98db1b653b5dc8b701422190b02d9fbf10c4e68.tar.zst
wallabag-c98db1b653b5dc8b701422190b02d9fbf10c4e68.zip
Convert other imports to Rabbit
Diffstat (limited to 'src/Wallabag/ImportBundle/Consumer')
-rw-r--r--src/Wallabag/ImportBundle/Consumer/AMPQ/EntryConsumer.php (renamed from src/Wallabag/ImportBundle/Consumer/AMPQ/PocketConsumer.php)14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Wallabag/ImportBundle/Consumer/AMPQ/PocketConsumer.php b/src/Wallabag/ImportBundle/Consumer/AMPQ/EntryConsumer.php
index 239e7446..8a8cf45d 100644
--- a/src/Wallabag/ImportBundle/Consumer/AMPQ/PocketConsumer.php
+++ b/src/Wallabag/ImportBundle/Consumer/AMPQ/EntryConsumer.php
@@ -5,23 +5,23 @@ namespace Wallabag\ImportBundle\Consumer\AMPQ;
5use Doctrine\ORM\EntityManager; 5use Doctrine\ORM\EntityManager;
6use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface; 6use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
7use PhpAmqpLib\Message\AMQPMessage; 7use PhpAmqpLib\Message\AMQPMessage;
8use Wallabag\ImportBundle\Import\PocketImport; 8use Wallabag\ImportBundle\Import\AbstractImport;
9use Wallabag\UserBundle\Repository\UserRepository; 9use Wallabag\UserBundle\Repository\UserRepository;
10use Psr\Log\LoggerInterface; 10use Psr\Log\LoggerInterface;
11use Psr\Log\NullLogger; 11use Psr\Log\NullLogger;
12 12
13class PocketConsumer implements ConsumerInterface 13class EntryConsumer implements ConsumerInterface
14{ 14{
15 private $em; 15 private $em;
16 private $userRepository; 16 private $userRepository;
17 private $pocketImport; 17 private $import;
18 private $logger; 18 private $logger;
19 19
20 public function __construct(EntityManager $em, UserRepository $userRepository, PocketImport $pocketImport, LoggerInterface $logger = null) 20 public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, LoggerInterface $logger = null)
21 { 21 {
22 $this->em = $em; 22 $this->em = $em;
23 $this->userRepository = $userRepository; 23 $this->userRepository = $userRepository;
24 $this->pocketImport = $pocketImport; 24 $this->import = $import;
25 $this->logger = $logger ?: new NullLogger(); 25 $this->logger = $logger ?: new NullLogger();
26 } 26 }
27 27
@@ -41,9 +41,9 @@ class PocketConsumer implements ConsumerInterface
41 return; 41 return;
42 } 42 }
43 43
44 $this->pocketImport->setUser($user); 44 $this->import->setUser($user);
45 45
46 $entry = $this->pocketImport->parseEntry($storedEntry); 46 $entry = $this->import->parseEntry($storedEntry);
47 47
48 if (null === $entry) { 48 if (null === $entry) {
49 $this->logger->warning('Unable to parse entry', ['entry' => $storedEntry]); 49 $this->logger->warning('Unable to parse entry', ['entry' => $storedEntry]);