Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare( strict_types=1 ); |
||
31 | public function parse( string $serialization ): StatementGuid { |
||
32 | $keyParts = explode( StatementGuid::SEPARATOR, $serialization, 2 ); |
||
33 | if ( count( $keyParts ) !== 2 ) { |
||
34 | throw new StatementGuidParsingException( '$serialization does not have the correct number of parts' ); |
||
35 | 11 | } |
|
36 | 11 | ||
37 | 3 | try { |
|
38 | return new StatementGuid( $this->entityIdParser->parse( $keyParts[0] ), $keyParts[1], $serialization ); |
||
39 | } catch ( EntityIdParsingException $ex ) { |
||
40 | 8 | throw new StatementGuidParsingException( |
|
41 | '$serialization contains invalid EntityId: ' |
||
42 | 8 | . $ex->getMessage() |
|
43 | 4 | ); |
|
48 |