Code Duplication    Length = 21-21 lines in 2 locations

src/Drivers/IpInfo.php 1 location

@@ 21-41 (lines=21) @@
18
    /**
19
     * {@inheritdoc}
20
     */
21
    protected function hydrate(Position $position, Fluent $location)
22
    {
23
        $position->countryCode = $location->country;
24
        $position->regionName = $location->region;
25
        $position->cityName = $location->city;
26
        $position->zipCode = $location->postal;
27
28
        if ($location->loc) {
29
            $coords = explode(',', $location->loc);
30
31
            if (array_key_exists(0, $coords)) {
32
                $position->latitude = $coords[0];
33
            }
34
35
            if (array_key_exists(1, $coords)) {
36
                $position->longitude = $coords[1];
37
            }
38
        }
39
40
        return $position;
41
    }
42
43
    /**
44
     * {@inheritdoc}

src/Drivers/IpInfoPremium.php 1 location

@@ 20-40 (lines=21) @@
17
        return config('location.ipinfo');
18
    }
19
20
    protected function hydrate(Position $position, Fluent $location)
21
    {
22
        $position->countryCode = $location->country;
23
        $position->regionName = $location->region;
24
        $position->cityName = $location->city;
25
        $position->zipCode = $location->postal;
26
27
        if ($location->loc) {
28
            $coords = explode(',', $location->loc);
29
30
            if (array_key_exists(0, $coords)) {
31
                $position->latitude = $coords[0];
32
            }
33
34
            if (array_key_exists(1, $coords)) {
35
                $position->longitude = $coords[1];
36
            }
37
        }
38
39
        return $position;
40
    }
41
42
    protected function process($ip)
43
    {