| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 39 | 4 | public function unserialize($encodedValue) |
|
| 40 | { |
||
| 41 | try { |
||
| 42 | 4 | $data = Json::decode($encodedValue, Json::TYPE_ARRAY); |
|
| 43 | 4 | } catch (RuntimeException $e) { |
|
| 44 | 2 | throw new InvalidArgumentException($e->getMessage(), 0, $e); |
|
| 45 | } |
||
| 46 | |||
| 47 | 2 | if (!array_key_exists('Message', $data)) { |
|
| 48 | 1 | throw new InvalidArgumentException('Message is required and cannot be empty.'); |
|
| 49 | } |
||
| 50 | |||
| 51 | 1 | return $this->serializer->unserialize($data['Message']); |
|
| 52 | } |
||
| 53 | } |
||
| 54 |