Code Duplication    Length = 14-16 lines in 2 locations

src/FileCache.php 2 locations

@@ 176-189 (lines=14) @@
173
        return $success;
174
    }
175
176
    public function getMultiple($keys, $default = null)
177
    {
178
        if (! is_array($keys) && ! $keys instanceof Traversable) {
179
            throw new InvalidArgumentException("keys must be either of type array or Traversable");
180
        }
181
182
        $values = [];
183
184
        foreach ($keys as $key) {
185
            $values[$key] = $this->get($key) ?: $default;
186
        }
187
188
        return $values;
189
    }
190
191
    public function setMultiple($values, $ttl = null)
192
    {
@@ 212-227 (lines=16) @@
209
        return $ok;
210
    }
211
212
    public function deleteMultiple($keys)
213
    {
214
        if (! is_array($keys) && ! $keys instanceof Traversable) {
215
            throw new InvalidArgumentException("keys must be either of type array or Traversable");
216
        }
217
218
        $ok = true;
219
220
        foreach ($keys as $key) {
221
            $this->validateKey($key);
222
223
            $ok = $ok && $this->delete($key);
224
        }
225
226
        return $ok;
227
    }
228
229
    public function has($key)
230
    {