Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
43 | public function transform(callable $transformer, $data, array $extra = []) |
||
44 | { |
||
45 | $args = [$data, null]; |
||
46 | |||
47 | if (!empty($extra)) { |
||
48 | try { |
||
49 | $args = array_merge( |
||
50 | $args, |
||
51 | $this->validParams($transformer, $extra) |
||
52 | ); |
||
53 | } catch (\ReflectionException $e) { |
||
54 | // Sorry |
||
55 | } |
||
56 | } |
||
57 | |||
58 | return call_user_func_array($transformer, $args); |
||
59 | } |
||
60 | } |
||
61 |