Code Duplication    Length = 7-7 lines in 4 locations

src/Xtools/UserRepository.php 4 locations

@@ 309-315 (lines=7) @@
306
            $start = date('Ymd000000', strtotime($start));
307
            $condBegin = 'AND rev_timestamp >= :start ';
308
        }
309
        if (!empty($end)) {
310
            $cacheKey .= '.' . $end;
311
312
            // For the query
313
            $end = date('Ymd235959', strtotime($end));
314
            $condEnd = 'AND rev_timestamp <= :end ';
315
        }
316
317
        if ($this->cache->hasItem($cacheKey)) {
318
            return $this->cache->getItem($cacheKey)->get();
@@ 383-389 (lines=7) @@
380
            $start = date('Ymd000000', strtotime($start));
381
            $condBegin = 'AND rev_timestamp >= :start ';
382
        }
383
        if (!empty($end)) {
384
            $cacheKey .= '.' . $end;
385
386
            // For the query
387
            $end = date('Ymd235959', strtotime($end));
388
            $condEnd = 'AND rev_timestamp <= :end ';
389
        }
390
391
        if ($this->cache->hasItem($cacheKey)) {
392
            return $this->cache->getItem($cacheKey)->get();
@@ 486-492 (lines=7) @@
483
            $start = date('Ymd000000', strtotime($start));
484
            $condBegin = 'AND revs.rev_timestamp >= :start ';
485
        }
486
        if (!empty($end)) {
487
            $cacheKey .= '.' . $end;
488
489
            // For the query
490
            $end = date('Ymd235959', strtotime($end));
491
            $condEnd = 'AND revs.rev_timestamp <= :end ';
492
        }
493
494
        if ($this->cache->hasItem($cacheKey)) {
495
            return $this->cache->getItem($cacheKey)->get();
@@ 593-599 (lines=7) @@
590
            $start = date('Ymd000000', strtotime($start));
591
            $condBegin = 'AND rev_timestamp >= :start ';
592
        }
593
        if (!empty($end)) {
594
            $cacheKey .= '.' . $end;
595
596
            // For the query
597
            $end = date('Ymd235959', strtotime($end));
598
            $condEnd = 'AND rev_timestamp <= :end ';
599
        }
600
601
        if ($this->cache->hasItem($cacheKey)) {
602
            return $this->cache->getItem($cacheKey)->get();