Code Duplication    Length = 19-19 lines in 3 locations

src/Comodojo/Cache/Manager.php 1 location

@@ 96-114 (lines=19) @@
93
94
    }
95
96
    public function deleteItem($key) {
97
98
        if ( iterator_count($this->stack) == 0 ) return $this->vacuum->deleteItem($key);
99
100
        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
101
            return $this->selectProvider()->deleteItem($key);
102
        }
103
104
        $result = [];
105
106
        foreach ( $this->stack as $provider ) {
107
108
            $result[] = $provider[0]->deleteItem($key);
109
110
        }
111
112
        return !in_array(false, $result);
113
114
    }
115
116
    public function save(CacheItemInterface $item) {
117

src/Comodojo/SimpleCache/Manager.php 2 locations

@@ 113-131 (lines=19) @@
110
111
    }
112
113
    public function delete($key) {
114
115
        if ( iterator_count($this->stack) == 0 ) return $this->vacuum->delete($key);
116
117
        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
118
            return $this->selectProvider()->delete($key);
119
        }
120
121
        $result = [];
122
123
        foreach ( $this->stack as $provider ) {
124
125
            $result[] = $provider[0]->delete($key);
126
127
        }
128
129
        return !in_array(false, $result);
130
131
    }
132
133
    public function getMultiple($keys, $default = null) {
134
@@ 159-177 (lines=19) @@
156
157
    }
158
159
    public function deleteMultiple($keys) {
160
161
        if ( iterator_count($this->stack) == 0 ) return $this->vacuum->deleteMultiple($keys);
162
163
        if ( $this->align_cache === false && $this->pick_mode < 5 ) {
164
            return $this->selectProvider()->deleteMultiple($keys);
165
        }
166
167
        $result = [];
168
169
        foreach ( $this->stack as $provider ) {
170
171
            $result[] = $provider[0]->deleteMultiple($keys);
172
173
        }
174
175
        return !in_array(false, $result);
176
177
    }
178
179
    public function has($key) {
180