aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/PocketImport.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/PocketImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index c1d5b6da..7d38826b 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -8,11 +8,10 @@ use Wallabag\CoreBundle\Entity\Entry;
8 8
9class PocketImport extends AbstractImport 9class PocketImport extends AbstractImport
10{ 10{
11 const NB_ELEMENTS = 5000;
11 private $client; 12 private $client;
12 private $accessToken; 13 private $accessToken;
13 14
14 const NB_ELEMENTS = 5000;
15
16 /** 15 /**
17 * Only used for test purpose. 16 * Only used for test purpose.
18 * 17 *
@@ -176,7 +175,7 @@ class PocketImport extends AbstractImport
176 */ 175 */
177 public function parseEntry(array $importedEntry) 176 public function parseEntry(array $importedEntry)
178 { 177 {
179 $url = isset($importedEntry['resolved_url']) && $importedEntry['resolved_url'] != '' ? $importedEntry['resolved_url'] : $importedEntry['given_url']; 178 $url = isset($importedEntry['resolved_url']) && $importedEntry['resolved_url'] !== '' ? $importedEntry['resolved_url'] : $importedEntry['given_url'];
180 179
181 $existingEntry = $this->em 180 $existingEntry = $this->em
182 ->getRepository('WallabagCoreBundle:Entry') 181 ->getRepository('WallabagCoreBundle:Entry')
@@ -195,15 +194,15 @@ class PocketImport extends AbstractImport
195 $this->fetchContent($entry, $url); 194 $this->fetchContent($entry, $url);
196 195
197 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted 196 // 0, 1, 2 - 1 if the item is archived - 2 if the item should be deleted
198 $entry->setArchived($importedEntry['status'] == 1 || $this->markAsRead); 197 $entry->setArchived($importedEntry['status'] === 1 || $this->markAsRead);
199 198
200 // 0 or 1 - 1 If the item is starred 199 // 0 or 1 - 1 If the item is starred
201 $entry->setStarred($importedEntry['favorite'] == 1); 200 $entry->setStarred($importedEntry['favorite'] === 1);
202 201
203 $title = 'Untitled'; 202 $title = 'Untitled';
204 if (isset($importedEntry['resolved_title']) && $importedEntry['resolved_title'] != '') { 203 if (isset($importedEntry['resolved_title']) && $importedEntry['resolved_title'] !== '') {
205 $title = $importedEntry['resolved_title']; 204 $title = $importedEntry['resolved_title'];
206 } elseif (isset($importedEntry['given_title']) && $importedEntry['given_title'] != '') { 205 } elseif (isset($importedEntry['given_title']) && $importedEntry['given_title'] !== '') {
207 $title = $importedEntry['given_title']; 206 $title = $importedEntry['given_title'];
208 } 207 }
209 208