Skip to content

Commit

Permalink
Fix usage of reduceWithKeys() => reduce() (laravel#7012)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ivanov authored Apr 21, 2021
1 parent 1ef1807 commit bf55adf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ The `reduce` method also passes array keys in associative collections to the giv
'eur' => 1.22,
];

$collection->reduceWithKeys(function ($carry, $value, $key) use ($ratio) {
$collection->reduce(function ($carry, $value, $key) use ($ratio) {
return $carry + ($value * $ratio[$key]);
});

Expand Down

0 comments on commit bf55adf

Please sign in to comment.