| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | 1 | public function onAfterFieldDefinition($data, $item): void |
|
| 35 | { |
||
| 36 | // A locale can be null, those need to be skipped |
||
| 37 | 1 | $locales = Locale::get()->exclude(['Locale' => null]); |
|
| 38 | |||
| 39 | 1 | foreach ($locales as $locale) { |
|
| 40 | 1 | $copy = $item; |
|
| 41 | 1 | $copy['Field'] = sprintf('%s_%s', $item['Field'], $locale->Locale); |
|
| 42 | 1 | $data->push($copy); |
|
| 43 | } |
||
| 46 |