Skip to content

Commit

Permalink
Switch key/value in filter callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
wpscholar authored Mar 22, 2022
1 parent f263603 commit 3011b28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function except( $keys ) {
$keys = (array) $keys;

return $this->filter(
function ( $key, $value ) use ( $keys ) {
function ( $value, $key ) use ( $keys ) {
return ! in_array( $key, $keys, true );
}
);
Expand Down Expand Up @@ -463,7 +463,7 @@ public function offsetUnset( $key ) {
*/
public function only( $keys ) {
return $this->filter(
function ( $key, $value ) use ( $keys ) {
function ( $value, $key ) use ( $keys ) {
return in_array( $key, $keys, true );
}
);
Expand Down

0 comments on commit 3011b28

Please sign in to comment.