Code Duplication    Length = 23-23 lines in 2 locations

src/Comodojo/Cache/Manager.php 1 location

@@ 254-276 (lines=23) @@
251
252
            return new Item($key);
253
254
        } else {
255
256
            foreach ($this->stack as $provider) {
257
258
                $item = $provider[0]->hasItem($key);
259
260
                if ( $item === true ) {
261
262
                    // selected provider has no sense in this case
263
                    $this->selected = $provider[0];
264
265
                    return true;
266
267
                }
268
269
            }
270
271
            // selected provider has no sense in this case
272
            $this->selected = $this->vacuum;
273
274
            return false;
275
276
        }
277
278
    }
279

src/Comodojo/SimpleCache/Manager.php 1 location

@@ 353-375 (lines=23) @@
350
351
            return $this->vacuum->getMultiple($key, $default);
352
353
        } else {
354
355
            foreach ($this->stack as $provider) {
356
357
                $item = $provider[0]->has($key);
358
359
                if ( $item === true ) {
360
361
                    // selected provider has no sense in this case
362
                    $this->selected = $provider[0];
363
364
                    return true;
365
366
                }
367
368
            }
369
370
            // selected provider has no sense in this case
371
            $this->selected = $this->vacuum;
372
373
            return false;
374
375
        }
376
377
    }
378