Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class ArrayMapRecursiveTransformer extends TransformerAbstract |
||
19 | { |
||
20 | /** |
||
21 | * Any callable with one argument which returns something |
||
22 | * |
||
23 | * @var callable |
||
24 | */ |
||
25 | protected $mapper; |
||
26 | |||
27 | /** |
||
28 | * @param callable $mapper |
||
29 | * |
||
30 | * @throws NodalFlowException |
||
31 | */ |
||
32 | public function __construct(callable $mapper) |
||
33 | { |
||
34 | $this->mapper = $mapper; |
||
35 | parent::__construct(); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Execute the arrayMapRecursive call |
||
40 | * |
||
41 | * @param array $record |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | public function exec($record = null) |
||
46 | { |
||
47 | return $this->arrayMapRecursive($record); |
||
|
|||
48 | } |
||
49 | |||
50 | protected function arrayMapRecursive(array $record): array |
||
58 | } |
||
59 | } |
||
60 |