22
33namespace PulkitJalan \GeoIP \Drivers ;
44
5- use PulkitJalan \GeoIP \Exceptions \InvalidCredentialsException ;
6- use PulkitJalan \GeoIP \Exceptions \InvalidDatabaseException ;
5+ use GeoIp2 \Database \Reader ;
76use GeoIp2 \Exception \AddressNotFoundException ;
87use GeoIp2 \WebService \Client ;
9- use GeoIp2 \Database \Reader ;
8+ use PulkitJalan \GeoIP \Exceptions \InvalidCredentialsException ;
9+ use PulkitJalan \GeoIP \Exceptions \InvalidDatabaseException ;
1010
1111class MaxmindDriver extends AbstractGeoIPDriver
1212{
@@ -26,9 +26,10 @@ public function __construct(array $config)
2626 }
2727
2828 /**
29- * Get array of data using Maxmind
29+ * Get array of data using Maxmind.
30+ *
31+ * @param string $ip
3032 *
31- * @param string $ip
3233 * @return array
3334 */
3435 public function get ($ ip )
@@ -40,23 +41,24 @@ public function get($ip)
4041 }
4142
4243 return [
43- 'city ' => $ data ->city ->name ,
44- 'country ' => $ data ->country ->name ,
44+ 'city ' => $ data ->city ->name ,
45+ 'country ' => $ data ->country ->name ,
4546 'countryCode ' => $ data ->country ->isoCode ,
46- 'latitude ' => $ data ->location ->latitude ,
47- 'longitude ' => $ data ->location ->longitude ,
48- 'region ' => $ data ->mostSpecificSubdivision ->name ,
49- 'regionCode ' => $ data ->mostSpecificSubdivision ->isoCode ,
50- 'timezone ' => $ data ->location ->timeZone ,
51- 'postalCode ' => $ data ->postal ->code ,
47+ 'latitude ' => $ data ->location ->latitude ,
48+ 'longitude ' => $ data ->location ->longitude ,
49+ 'region ' => $ data ->mostSpecificSubdivision ->name ,
50+ 'regionCode ' => $ data ->mostSpecificSubdivision ->isoCode ,
51+ 'timezone ' => $ data ->location ->timeZone ,
52+ 'postalCode ' => $ data ->postal ->code ,
5253 ];
5354 }
5455
5556 /**
56- * Create the maxmind driver based on config
57+ * Create the maxmind driver based on config.
5758 *
58- * @return mixed
5959 * @throws \PulkitJalan\GeoIP\Exceptions\InvalidCredentialsException
60+ *
61+ * @return mixed
6062 */
6163 protected function create ()
6264 {
@@ -74,10 +76,11 @@ protected function create()
7476 }
7577
7678 /**
77- * Create the maxmind web client
79+ * Create the maxmind web client.
7880 *
79- * @return \GeoIp2\WebService\Client
8081 * @throws \PulkitJalan\GeoIP\Exceptions\InvalidCredentialsException
82+ *
83+ * @return \GeoIp2\WebService\Client
8184 */
8285 protected function createWebClient ()
8386 {
@@ -93,10 +96,11 @@ protected function createWebClient()
9396 }
9497
9598 /**
96- * Create the maxmind database reader
99+ * Create the maxmind database reader.
97100 *
98- * @return \GeoIp2\Database\Reader
99101 * @throws \PulkitJalan\GeoIP\Exceptions\InvalidCredentialsException
102+ *
103+ * @return \GeoIp2\Database\Reader
100104 */
101105 protected function createDatabase ()
102106 {
0 commit comments