make sure notification always returns array

This commit is contained in:
Denis Duliçi
2021-08-08 23:44:59 +03:00
parent 1921c3465d
commit d3233740b3
5 changed files with 57 additions and 47 deletions

View File

@ -396,7 +396,7 @@ trait Modules
return false;
}
public function getNotifications($path)
public function getNotifications($path): array
{
$key = 'apps.notifications';
@ -407,10 +407,10 @@ trait Modules
}
if (!empty($data) && array_key_exists($path, $data)) {
return $data[$path];
return (array) $data[$path];
}
return false;
return [];
}
public function getPageNumberOfModules($data = [])