Code Duplication    Length = 11-12 lines in 2 locations

Examples/Cache.php 1 location

@@ 37-47 (lines=11) @@
34
        $this->tmp = sys_get_temp_dir();
35
    }
36
37
    private function urlToPath($url)
38
    {
39
        $dir = $this->tmp . DIRECTORY_SEPARATOR . "OpenWeatherMapPHPAPI";
40
        if (!is_dir($dir)) {
41
            mkdir($dir);
42
        }
43
44
        $path = $dir . DIRECTORY_SEPARATOR . md5($url);
45
46
        return $path;
47
    }
48
49
    /**
50
     * @inheritdoc

tests/ExampleCacheTest.php 1 location

@@ 31-42 (lines=12) @@
28
    protected $seconds;
29
    protected $tmp;
30
31
    private function urlToPath($url)
32
    {
33
        $tmp = $this->tmp;
34
        $dir = $tmp . DIRECTORY_SEPARATOR . "OpenWeatherMapPHPAPI";
35
        if (!is_dir($dir)) {
36
            mkdir($dir);
37
        }
38
39
        $path = $dir . DIRECTORY_SEPARATOR . md5($url);
40
41
        return $path;
42
    }
43
44
    /**
45
     * @inheritdoc