| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | 3 | public function unserialize(SerializedCommandData $serializedCommandData) |
|
| 49 | { |
||
| 50 | try { |
||
| 51 | 3 | $command = $this->serializer->deserialize($serializedCommandData->getSerializedCommand(), $serializedCommandData->getCommandClass(), $this->format); |
|
| 52 | 3 | } catch (\Exception $e) { |
|
| 53 | 1 | throw new TranslateErrorException($serializedCommandData, $e->getMessage(), $e->getCode(), $e); |
|
| 54 | } |
||
| 55 | 2 | if (!is_object($command) || !$command instanceof CommandInterface) { |
|
| 56 | 1 | throw new TranslateErrorException($serializedCommandData, "Unserialized command should implement CommandInterface."); |
|
| 57 | } |
||
| 58 | 1 | return $command; |
|
| 59 | } |
||
| 60 | } |
||
| 61 |