PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 1.2.4
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v1.2.4
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / csv / src / Modifier / MapIterator.php

MapIterator.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 1.2.4, at app/Services/csv/src/Modifier/MapIterator.php

57 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This file is part of the League.csv library
4 *
5 * @license http://opensource.org/licenses/MIT
6 * @link https://github.com/thephpleague/csv/
7 * @version 8.2.2
8 * @package League.csv
9 *
10 * For the full copyright and license information, please view the LICENSE
11 * file that was distributed with this source code.
12 */
13 namespace League\Csv\Modifier;
14
15 use Iterator;
16 use IteratorIterator;
17
18 /**
19 * A simple MapIterator
20 *
21 * @package League.csv
22 * @since 3.3.0
23 * @internal used internally to modify CSV content
24 *
25 */
26 class MapIterator extends IteratorIterator
27 {
28 /**
29 * The function to be apply on all InnerIterator element
30 *
31 * @var callable
32 */
33 private $callable;
34
35 /**
36 * The Constructor
37 *
38 * @param Iterator $iterator
39 * @param callable $callable
40 */
41 public function __construct(Iterator $iterator, callable $callable)
42 {
43 parent::__construct($iterator);
44 $this->callable = $callable;
45 }
46
47 /**
48 * Get the value of the current element
49 */
50 public function current()
51 {
52 $iterator = $this->getInnerIterator();
53
54 return call_user_func($this->callable, $iterator->current(), $iterator->key(), $iterator);
55 }
56 }
57