diff options
Diffstat (limited to 'fetcher')
-rw-r--r-- | fetcher/feedfetcher.php | 8 | ||||
-rw-r--r-- | fetcher/fetcher.php | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/fetcher/feedfetcher.php b/fetcher/feedfetcher.php index 9c2049395..3427331b4 100644 --- a/fetcher/feedfetcher.php +++ b/fetcher/feedfetcher.php @@ -89,7 +89,7 @@ class FeedFetcher implements IFeedFetcher { try { // somehow $simplePie turns into a feed after init - $items = array(); + $items = []; $permaLink = $simplePie->get_permalink(); if ($feedItems = $simplePie->get_items()) { foreach($feedItems as $feedItem) { @@ -99,7 +99,7 @@ class FeedFetcher implements IFeedFetcher { $feed = $this->buildFeed($simplePie, $url, $getFavicon); - return array($feed, $items); + return [$feed, $items]; } catch(\Exception $ex){ throw new FetcherException($ex->getMessage()); @@ -109,7 +109,7 @@ class FeedFetcher implements IFeedFetcher { private function decodeTwice($string) { - // behold! ' is not converted by PHP thats why we need to do it + // behold! ' is not converted by PHP that's why we need to do it // manually (TM) return str_replace(''', '\'', html_entity_decode( @@ -137,7 +137,7 @@ class FeedFetcher implements IFeedFetcher { $guid = $simplePieItem->get_id(); $item->setGuid($guid); - // purification is done in the businesslayer + // purification is done in the service layer $item->setBody($simplePieItem->get_content()); // pubdate is not required. if not given use the current date diff --git a/fetcher/fetcher.php b/fetcher/fetcher.php index a2ea42626..5cd63102d 100644 --- a/fetcher/fetcher.php +++ b/fetcher/fetcher.php @@ -19,7 +19,7 @@ class Fetcher { private $fetchers; public function __construct(){ - $this->fetchers = array(); + $this->fetchers = []; } @@ -28,7 +28,7 @@ class Fetcher { * @param IFeedFetcher $fetcher the fetcher */ public function registerFetcher(IFeedFetcher $fetcher){ - array_push($this->fetchers, $fetcher); + $this->fetchers[] = $fetcher; } /** @@ -46,6 +46,8 @@ class Fetcher { return $fetcher->fetch($url, $getFavicon); } } + + return [null, []]; } |