commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
lib
commercetools-base
src
Base
MapperIterator.php
1
<?php
2
3
declare(strict_types=1);
10
namespace
Commercetools\Base
;
11
12
class
MapperIterator
extends
\IteratorIterator
13
{
17
private
$mapper;
18
19
public
function
__construct
(\Traversable $iterator, callable $mapper)
20
{
21
parent::__construct($iterator);
22
$this->mapper = $mapper;
23
}
24
25
#[\ReturnTypeWillChange]
26
public
function
current
()
27
{
29
return
call_user_func($this->mapper, parent::current(), parent::key());
30
}
31
}
Commercetools\Base\MapperIterator
Definition:
MapperIterator.php:13
Commercetools\Base\MapperIterator\__construct
__construct(\Traversable $iterator, callable $mapper)
Definition:
MapperIterator.php:19
Commercetools\Base\MapperIterator\current
current()
Definition:
MapperIterator.php:26
Commercetools\Base
Definition:
MapperArraySequence.php:10
Generated by
1.9.1