Code Duplication    Length = 4-4 lines in 2 locations

src/Cache/FileCache.php 2 locations

@@ 28-31 (lines=4) @@
25
    public function __construct($cache_dir)
26
    {
27
        $this->cache_dir = $cache_dir;
28
        if (!is_dir($cache_dir)) {
29
            $make_dir_result = mkdir($cache_dir, 0755, true);
30
            if ($make_dir_result === false) throw new \Exception('Cannot create the cache directory');
31
        }
32
    }
33
34
@@ 93-96 (lines=4) @@
90
        $cache_file = $this->path($key);
91
        if (!file_exists($cache_file)) {
92
            $directory = dirname($cache_file);
93
            if (!is_dir($directory)) {
94
                $make_dir_result = mkdir($directory, 0755, true);
95
                if ($make_dir_result === false) return false;
96
            }
97
            $create_result = touch($cache_file);
98
            if ($create_result === false) return false;
99
        }