| 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 |
||
| 55 | 3 | public function unserialize(SerializedCommandData $serializedCommandData) |
|
| 56 | { |
||
| 57 | try { |
||
| 58 | 3 | $command = $this->serializer->deserialize($serializedCommandData->getSerializedCommand(), $serializedCommandData->getCommandClass(), $this->format); |
|
| 59 | 3 | } catch (Exception $e) { |
|
| 60 | 1 | throw new UnserializeErrorException($serializedCommandData, $e->getMessage(), $e->getCode(), $e); |
|
| 61 | } |
||
| 62 | 2 | if (!is_object($command) || !$command instanceof CommandInterface) { |
|
| 63 | 1 | throw new UnserializeErrorException($serializedCommandData, "Unserialized command should implement CommandInterface."); |
|
| 64 | } |
||
| 65 | 1 | return $command; |
|
| 66 | } |
||
| 67 | } |
||
| 68 |