PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 1.21
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v1.21
2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 1.45 All 41 releases
fluent-boards / app / Services / Libs / csv / src / Modifier / MapIterator.php

MapIterator.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 1.21, at app/Services/Libs/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 7.2.0
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