From 1aa2186ef5dd3154a8b3e05c0977106efcb05ffd Mon Sep 17 00:00:00 2001 From: "y.dombrovsky" Date: Sun, 13 Jan 2019 23:55:28 +0300 Subject: [PATCH] fix bug count property --- src/getjump/Vk/Response/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/getjump/Vk/Response/Response.php b/src/getjump/Vk/Response/Response.php index 6f6cf83..bb6239c 100644 --- a/src/getjump/Vk/Response/Response.php +++ b/src/getjump/Vk/Response/Response.php @@ -56,7 +56,7 @@ public function __construct($data, $callback = false) } $this->count = !isset($data->count) ? false : $data->count; if (is_array($data) || !isset($data->items)) { - $this->count = count($data); + $this->count = (is_array($data) || $data instanceof \Countable) ? count($data) : false; if (is_array($data) && is_callable($callback)) { foreach ($data as $d) { $this->data[] = call_user_func_array($callback, [$d]);