Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
33 | static public function createFromXML(\SimpleXMLElement $xmlElement = null) |
||
|
|||
34 | { |
||
35 | $dateArray = explode('/', (string)$xmlElement->attributes()[0]); |
||
36 | if (count($dateArray) === 3) { |
||
37 | $dateTime = new \DateTime(); |
||
38 | $dateTime->setDate($dateArray[2], $dateArray[0], $dateArray[1]); |
||
39 | $dateTime->setTime(0, 0, 0); |
||
40 | |||
41 | return new CurrencyRateDate($dateTime, (float)$xmlElement->Rate); |
||
42 | } |
||
43 | |||
44 | return new CurrencyRateDate(new \DateTime(), null); |
||
45 | } |
||
46 | |||
65 | } |