From 2d332b12add5ff7ff98c537175f88f0bf624304b Mon Sep 17 00:00:00 2001 From: 10470 Date: Fri, 7 Jun 2024 11:24:11 +0800 Subject: [PATCH] [11.x] Fix the chunk method to an integer type in the splitIn method --- src/Illuminate/Collections/Collection.php | 2 +- src/Illuminate/Collections/LazyCollection.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Collections/Collection.php b/src/Illuminate/Collections/Collection.php index 60d1daf3e137..995ea2ac2429 100644 --- a/src/Illuminate/Collections/Collection.php +++ b/src/Illuminate/Collections/Collection.php @@ -1254,7 +1254,7 @@ public function split($numberOfGroups) */ public function splitIn($numberOfGroups) { - return $this->chunk(ceil($this->count() / $numberOfGroups)); + return $this->chunk((int) ceil($this->count() / $numberOfGroups)); } /** diff --git a/src/Illuminate/Collections/LazyCollection.php b/src/Illuminate/Collections/LazyCollection.php index e6269071f8ca..8aea9e1ee29e 100644 --- a/src/Illuminate/Collections/LazyCollection.php +++ b/src/Illuminate/Collections/LazyCollection.php @@ -1317,7 +1317,7 @@ public function chunk($size) */ public function splitIn($numberOfGroups) { - return $this->chunk(ceil($this->count() / $numberOfGroups)); + return $this->chunk((int) ceil($this->count() / $numberOfGroups)); } /**