Conditions | 5 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
45 | public function resolve(bool $force = false) : bool |
||
46 | { |
||
47 | if (!$force && is_array($this->_results)) { |
||
48 | return true; |
||
49 | } |
||
50 | |||
51 | $this->_results = []; |
||
52 | foreach ($this->_pool as $address => $type) { |
||
53 | if (!($result = dns_get_record($address, $type))) { |
||
54 | continue; |
||
55 | } |
||
56 | |||
57 | $this->_results = array_merge($this->_results, array_map(function ($record) { |
||
58 | return [$record['target'], $record['port']]; |
||
59 | }, $result)); |
||
60 | } |
||
61 | return true; |
||
62 | } |
||
63 | } |
||
64 |