| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 70 | 6 | protected function getMappedValue($value) |
|
| 71 | { |
||
| 72 | 6 | if (null === $value) { |
|
| 73 | return $value; |
||
| 74 | } |
||
| 75 | |||
| 76 | 6 | if (!array_key_exists($value, $this->mapping)) { |
|
| 77 | 2 | throw new TransformationFailedException( |
|
| 78 | 2 | sprintf('Value %s not found for key "%s"', json_encode($value), $this->name) |
|
| 79 | ); |
||
| 80 | } |
||
| 81 | |||
| 82 | 4 | return $this->mapping[$value]; |
|
| 83 | } |
||
| 84 | } |
||
| 85 |