Code Duplication    Length = 23-23 lines in 2 locations

src/Comodojo/Cache/Manager.php 1 location

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

src/Comodojo/SimpleCache/Manager.php 1 location

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