File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2899,7 +2899,9 @@ public function testRestrictKey()
28992899
29002900 public function testRestrictClosure ()
29012901 {
2902- $ r = Map::from ( [['name ' => 'test ' ], ['name ' => 'user ' ]] )->restrict ( fn ( $ v , $ k ) => $ v ['name ' ] === 'user ' );
2902+ $ r = Map::from ( [['name ' => 'test ' ], ['name ' => 'user ' ]] )->restrict ( function ( $ v , $ k ) {
2903+ return $ v ['name ' ] === 'user ' ;
2904+ } );
29032905
29042906 $ this ->assertInstanceOf ( Map::class, $ r );
29052907 $ this ->assertSame ( [1 => ['name ' => 'user ' ]], $ r ->toArray () );
@@ -2908,7 +2910,9 @@ public function testRestrictClosure()
29082910
29092911 public function testRestrictClosureKey ()
29102912 {
2911- $ r = Map::from ( ['a ' , 'b ' , 'a ' ] )->restrict ( fn ( $ v , $ k ) => $ v === 'a ' && $ k < 2 );
2913+ $ r = Map::from ( ['a ' , 'b ' , 'a ' ] )->restrict ( function ( $ v , $ k ) {
2914+ return $ v === 'a ' && $ k < 2 ;
2915+ } );
29122916
29132917 $ this ->assertInstanceOf ( Map::class, $ r );
29142918 $ this ->assertSame ( [0 => 'a ' ], $ r ->toArray () );
You can’t perform that action at this time.
0 commit comments