Code Duplication    Length = 15-17 lines in 2 locations

src/Comodojo/Cache/Components/StackManager.php 2 locations

@@ 68-84 (lines=17) @@
65
66
    }
67
68
    public function remove($id) {
69
70
        if ( array_key_exists($id, $this->stack) && array_key_exists($id, $this->weights) ) {
71
72
            unset($this->stack[$id]);
73
74
            unset($this->weights[$id]);
75
76
            if ( array_key_exists($id, $this->failures) ) unset($this->failures[$id]);
77
78
        } else {
79
80
            throw new CacheException("Provider not registered");
81
82
        }
83
84
    }
85
86
    public function get($id) {
87
@@ 114-128 (lines=15) @@
111
112
    }
113
114
    public function enable($id) {
115
116
        if ( array_key_exists($id, $this->stack) && array_key_exists($id, $this->weights) ) {
117
118
            $this->stack[$id]->enable();
119
120
            if ( array_key_exists($id, $this->failures) ) unset($this->failures[$id]);
121
122
        } else {
123
124
            throw new CacheException("Provider not registered");
125
126
        }
127
128
    }
129
130
    public function getAll($enabled=true) {
131