]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/InstapaperImport.php
CS
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / InstapaperImport.php
index 7d70154a66bf63b32e3f6e5f1574b134c002b628..a12af75829a8db6c345e0740f31cb5e8efdf8094 100644 (file)
@@ -63,7 +63,7 @@ class InstapaperImport extends AbstractImport
 
         $entries = [];
         $handle = fopen($this->filepath, 'r');
-        while (($data = fgetcsv($handle, 10240)) !== false) {
+        while (false !== ($data = fgetcsv($handle, 10240))) {
             if ('URL' === $data[0]) {
                 continue;
             }
@@ -72,7 +72,7 @@ class InstapaperImport extends AbstractImport
             // BUT it can also be the status (since status = folder in Instapaper)
             // and we don't want archive, unread & starred to become a tag
             $tags = null;
-            if (false === in_array($data[3], ['Archive', 'Unread', 'Starred'], true)) {
+            if (false === \in_array($data[3], ['Archive', 'Unread', 'Starred'], true)) {
                 $tags = [$data[3]];
             }
 
@@ -80,8 +80,8 @@ class InstapaperImport extends AbstractImport
                 'url' => $data[0],
                 'title' => $data[1],
                 'status' => $data[3],
-                'is_archived' => $data[3] === 'Archive' || $data[3] === 'Starred',
-                'is_starred' => $data[3] === 'Starred',
+                'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3],
+                'is_starred' => 'Starred' === $data[3],
                 'html' => false,
                 'tags' => $tags,
             ];
@@ -135,7 +135,7 @@ class InstapaperImport extends AbstractImport
             );
         }
 
-        $entry->setArchived($importedEntry['is_archived']);
+        $entry->updateArchived($importedEntry['is_archived']);
         $entry->setStarred($importedEntry['is_starred']);
 
         $this->em->persist($entry);