From 53ecc09f5d1045490bed82647655da0627e69a6b Mon Sep 17 00:00:00 2001 From: Daniel Rodrigues Date: Sun, 4 Jun 2017 15:13:28 -0300 Subject: [PATCH 1/2] else unnecessary in this snippet --- src/Illuminate/Support/Collection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index cf190aa8a464..d2f3c0d2936e 100644 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -1548,9 +1548,9 @@ public function offsetSet($key, $value) { if (is_null($key)) { $this->items[] = $value; - } else { - $this->items[$key] = $value; } + + $this->items[$key] = $value; } /** From 67f15e9a097ee14cc8365388673b119e3e72ed1d Mon Sep 17 00:00:00 2001 From: Daniel Rodrigues Date: Sun, 4 Jun 2017 16:08:22 -0300 Subject: [PATCH 2/2] else unnecessary in this snippet yet --- src/Illuminate/Support/Collection.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index d2f3c0d2936e..22fd2f9dde9c 100644 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -1144,14 +1144,14 @@ public function shuffle($seed = null) if (is_null($seed)) { shuffle($items); - } else { - srand($seed); - - usort($items, function () { - return rand(-1, 1); - }); } + srand($seed); + + usort($items, function () { + return rand(-1, 1); + }); + return new static($items); }