From: Mikael Nordfeldth Date: Thu, 9 Jul 2015 11:56:02 +0000 (+0200) Subject: Type controlling in lib/atomnoticefeed.php X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=65f1f74f2ba7d4e8e728e45d5f21b242816d532a;p=quix0rs-gnu-social.git Type controlling in lib/atomnoticefeed.php --- diff --git a/lib/atomnoticefeed.php b/lib/atomnoticefeed.php index 292bc97e85..b7e1ed1b41 100644 --- a/lib/atomnoticefeed.php +++ b/lib/atomnoticefeed.php @@ -113,10 +113,12 @@ class AtomNoticeFeed extends Atom10Feed foreach ($notices as $notice) { $this->addEntryFromNotice($notice); } - } else { + } elseif ($notices instanceof Notice) { while ($notices->fetch()) { $this->addEntryFromNotice($notices); } + } else { + throw new ServerException('addEntryFromNotices got neither an array nor a Notice object'); } } @@ -125,7 +127,7 @@ class AtomNoticeFeed extends Atom10Feed * * @param Notice $notice a Notice to add */ - function addEntryFromNotice($notice) + function addEntryFromNotice(Notice $notice) { try { $source = $this->showSource();