Conditions | 5 |
Paths | 8 |
Total Lines | 24 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 5.0144 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 30 | public function getActiveSheetName($filePath) |
|
28 | { |
||
29 | 30 | $xmlReader = new XMLReader(); |
|
30 | 30 | if ($xmlReader->openFileInZip($filePath, self::SETTINGS_XML_FILE_PATH) === false) { |
|
31 | 19 | return null; |
|
32 | } |
||
33 | |||
34 | 11 | $activeSheetName = null; |
|
35 | |||
36 | try { |
||
37 | 11 | while ($xmlReader->readUntilNodeFound(self::XML_NODE_CONFIG_ITEM)) { |
|
38 | 11 | if ($xmlReader->getAttribute(self::XML_ATTRIBUTE_CONFIG_NAME) === self::XML_ATTRIBUTE_VALUE_ACTIVE_TABLE) { |
|
39 | 11 | $activeSheetName = $xmlReader->readString(); |
|
40 | 11 | break; |
|
41 | } |
||
42 | } |
||
43 | } catch (XMLProcessingException $exception) { |
||
44 | // do nothing |
||
45 | } |
||
46 | |||
47 | 11 | $xmlReader->close(); |
|
48 | |||
49 | 11 | return $activeSheetName; |
|
50 | } |
||
51 | } |
||
52 |