From 8e1628efe8d370d9f2de9d7cf32ef3f91befbda5 Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Tue, 19 Nov 2019 10:33:59 +0100 Subject: [PATCH] Use proper types in Import Export [MAILPOET-2535] --- lib/API/JSON/v1/ImportExport.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/API/JSON/v1/ImportExport.php b/lib/API/JSON/v1/ImportExport.php index 0207340fcf..2944a306b5 100644 --- a/lib/API/JSON/v1/ImportExport.php +++ b/lib/API/JSON/v1/ImportExport.php @@ -88,12 +88,12 @@ class ImportExport extends APIEndpoint { if (($task instanceof ScheduledTask) && $task->status === null) { return $this->successResponse(); } - if (!$task) { + if (!($task instanceof ScheduledTask)) { $task = ScheduledTask::create(); $task->type = WooCommerceSync::TASK_TYPE; $task->status = ScheduledTask::STATUS_SCHEDULED; } - $task->scheduled_at = Carbon::createFromTimestamp(current_time('timestamp')); + $task->scheduled_at = Carbon::createFromTimestamp((int)current_time('timestamp')); $task->save(); return $this->successResponse(); } catch (\Exception $e) {