Code Duplication    Length = 23-23 lines in 2 locations

src/Comodojo/Cache/Manager.php 1 location

@@ 54-76 (lines=23) @@
51
52
    protected $selected;
53
54
    public function __construct(
55
        $pick_mode = null,
56
        LoggerInterface $logger = null,
57
        $align_cache = true,
58
        $flap_interval = null
59
    ) {
60
61
        $this->pick_mode = DataFilter::filterInteger($pick_mode, 1, 6, self::DEFAULT_PICK_MODE);
62
63
        $this->align_cache = DataFilter::filterBoolean($align_cache, false);
64
65
        $stack = new ArrayObject([]);
66
67
        $this->stack = new StackManager($stack->getIterator());
68
        $this->stack->setFlapInterval($flap_interval);
69
70
        parent::__construct($logger);
71
72
        $this->vacuum = new Vacuum([], $this->logger);
73
74
        $this->logger->debug("Cache manager online; pick mode ".$this->pick_mode);
75
76
    }
77
78
    public function addProvider(EnhancedCacheItemPoolInterface $provider, $weight = 0) {
79

src/Comodojo/SimpleCache/Manager.php 1 location

@@ 50-72 (lines=23) @@
47
48
    protected $selected;
49
50
    public function __construct(
51
        $pick_mode = null,
52
        LoggerInterface $logger = null,
53
        $align_cache = true,
54
        $flap_interval = null
55
    ) {
56
57
        $this->pick_mode = DataFilter::filterInteger($pick_mode, 1, 6, self::DEFAULT_PICK_MODE);
58
59
        $this->align_cache = DataFilter::filterBoolean($align_cache, false);
60
61
        $stack = new ArrayObject([]);
62
63
        $this->stack = new StackManager($stack->getIterator());
64
        $this->stack->setFlapInterval($flap_interval);
65
66
        parent::__construct($logger);
67
68
        $this->vacuum = new Vacuum([], $this->logger);
69
70
        $this->logger->debug("SimpleCache Manager online; pick mode ".$this->pick_mode);
71
72
    }
73
74
    public function addProvider(EnhancedSimpleCacheInterface $provider, $weight = 0) {
75