| Conditions | 5 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function embedInfoToItems(array $patches, $update, $onlyNew = false) |
||
| 21 | { |
||
| 22 | foreach ($patches as $target => $group) { |
||
| 23 | foreach (array_keys($group) as $path) { |
||
| 24 | $patches[$target][$path] = is_array($update) |
||
| 25 | ? array_replace( |
||
| 26 | $patches[$target][$path], |
||
| 27 | $onlyNew ? array_diff_key($update, array_filter($patches[$target][$path])) : $update |
||
| 28 | ) |
||
| 29 | : $update; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | |||
| 33 | return $patches; |
||
| 34 | } |
||
| 47 |