Skip to content

Commit e06f97e

Browse files
committed
version
2 parents 5c47140 + cf021e5 commit e06f97e

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/Illuminate/Collections/Arr.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,10 @@ public static function shuffle($array, $seed = null)
716716
return $array;
717717
}
718718

719+
if (empty($array)) {
720+
return [];
721+
}
722+
719723
$keys = array_keys($array);
720724

721725
for ($i = count($keys) - 1; $i > 0; $i--) {

src/Illuminate/Foundation/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
3838
*
3939
* @var string
4040
*/
41-
const VERSION = '10.1.0';
41+
const VERSION = '10.1.1';
4242

4343
/**
4444
* The base path for the Laravel installation.

tests/Support/SupportArrTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,11 @@ public function testShuffle()
870870
$this->assertTrue($dontMatch, 'Shuffled array should not have the same order.');
871871
}
872872

873+
public function testEmptyShuffle()
874+
{
875+
$this->assertEquals([], Arr::shuffle([]));
876+
}
877+
873878
public function testSort()
874879
{
875880
$unsorted = [

0 commit comments

Comments
 (0)