File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ public function intersectKeys(array|self ...$arrays): self
332332 *
333333 * @return static<TKey, TValue>
334334 */
335- public function onlyKeys (array |self ...$ arrays ): self
335+ public function withKeys (array |self ...$ arrays ): self
336336 {
337337 return $ this ->createOrModify (namespace \intersect_keys ($ this ->value , array_flip (...$ arrays )));
338338 }
@@ -345,7 +345,7 @@ public function onlyKeys(array|self ...$arrays): self
345345 *
346346 * @return static<TKey, TValue>
347347 */
348- public function exceptKeys (array |self ...$ arrays ): self
348+ public function withoutKeys (array |self ...$ arrays ): self
349349 {
350350 return $ this ->createOrModify (namespace \diff_keys ($ this ->value , array_flip (...$ arrays )));
351351 }
Original file line number Diff line number Diff line change @@ -574,15 +574,15 @@ public function test_intersect_keys(): void
574574 $ this ->assertSame ($ expected , $ current );
575575 }
576576
577- public function test_only_keys (): void
577+ public function test_with_keys (): void
578578 {
579579 $ collection = arr ([
580580 'first_name ' => 'John ' ,
581581 'last_name ' => 'Doe ' ,
582582 'age ' => 42 ,
583583 ]);
584584 $ current = $ collection
585- ->onlyKeys (['first_name ' , 'last_name ' ])
585+ ->withKeys (['first_name ' , 'last_name ' ])
586586 ->toArray ();
587587 $ expected = [
588588 'first_name ' => 'John ' ,
@@ -592,15 +592,15 @@ public function test_only_keys(): void
592592 $ this ->assertSame ($ expected , $ current );
593593 }
594594
595- public function test_except_keys (): void
595+ public function test_without_keys (): void
596596 {
597597 $ collection = arr ([
598598 'first_name ' => 'John ' ,
599599 'last_name ' => 'Doe ' ,
600600 'age ' => 42 ,
601601 ]);
602602 $ current = $ collection
603- ->exceptKeys (['age ' ])
603+ ->withoutKeys (['age ' ])
604604 ->toArray ();
605605 $ expected = [
606606 'first_name ' => 'John ' ,
You can’t perform that action at this time.
0 commit comments