Fix code style and add checks

This commit is contained in:
Amine Ben hammou
2019-06-25 11:36:01 +01:00
committed by M. Shull
parent 232ef05e81
commit 7fba1be402
4 changed files with 17 additions and 12 deletions

View File

@ -39,6 +39,7 @@ class Beamer extends SimpleWorker {
$posts = $this->wp->wpRemoteRetrieveBody($response);
if (empty($posts)) return false;
$posts = json_decode($posts);
if (empty($posts) || empty($posts[0]->date)) return false;
$this->settings->set('last_announcement_date', Carbon::createFromTimeString($posts[0]->date)->getTimestamp());
return true;
}