| Conditions | 6 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public static function hostnameAnalyzer($identity) |
||
| 20 | { |
||
| 21 | $address = $identity->getAddress(); |
||
| 22 | if (!$address->getHostname()) { |
||
| 23 | $hostname = strtolower(gethostbyaddr($address->getValue())); |
||
| 24 | if ($hostname && $hostname != $address->getValue()) { |
||
| 25 | $address->setHostname($hostname); |
||
| 26 | $reverseAddress = gethostbyname($hostname); |
||
| 27 | if ($reverseAddress && $reverseAddress == $address->getValue()) { |
||
| 28 | $address->setAttribute('reverse', true); |
||
| 29 | } else { |
||
| 30 | $address->setAttribute('reverse', false); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 | return $identity; |
||
| 35 | } |
||
| 36 | |||
| 38 |