Conditions | 5 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public static function createFromXML(SimpleXMLElement $xml): self |
||
39 | { |
||
40 | $self = new self(); |
||
41 | |||
42 | if (isset($xml->barcode) && (string)$xml->barcode !== '') { |
||
43 | $self->setBarcode((string)$xml->barcode); |
||
44 | } |
||
45 | if (isset($xml->reference) && (string)$xml->reference !== '') { |
||
46 | $self->setReference((string)$xml->reference); |
||
47 | } |
||
48 | |||
49 | return $self; |
||
50 | } |
||
53 |