]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/BrowserImport.php
Replace continue; with break; to avoid PHP 7.3 warnings
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / BrowserImport.php
index 4d3073b727724f61dd9862c578a732f53c93e5be..b55525e5b4dcbe9e3e21a776c54c426d97bbe8a6 100644 (file)
@@ -4,7 +4,6 @@ namespace Wallabag\ImportBundle\Import;
 
 use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\CoreBundle\Event\EntrySavedEvent;
-use Wallabag\UserBundle\Entity\User;
 
 abstract class BrowserImport extends AbstractImport
 {
@@ -78,7 +77,7 @@ abstract class BrowserImport extends AbstractImport
      */
     public function parseEntry(array $importedEntry)
     {
-        if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && is_array(reset($importedEntry))) {
+        if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) {
             if ($this->producer) {
                 $this->parseEntriesForProducer($importedEntry);
 
@@ -134,7 +133,7 @@ abstract class BrowserImport extends AbstractImport
             );
         }
 
-        $entry->setArchived($data['is_archived']);
+        $entry->updateArchived($data['is_archived']);
 
         if (!empty($data['created_at'])) {
             $dt = new \DateTime();
@@ -159,20 +158,20 @@ abstract class BrowserImport extends AbstractImport
 
         foreach ($entries as $importedEntry) {
             if ((array) $importedEntry !== $importedEntry) {
-                continue;
+                break;
             }
 
             $entry = $this->parseEntry($importedEntry);
 
             if (null === $entry) {
-                continue;
+                break;
             }
 
             // @see AbstractImport
             $entryToBeFlushed[] = $entry;
 
             // flush every 20 entries
-            if (($i % 20) === 0) {
+            if (0 === ($i % 20)) {
                 $this->em->flush();
 
                 foreach ($entryToBeFlushed as $entry) {
@@ -207,7 +206,7 @@ abstract class BrowserImport extends AbstractImport
     {
         foreach ($entries as $importedEntry) {
             if ((array) $importedEntry !== $importedEntry) {
-                continue;
+                break;
             }
 
             // set userId for the producer (it won't know which user is connected)