1 | <?php |
||
19 | class WzClassificationFactory |
||
20 | { |
||
21 | /** |
||
22 | * @return WzClassificationInterface The classification based upon the included `/assets/WZ2008*xml` file. |
||
23 | * @throws InvalidArgumentException Unreadable or invalid file. |
||
24 | */ |
||
25 | 15 | public static function build() |
|
30 | |||
31 | /** |
||
32 | * @param string $xmlFile |
||
33 | * @return WzClassificationInterface |
||
34 | * @throws InvalidArgumentException Unreadable or invalid file. |
||
35 | */ |
||
36 | 24 | public static function buildFromFile($xmlFile) |
|
47 | |||
48 | /** |
||
49 | * @param SimpleXMLElement $xml |
||
50 | * @return WzClassificationInterface |
||
51 | */ |
||
52 | 15 | public static function buildFromXml(SimpleXMLElement $xml) |
|
56 | |||
57 | /** |
||
58 | * @param SimpleXMLElement $xml |
||
59 | * @return WzItemInterface[] |
||
60 | */ |
||
61 | 15 | private static function buildItems(SimpleXMLElement $xml) |
|
94 | |||
95 | /** |
||
96 | * @param SimpleXMLElement $xmlItem |
||
97 | * @return string[] |
||
98 | */ |
||
99 | 15 | private static function buildLabels(SimpleXMLElement $xmlItem) |
|
109 | } |
||
110 |