From 8707364bf3b0204287277b4beae658ae5f9b9242 Mon Sep 17 00:00:00 2001 From: Aimeos Date: Wed, 31 Jul 2024 13:03:12 +0200 Subject: [PATCH] Fixed tests for PHP 7.x --- tests/MapTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/MapTest.php b/tests/MapTest.php index 49b6bc3..22ddca1 100644 --- a/tests/MapTest.php +++ b/tests/MapTest.php @@ -148,8 +148,8 @@ public function testAvg() public function testAvgClosure() { - $this->assertSame( 20.0, Map::from( [30, 50, 10] )->avg( fn( $val ) => $val < 50 ? $val : null ) ); - $this->assertSame( 30.0, Map::from( [30, 50, 10] )->avg( fn( $val, $key ) => $key < 1 ? $val : null ) ); + $this->assertSame( 20.0, Map::from( [30, 50, 10] )->avg( function( $val ) { return $val < 50 ? $val : null; } ) ); + $this->assertSame( 30.0, Map::from( [30, 50, 10] )->avg( function( $val, $key ) { return $key < 1 ? $val : null; } ) ); } @@ -3083,8 +3083,8 @@ public function testSum() public function testSumClosure() { - $this->assertSame( 40.0, Map::from( [30, 50, 10] )->sum( fn( $val ) => $val < 50 ? $val : 0 ) ); - $this->assertSame( 60.0, Map::from( [30, 50, 10] )->sum( fn( $val, $key ) => $key > 0 ? $val : 0 ) ); + $this->assertSame( 40.0, Map::from( [30, 50, 10] )->sum( function( $val ) { return $val < 50 ? $val : 0; } ) ); + $this->assertSame( 60.0, Map::from( [30, 50, 10] )->sum( function( $val, $key ) { return $key > 0 ? $val : 0; } ) ); }