From 3011b28e5e627ea6bc131ecfa93d78210d107415 Mon Sep 17 00:00:00 2001 From: Micah Wood Date: Tue, 22 Mar 2022 06:54:37 -0400 Subject: [PATCH] Switch key/value in filter callbacks --- Collection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Collection.php b/Collection.php index 5e76ec1..6f63fe6 100644 --- a/Collection.php +++ b/Collection.php @@ -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 ); } ); @@ -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 ); } );