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');
}
}
*
* @param Notice $notice a Notice to add
*/
- function addEntryFromNotice($notice)
+ function addEntryFromNotice(Notice $notice)
{
try {
$source = $this->showSource();