Various code cleanup.

This commit is contained in:
James Cole
2022-12-30 09:28:03 +01:00
parent 03e176bd16
commit ee0116f112
17 changed files with 171 additions and 125 deletions

View File

@@ -25,6 +25,7 @@ namespace FireflyIII\Support;
use Carbon\Carbon;
use DB;
use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account;
use FireflyIII\Models\Transaction;
@@ -667,4 +668,19 @@ class Steam
return $amount;
}
/**
* @param string $ipAddress
* @return string
* @throws FireflyException
*/
public function getHostName(string $ipAddress): string
{
try {
$hostName = gethostbyaddr($ipAddress);
} catch (Exception $e) {
throw new FireflyException($e->getMessage(), 0, $e);
}
return $hostName;
}
}