Skip to content

Commit

Permalink
[5.7] Delete unneeded type check, since it will never be true (#26053)
Browse files Browse the repository at this point in the history
Actually, we should not check the `$data instanceof Collection`, since Collection implements an `Arrayable` which checked before this.
  • Loading branch information
TBlindaruk authored and taylorotwell committed Oct 10, 2018
1 parent f8b810e commit 196c518
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Http/Resources/Json/JsonResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function resolve($request = null)

if (is_array($data)) {
$data = $data;
} elseif ($data instanceof Arrayable || $data instanceof Collection) {
} elseif ($data instanceof Arrayable) {
$data = $data->toArray();
} elseif ($data instanceof JsonSerializable) {
$data = $data->jsonSerialize();
Expand Down

0 comments on commit 196c518

Please sign in to comment.