| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public static function extractDomains(array $inventory): array |
||
| 10 | { |
||
| 11 | if (!array_key_exists(ApacheServerNameCollector::COLLECTION_IDENTIFIER, $inventory) |
||
| 12 | || !is_array($inventory[ApacheServerNameCollector::COLLECTION_IDENTIFIER]) |
||
| 13 | ) return []; |
||
| 14 | |||
| 15 | $configs = $inventory[ApacheServerNameCollector::COLLECTION_IDENTIFIER]; |
||
| 16 | |||
| 17 | $domains = []; |
||
| 18 | |||
| 19 | foreach ($configs as $config) { |
||
| 20 | $domains[] = $config[ApacheServerNameCollector::FIELD_SERVER_NAME]; |
||
| 21 | } |
||
| 22 | |||
| 23 | return $domains; |
||
| 24 | } |
||
| 25 | } |