]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/PocketImport.php
Moved Pocket token to user config
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / PocketImport.php
index cc6faf1f5860c3166393739dec53e0c5a0e822d5..40603c904b54e270c66bdfbc08ff8e628701f92b 100644 (file)
@@ -13,16 +13,14 @@ use Craue\ConfigBundle\Util\Config;
 class PocketImport extends AbstractImport
 {
     private $client;
-    private $consumerKey;
     private $accessToken;
 
     const NB_ELEMENTS = 5000;
 
-    public function __construct(EntityManager $em, ContentProxy $contentProxy, Config $craueConfig)
+    public function __construct(EntityManager $em, ContentProxy $contentProxy)
     {
         $this->em = $em;
         $this->contentProxy = $contentProxy;
-        $this->consumerKey = $craueConfig->get('pocket_consumer_key');
         $this->logger = new NullLogger();
     }
 
@@ -72,7 +70,7 @@ class PocketImport extends AbstractImport
         $request = $this->client->createRequest('POST', 'https://getpocket.com/v3/oauth/request',
             [
                 'body' => json_encode([
-                    'consumer_key' => $this->consumerKey,
+                    'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(),
                     'redirect_uri' => $redirectUri,
                 ]),
             ]
@@ -102,7 +100,7 @@ class PocketImport extends AbstractImport
         $request = $this->client->createRequest('POST', 'https://getpocket.com/v3/oauth/authorize',
             [
                 'body' => json_encode([
-                    'consumer_key' => $this->consumerKey,
+                    'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(),
                     'code' => $code,
                 ]),
             ]
@@ -131,7 +129,7 @@ class PocketImport extends AbstractImport
         $request = $this->client->createRequest('POST', 'https://getpocket.com/v3/get',
             [
                 'body' => json_encode([
-                    'consumer_key' => $this->consumerKey,
+                    'consumer_key' => $this->user->getConfig()->getPocketConsumerKey(),
                     'access_token' => $this->accessToken,
                     'detailType' => 'complete',
                     'state' => 'all',