Code Duplication    Length = 19-19 lines in 3 locations

src/Comodojo/Cache/Manager.php 1 location

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

src/Comodojo/SimpleCache/Manager.php 2 locations

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