Conditions | 9 |
Paths | 21 |
Total Lines | 30 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | protected function parseHeaderDataSet(DataSet $dataSet) |
||
24 | { |
||
25 | $result = ['version' => 0, 'released' => 0, 'type' => Type::UNKNOWN]; |
||
26 | |||
27 | $properties = $dataSet->getProperties(); |
||
28 | |||
29 | if ($properties !== false) { |
||
30 | if (array_key_exists('Version', $properties) && ctype_digit($properties['Version'])) { |
||
31 | $result['version'] = (int)$properties['Version']; |
||
32 | } |
||
33 | if (array_key_exists('Released', $properties)) { |
||
34 | $result['released'] = (int)strtotime($properties['Released']); |
||
35 | } |
||
36 | if (array_key_exists('Type', $properties)) { |
||
37 | switch (strtolower($properties['Type'])) { |
||
38 | case 'full': |
||
39 | $result['type'] = Type::FULL; |
||
40 | break; |
||
41 | case 'lite': |
||
42 | $result['type'] = Type::LITE; |
||
43 | break; |
||
44 | case '': |
||
45 | $result['type'] = Type::STANDARD; |
||
46 | break; |
||
47 | } |
||
48 | } |
||
49 | } |
||
50 | |||
51 | return $result; |
||
52 | } |
||
53 | } |
||
54 |