| Conditions | 4 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 57 | function __construct(\SimpleXMLElement $xmlElement = null, \DateTime $date = null) |
||
|
|
|||
| 58 | { |
||
| 59 | if (!is_null($xmlElement)) { |
||
| 60 | $this->id = (int)$xmlElement->attributes()[0]; |
||
| 61 | $this->numCode = (int)$xmlElement->NumCode; |
||
| 62 | $this->charCode = (string)$xmlElement->CharCode; |
||
| 63 | $this->name = (string)($xmlElement->Name ? $xmlElement->Name : $xmlElement->QuotName); |
||
| 64 | $this->scale = (int)$xmlElement->Scale; |
||
| 65 | $this->rate = (float)$xmlElement->Rate; |
||
| 66 | } |
||
| 67 | |||
| 68 | if ($date) { |
||
| 69 | $this->date = $date; |
||
| 70 | } |
||
| 71 | } |
||
| 72 | |||
| 132 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.