# age-gate/3.7.3/vendor/nette/utils/src/Iterators/Mapper.php

Age Gate, version 3.7.3. 36 lines.

- Page: https://pluginprobe.com/plugins/age-gate/3.7.3/code/vendor/nette/utils/src/Iterators/Mapper.php
- Raw: https://pluginprobe.com/plugins/age-gate/3.7.3/raw/vendor/nette/utils/src/Iterators/Mapper.php
- Modified: 2025-07-01T20:34:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/age-gate/3.7.3/code/vendor/nette/utils/src/Iterators/Mapper.php#L10-L20`.

```php
<?php

/**
 * This file is part of the Nette Framework (https://nette.org)
 * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
 */

declare(strict_types=1);

namespace Nette\Iterators;



/**
 * Applies the callback to the elements of the inner iterator.
 */
class Mapper extends \IteratorIterator
{
	/** @var callable */
	private $callback;


	public function __construct(\Traversable $iterator, callable $callback)
	{
		parent::__construct($iterator);
		$this->callback = $callback;
	}


	#[\ReturnTypeWillChange]
	public function current()
	{
		return ($this->callback)(parent::current(), parent::key());
	}
}

```
