Skip to content

Commit

Permalink
Make parameter for map() optional
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Jan 20, 2020
1 parent 840a3cb commit 4fa93f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/function.php
Expand Up @@ -2,7 +2,7 @@

if( !function_exists( 'map' ) )
{
function map( iterable $items )
function map( iterable $items = [] )
{
return new \Aimeos\Map( $items );
}
Expand Down
1 change: 1 addition & 0 deletions tests/MapTest.php
Expand Up @@ -13,6 +13,7 @@ class MapTest extends \PHPUnit\Framework\TestCase
{
public function testFunction()
{
$this->assertInstanceOf( Map::class, \map() );
$this->assertInstanceOf( Map::class, \map( [] ) );
}

Expand Down

0 comments on commit 4fa93f6

Please sign in to comment.