Code Duplication    Length = 23-23 lines in 2 locations

src/Comodojo/Cache/Manager.php 1 location

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

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, true);
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->void = new Void($this->logger);
69
70
        $this->logger->info("SimpleCache Manager online; pick mode ".$this->pick_mode);
71
72
    }
73
74
    public function addProvider(EnhancedSimpleCacheInterface $provider, $weight = 0) {
75