Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace Drupal\visitors_geoip; |
4 | |
5 | use GeoIp2\Database\Reader; |
6 | |
7 | /** |
8 | * Visitors Geo Location Interface. |
9 | * |
10 | * @package visitors_geoip |
11 | */ |
12 | interface VisitorsGeoIpInterface { |
13 | |
14 | /** |
15 | * Get the GeoIP metadata. |
16 | * |
17 | * @return \MaxMind\Db\Reader\Metadata|null |
18 | * The metadata. |
19 | */ |
20 | public function metadata(); |
21 | |
22 | /** |
23 | * Get the GeoIP country. |
24 | * |
25 | * @param string $ip_address |
26 | * The IP address. |
27 | * |
28 | * @return array|null |
29 | * The country. |
30 | */ |
31 | public function city($ip_address); |
32 | |
33 | /** |
34 | * Get the GeoIP reader. |
35 | * |
36 | * @return \GeoIp2\Database\Reader |
37 | * The reader. |
38 | */ |
39 | public function getReader(); |
40 | |
41 | /** |
42 | * Set the GeoIP reader. |
43 | * |
44 | * @param \GeoIp2\Database\Reader $reader |
45 | * The reader. |
46 | */ |
47 | public function setReader(Reader $reader); |
48 | |
49 | /** |
50 | * Ensures the library is present. |
51 | * |
52 | * @param string $class_name |
53 | * The class name of the library. |
54 | * |
55 | * @return bool |
56 | * The device type. |
57 | */ |
58 | public function hasLibrary($class_name = 'GeoIp2\Database\Reader'): bool; |
59 | |
60 | /** |
61 | * Check if the extension is present. |
62 | * |
63 | * @param string $extension |
64 | * The extension. |
65 | * |
66 | * @return bool |
67 | * The device type. |
68 | */ |
69 | public function hasExtension($extension = 'maxminddb'): bool; |
70 | |
71 | } |