Skip to content

Commit 01c6bbc

Browse files
committed
Fixed tests for PHP 7.x
1 parent 0e02f46 commit 01c6bbc

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/MapTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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() );

0 commit comments

Comments
 (0)