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