Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
54 | public static function parse( SimpleXMLElement $xml ) { |
||
55 | $message = self::parse_create_date( $xml, new static() ); |
||
56 | |||
57 | // Parse error. |
||
58 | $parser = new ErrorParser(); |
||
59 | |||
60 | $error = $parser->parse( $xml->Error ); |
||
61 | |||
62 | if ( null === $error ) { |
||
63 | throw new \Exception( 'Failed to parse error response.' ); |
||
64 | } |
||
65 | |||
66 | $message->error = $error; |
||
67 | |||
68 | return $message; |
||
69 | } |
||
71 |