X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FBrowserImport.php;h=804bc6cd06b4c89b3b8aff84f56f158c7711d960;hb=c73025ad8b684de1ac21ba7583f1af6f1d185159;hp=4d3073b727724f61dd9862c578a732f53c93e5be;hpb=e492f8da132ba5ca2b421f434a1bdf0af23b1783;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 4d3073b7..804bc6cd 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -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(); @@ -150,9 +149,9 @@ abstract class BrowserImport extends AbstractImport /** * Parse and insert all given entries. * - * @param $entries + * @param array $entries */ - protected function parseEntries($entries) + protected function parseEntries(array $entries) { $i = 1; $entryToBeFlushed = []; @@ -172,7 +171,7 @@ abstract class BrowserImport extends AbstractImport $entryToBeFlushed[] = $entry; // flush every 20 entries - if (($i % 20) === 0) { + if (0 === ($i % 20)) { $this->em->flush(); foreach ($entryToBeFlushed as $entry) {