Code Duplication    Length = 23-23 lines in 2 locations

src/Comodojo/Cache/Drivers/FilesystemGhost.php 1 location

@@ 98-120 (lines=23) @@
95
96
    }
97
98
    public function clear($namespace = null) {
99
100
        $file_list;
101
102
        $result = [];
103
104
        if ( $namespace === null ) {
105
106
            $file_list = glob($this->cache_folder."*.{cache,expire}", GLOB_BRACE);
107
108
        } else {
109
110
            $file_list = glob($this->cache_folder."*-$namespace.{cache,expire}", GLOB_BRACE);
111
112
        }
113
114
        if ( empty($file_list) ) return true;
115
116
        foreach ( $file_list as $file ) $result[] = unlink($file);
117
118
        return !in_array(false, $result);
119
120
    }
121
122
    // public function getMultiple(array $keys, $namespace) {
123
    //

src/Comodojo/Cache/Drivers/FilesystemXattr.php 1 location

@@ 99-121 (lines=23) @@
96
97
    }
98
99
    public function clear($namespace = null) {
100
101
        $file_list;
102
103
        $result = [];
104
105
        if ( $namespace === null ) {
106
107
            $file_list = glob($this->cache_folder."*.cache");
108
109
        } else {
110
111
            $file_list = glob($this->cache_folder."*-$namespace.cache");
112
113
        }
114
115
        if ( empty($file_list) ) return true;
116
117
        foreach ( $file_list as $file ) $result[] = unlink($file);
118
119
        return !in_array(false, $result);
120
121
    }
122
123
    public function getMultiple(array $keys, $namespace) {
124