Conditions | 3 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
29 | 7 | public function unserialize(SerializedCommandData $serializedCommandData) |
|
30 | { |
||
31 | 7 | $commandClass = $serializedCommandData->getCommandClass(); |
|
32 | 7 | if (!is_object($serializedCommandData->getSerializedCommand()) || !$serializedCommandData->getSerializedCommand() instanceof $commandClass) { |
|
33 | 3 | throw new UnserializeErrorException($serializedCommandData, "Null serializer accepts only commands as serialized command data."); |
|
34 | } |
||
35 | 4 | return $serializedCommandData->getSerializedCommand(); |
|
36 | } |
||
37 | |||
39 |