aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/BrowserImport.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/BrowserImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/BrowserImport.php18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php
index 225f1791..ea7afd3d 100644
--- a/src/Wallabag/ImportBundle/Import/BrowserImport.php
+++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php
@@ -77,7 +77,7 @@ abstract class BrowserImport extends AbstractImport
77 */ 77 */
78 public function parseEntry(array $importedEntry) 78 public function parseEntry(array $importedEntry)
79 { 79 {
80 if ((!array_key_exists('guid', $importedEntry) || (!array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) { 80 if ((!\array_key_exists('guid', $importedEntry) || (!\array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) {
81 if ($this->producer) { 81 if ($this->producer) {
82 $this->parseEntriesForProducer($importedEntry); 82 $this->parseEntriesForProducer($importedEntry);
83 83
@@ -89,7 +89,7 @@ abstract class BrowserImport extends AbstractImport
89 return; 89 return;
90 } 90 }
91 91
92 if (array_key_exists('children', $importedEntry)) { 92 if (\array_key_exists('children', $importedEntry)) {
93 if ($this->producer) { 93 if ($this->producer) {
94 $this->parseEntriesForProducer($importedEntry['children']); 94 $this->parseEntriesForProducer($importedEntry['children']);
95 95
@@ -101,11 +101,11 @@ abstract class BrowserImport extends AbstractImport
101 return; 101 return;
102 } 102 }
103 103
104 if (!array_key_exists('uri', $importedEntry) && !array_key_exists('url', $importedEntry)) { 104 if (!\array_key_exists('uri', $importedEntry) && !\array_key_exists('url', $importedEntry)) {
105 return; 105 return;
106 } 106 }
107 107
108 $url = array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url']; 108 $url = \array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url'];
109 109
110 $existingEntry = $this->em 110 $existingEntry = $this->em
111 ->getRepository('WallabagCoreBundle:Entry') 111 ->getRepository('WallabagCoreBundle:Entry')
@@ -126,14 +126,14 @@ abstract class BrowserImport extends AbstractImport
126 // update entry with content (in case fetching failed, the given entry will be return) 126 // update entry with content (in case fetching failed, the given entry will be return)
127 $this->fetchContent($entry, $data['url'], $data); 127 $this->fetchContent($entry, $data['url'], $data);
128 128
129 if (array_key_exists('tags', $data)) { 129 if (\array_key_exists('tags', $data)) {
130 $this->tagsAssigner->assignTagsToEntry( 130 $this->tagsAssigner->assignTagsToEntry(
131 $entry, 131 $entry,
132 $data['tags'] 132 $data['tags']
133 ); 133 );
134 } 134 }
135 135
136 $entry->setArchived($data['is_archived']); 136 $entry->updateArchived($data['is_archived']);
137 137
138 if (!empty($data['created_at'])) { 138 if (!empty($data['created_at'])) {
139 $dt = new \DateTime(); 139 $dt = new \DateTime();
@@ -148,10 +148,8 @@ abstract class BrowserImport extends AbstractImport
148 148
149 /** 149 /**
150 * Parse and insert all given entries. 150 * Parse and insert all given entries.
151 *
152 * @param $entries
153 */ 151 */
154 protected function parseEntries($entries) 152 protected function parseEntries(array $entries)
155 { 153 {
156 $i = 1; 154 $i = 1;
157 $entryToBeFlushed = []; 155 $entryToBeFlushed = [];
@@ -199,8 +197,6 @@ abstract class BrowserImport extends AbstractImport
199 * 197 *
200 * Faster parse entries for Producer. 198 * Faster parse entries for Producer.
201 * We don't care to make check at this time. They'll be done by the consumer. 199 * We don't care to make check at this time. They'll be done by the consumer.
202 *
203 * @param array $entries
204 */ 200 */
205 protected function parseEntriesForProducer(array $entries) 201 protected function parseEntriesForProducer(array $entries)
206 { 202 {