From 57f9e3254d16531d7bccf38d3a4767669337a8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Mon, 17 Jan 2022 11:48:11 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E6=94=B9=E5=90=8D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fdf58326 --- Collection.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Collection.php b/Collection.php index 2818e94..928a7f8 100644 --- a/Collection.php +++ b/Collection.php @@ -82,10 +82,10 @@ class Collection extends AbstractCollection */ #[Pure] public function slice(int $start = 0, int $length = 20): array { - if (empty($this->_item) || !is_array($this->_item)) { + if (empty($this->_item)) { return []; } - if (count($this->_item) < $length) { + if (\count($this->_item) < $length) { return $this->_item; } else { return array_slice($this->_item, $start, $length); @@ -138,7 +138,7 @@ class Collection extends AbstractCollection */ #[Pure] public function size(): int { - return (int)count($this->_item); + return count($this->_item); } /**