Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 0 |
1 | <?php |
||
43 | 3 | public function unserialize(SerializedCommandData $serializedCommandData) |
|
44 | { |
||
45 | try { |
||
46 | 3 | $command = $this->serializer->deserialize($serializedCommandData->getSerializedCommand(), $serializedCommandData->getCommandClass(), $this->format); |
|
47 | 3 | } catch (Exception $e) { |
|
48 | throw new TranslateErrorException($serializedCommandData, $e->getMessage(), $e->getCode(), $e); |
||
49 | } |
||
50 | 3 | if (!$command instanceof CommandInterface) { |
|
51 | 2 | throw new TranslateErrorException($serializedCommandData, "Unserialized command should implement CommandInterface."); |
|
52 | } |
||
53 | 1 | return $command; |
|
54 | } |
||
55 | |||
57 |