Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Modules\Map\Domain\Repository;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Modules\Map\Domain\Model\IpLocationDto;
12
13/**
14 * Contract for reading binary MaxMind MMDB format database records.
15 *
16 * @package App\Modules\Map\Domain\Repository
17 */
18interface MaxMindMmdbReaderInterface
19{
20    /**
21     * Attempts to resolve IP to coordinates and metadata.
22     *
23     * @param string $ip IPv4 or IPv6 string.
24     * @return IpLocationDto|null Resolved DTO or null if not found.
25     */
26    public function lookup(string $ip): ?IpLocationDto;
27
28    /**
29     * Checks if MMDB reader instance is opened and valid.
30     */
31    public function isAvailable(): bool;
32}