| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function render($value) |
||
| 26 | { |
||
| 27 | $mapping = $this |
||
| 28 | ->options |
||
| 29 | ->get('mapping') |
||
| 30 | ; |
||
| 31 | |||
| 32 | if (!array_key_exists($value, $mapping)) { |
||
| 33 | throw new LogicException('Value "'.$value.' " not found in mapping '.implode(',', $mapping)); |
||
| 34 | } |
||
| 35 | |||
| 36 | return $this |
||
| 37 | ->translator |
||
| 38 | ->trans($mapping[$value]) |
||
| 39 | ; |
||
| 40 | } |
||
| 41 | |||
| 76 |