Code Duplication    Length = 12-12 lines in 2 locations

Examples/Cache.php 1 location

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