Code Duplication    Length = 15-15 lines in 2 locations

src/Country/CountryLoader.php 2 locations

@@ 39-53 (lines=15) @@
36
     *
37
     * @return array
38
     */
39
    public function loadCountry($country)
40
    {
41
        if (!$country) {
42
            return;
43
        }
44
        $file = $this->path.DIRECTORY_SEPARATOR.sprintf(self::COUNTRY_FILE, $country);
45
        if (!file_exists($file)) {
46
            return;
47
        }
48
49
        return json_decode(
50
            file_get_contents($file),
51
            true
52
        );
53
    }
54
55
    /**
56
     * @param string $country
@@ 60-74 (lines=15) @@
57
     *
58
     * @return array
59
     */
60
    public function loadCountryPolygon($country)
61
    {
62
        if (!$country) {
63
            return;
64
        }
65
        $file = $this->path.DIRECTORY_SEPARATOR.sprintf(self::COUNTRY_POLYGON_FILE, $country);
66
        if (!file_exists($file)) {
67
            return;
68
        }
69
70
        return json_decode(
71
            file_get_contents($file),
72
            true
73
        );
74
    }
75
}
76