1 | <?php namespace Arcanedev\LaravelTracker\Detectors; |
||
12 | class GeoIpDetector implements GeoIpDetectorContract |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Properties |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * @var \Arcanedev\GeoIP\Contracts\GeoIP |
||
21 | */ |
||
22 | private $geoIp; |
||
23 | |||
24 | /* ----------------------------------------------------------------- |
||
25 | | Constructor |
||
26 | | ----------------------------------------------------------------- |
||
27 | */ |
||
28 | |||
29 | /** |
||
30 | * GeoIpDetector constructor. |
||
31 | * |
||
32 | * @param \Arcanedev\GeoIP\Contracts\GeoIP $geoIp |
||
33 | */ |
||
34 | 9 | public function __construct(GeoIP $geoIp) |
|
38 | |||
39 | /* ----------------------------------------------------------------- |
||
40 | | Main Methods |
||
41 | | ----------------------------------------------------------------- |
||
42 | */ |
||
43 | |||
44 | /** |
||
45 | * Get the geoip data. |
||
46 | * |
||
47 | * @param string $ipAddress |
||
48 | * |
||
49 | * @return array|null |
||
50 | */ |
||
51 | 9 | public function search($ipAddress) |
|
64 | |||
65 | /* ----------------------------------------------------------------- |
||
66 | | Other Methods |
||
67 | | ----------------------------------------------------------------- |
||
68 | */ |
||
69 | |||
70 | /** |
||
71 | * Render the data. |
||
72 | * |
||
73 | * @param \Arcanedev\GeoIP\Location $location |
||
74 | * |
||
75 | * @return array |
||
76 | */ |
||
77 | 9 | private function transform($location) |
|
93 | } |
||
94 |