Conditions | 2 |
Paths | 1 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
21 | function perTemplateDataCompose(array $template_data_map) { |
||
22 | return function(Template $template) use ($template_data_map) { |
||
23 | 4 | $name = $template->get('normalized_name', $template->name); |
|
24 | |||
25 | 4 | return isset($template_data_map[$name]) |
|
26 | 4 | ? $template->withData(array_merge($template_data_map[$name], $template->data)) |
|
27 | 4 | : $template; |
|
28 | 4 | }; |
|
29 | } |
||
30 |