| Conditions | 5 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 61 | 3 | public static function createFromXML(\SimpleXMLElement $xml) |
|
| 62 | { |
||
| 63 | 3 | $self = new self(); |
|
| 64 | 3 | if (isset($xml->barcode) && $xml->barcode != '') { |
|
| 65 | 3 | $self->setBarcode((string)$xml->barcode); |
|
| 66 | 3 | } |
|
| 67 | 3 | if (isset($xml->reference) && $xml->reference != '') { |
|
| 68 | 3 | $self->setReference((string)$xml->reference); |
|
| 69 | 3 | } |
|
| 70 | |||
| 71 | 3 | return $self; |
|
| 72 | } |
||
| 73 | } |
||
| 74 |