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