From 48be11b0cb78aeda5d87c95c1a3d5462e44f3060 Mon Sep 17 00:00:00 2001 From: Anastasia Smolyakova Date: Fri, 2 Feb 2024 19:58:04 +0300 Subject: [PATCH] add type to collection --- public/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/index.php b/public/index.php index 5a30adf..86f6fcd 100644 --- a/public/index.php +++ b/public/index.php @@ -78,8 +78,8 @@ GROUP BY url_id, status_code') ->fetchAll(PDO::FETCH_ASSOC); - $urls = collect($allUrls); - $urlChecks = collect($lastChecks)->keyBy('url_id'); + $urls = collect((array) $allUrls); + $urlChecks = collect((array) $lastChecks)->keyBy('url_id'); $data = $urls->map(function ($url) use ($urlChecks) { $urlCheck = $urlChecks->firstWhere('url_id', $url['id']); @@ -216,7 +216,7 @@ $newCheckStmt = $this->get('connection')->prepare($newCheckQuery); $newCheckStmt->execute([ ':url_id' => $urlId, - ':status_code' => $statusCode ?? null, + ':status_code' => $statusCode, ':h1' => $h1 ?? null, ':title' => $title ?? null, ':description' => $description ?? null,