Skip to content

Commit 7778fcd

Browse files
committed
Throw invalid argument exception if value below zero is given
1 parent de9f797 commit 7778fcd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Collection.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,12 @@ public function split($numberOfGroups)
955955
*/
956956
public function chunk($size)
957957
{
958+
if ($size < 0) {
959+
throw new InvalidArgumentException(
960+
'Size parameter expected to be greater than 0'
961+
);
962+
}
963+
958964
if ($size == 0) {
959965
return new static;
960966
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy