feed = $feedParser->parseFeed($xmlString); } catch (\Exception $e) { // FeedMergeBridge relies on this string throw new \Exception(sprintf('Failed to parse xml from %s: %s', $url, create_sane_exception_message($e))); } $items = array_slice($this->feed['items'], 0, $maxItems); // todo: extract parse logic out from FeedParser foreach ($items as $item) { // Give bridges a chance to modify the item $item = $this->parseItem($item); if ($item) { $this->items[] = $item; } } } /** * This method is overridden by bridges * * @return array */ protected function parseItem(array $item) { return $item; } public function getURI() { return $this->feed['uri'] ?? parent::getURI(); } public function getName() { return $this->feed['title'] ?? parent::getName(); } public function getIcon() { return $this->feed['icon'] ?? parent::getIcon(); } }