aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/PocketImport.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-10-09 16:47:15 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-10-09 16:47:15 +0200
commit3ef055ced3d6ea0d2f15ba660602545f477e9c3c (patch)
tree800dfcf6cd276650cfc6626d641e4fbf65a0bb68 /src/Wallabag/ImportBundle/Import/PocketImport.php
parentf40c88eb1fa349aab600f9c1c94364f317fe62dd (diff)
downloadwallabag-3ef055ced3d6ea0d2f15ba660602545f477e9c3c.tar.gz
wallabag-3ef055ced3d6ea0d2f15ba660602545f477e9c3c.tar.zst
wallabag-3ef055ced3d6ea0d2f15ba660602545f477e9c3c.zip
CS
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/PocketImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 7d38826b..dddb87f4 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -149,7 +149,7 @@ class PocketImport extends AbstractImport
149 // - first call get 5k offset 0 149 // - first call get 5k offset 0
150 // - second call get 5k offset 5k 150 // - second call get 5k offset 5k
151 // - and so on 151 // - and so on
152 if (count($entries['list']) === self::NB_ELEMENTS) { 152 if (self::NB_ELEMENTS === count($entries['list'])) {
153 ++$run; 153 ++$run;
154 154
155 return $this->import(self::NB_ELEMENTS * $run); 155 return $this->import(self::NB_ELEMENTS * $run);
@@ -175,7 +175,7 @@ class PocketImport extends AbstractImport
175 */ 175 */
176 public function parseEntry(array $importedEntry) 176 public function parseEntry(array $importedEntry)
177 { 177 {
178 $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'];
179 179
180 $existingEntry = $this->em 180 $existingEntry = $this->em
181 ->getRepository('WallabagCoreBundle:Entry') 181 ->getRepository('WallabagCoreBundle:Entry')
@@ -194,15 +194,15 @@ class PocketImport extends AbstractImport
194 $this->fetchContent($entry, $url); 194 $this->fetchContent($entry, $url);
195 195
196 // 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
197 $entry->setArchived($importedEntry['status'] === 1 || $this->markAsRead); 197 $entry->setArchived(1 === $importedEntry['status'] || $this->markAsRead);
198 198
199 // 0 or 1 - 1 If the item is starred 199 // 0 or 1 - 1 If the item is starred
200 $entry->setStarred($importedEntry['favorite'] === 1); 200 $entry->setStarred(1 === $importedEntry['favorite']);
201 201
202 $title = 'Untitled'; 202 $title = 'Untitled';
203 if (isset($importedEntry['resolved_title']) && $importedEntry['resolved_title'] !== '') { 203 if (isset($importedEntry['resolved_title']) && '' !== $importedEntry['resolved_title']) {
204 $title = $importedEntry['resolved_title']; 204 $title = $importedEntry['resolved_title'];
205 } elseif (isset($importedEntry['given_title']) && $importedEntry['given_title'] !== '') { 205 } elseif (isset($importedEntry['given_title']) && '' !== $importedEntry['given_title']) {
206 $title = $importedEntry['given_title']; 206 $title = $importedEntry['given_title'];
207 } 207 }
208 208