X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FBrowserImport.php;h=225f1791f5bfe6b6fdc04bba4a2d0abf9cc7c600;hb=refs%2Fpull%2F3716%2Fhead;hp=f11958247e4f3ac8622add715c59ab1e1c583eab;hpb=f808b01692a835673f328d7221ba8c212caa9b61;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index f1195824..225f1791 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); @@ -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) { @@ -232,4 +231,6 @@ abstract class BrowserImport extends AbstractImport return $importedEntry; } + + abstract protected function prepareEntry(array $entry = []); }