-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[5.4] else unnecessary in this snippet #19475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
| } | ||
|
|
||
|
|
@@ -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; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is always going to be executed now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @geekcom: you could've only done that shortening if you were breaking the path of execution (using guard clauses for instance). I wouldn't recommend that though, since it alters type signature in this case.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, let's see what happens with this PR.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you broke the functionality of at least 1 method for no reason at all ... what do you think is going to happen? :)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. humm, that's make sense, so sorry |
||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again ... this is now always going to be executed