| Conditions | 8 |
| Paths | 8 |
| Total Lines | 32 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 9 | public static function parse(array $xml) |
||
| 10 | { |
||
| 11 | if (isset($xml['string'])) { |
||
| 12 | return $xml['string']; |
||
| 13 | } |
||
| 14 | |||
| 15 | if (isset($xml['base64'])) { |
||
| 16 | return base64_decode($xml['base64'], true); |
||
| 17 | } |
||
| 18 | |||
| 19 | if (isset($xml['i4'])) { |
||
| 20 | return (int)$xml['i4']; |
||
| 21 | } |
||
| 22 | |||
| 23 | if (isset($xml['int'])) { |
||
| 24 | return (int)$xml['int']; |
||
| 25 | } |
||
| 26 | |||
| 27 | if (isset($xml['double'])) { |
||
| 28 | return (float)$xml['double']; |
||
| 29 | } |
||
| 30 | |||
| 31 | if (isset($xml['boolean'])) { |
||
| 32 | return (bool)$xml['boolean']; |
||
| 33 | } |
||
| 34 | |||
| 35 | if (isset($xml['dateTime.iso8601'])) { |
||
| 36 | return new DateTimeImmutable($xml['dateTime.iso8601']); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $xml; |
||
| 40 | } |
||
| 41 | } |
||
| 42 |