Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
36 | 15 | public function deserialize( $serialization ) { |
|
37 | 15 | if ( !is_string( $serialization ) ) { |
|
38 | 2 | throw new DeserializationException( 'The serialization of an entity ID should be a string' ); |
|
39 | } |
||
40 | |||
41 | try { |
||
42 | 13 | return $this->entityIdParser->parse( $serialization ); |
|
43 | 1 | } catch ( EntityIdParsingException $e ) { |
|
44 | 1 | throw new DeserializationException( "'$serialization' is not a valid entity ID", $e ); |
|
45 | } |
||
46 | } |
||
47 | |||
49 |