Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** @license For full copyright and license information, please see the LICENSE.md file. */ |
| 6 | |
| 7 | namespace App\Modules\Map\Domain\Repository; |
| 8 | |
| 9 | defined('AMMONLY_APP') || exit('Direct script access is forbidden.'); |
| 10 | |
| 11 | use App\Modules\Map\Domain\Model\IpLocationDto; |
| 12 | |
| 13 | /** |
| 14 | * Contract for resolving geographical location from an IP address. |
| 15 | * |
| 16 | * @package App\Modules\Map\Domain\Repository |
| 17 | */ |
| 18 | interface IpGeolocationServiceInterface |
| 19 | { |
| 20 | /** |
| 21 | * Resolves IPv4 or IPv6 address to latitude, longitude and country/city metadata. |
| 22 | * |
| 23 | * @param string $ipAddress IPv4 or IPv6 address string. |
| 24 | * @return IpLocationDto|null Resolved location DTO or null if unable to resolve. |
| 25 | */ |
| 26 | public function resolveIp(string $ipAddress): ?IpLocationDto; |
| 27 | |
| 28 | /** |
| 29 | * Resolves multiple IP addresses in bulk with local persistent caching. |
| 30 | * |
| 31 | * @param array<int, string> $ipAddresses List of IP addresses. |
| 32 | * @return array<string, IpLocationDto> Map of resolved IP => IpLocationDto. |
| 33 | */ |
| 34 | public function resolveBulk(array $ipAddresses): array; |
| 35 | } |