Completed
Push — master ( e90e68...49a516 )
by Marco
04:59 queued 02:33
created

StackManager::remove()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 5

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 13
loc 13
ccs 2
cts 2
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 2
1
<?php namespace Comodojo\SimpleCache\Components;
2
3
use \Comodojo\Cache\Components\AbstractStackManager;
4
use \Comodojo\SimpleCache\Interfaces\EnhancedSimpleCacheInterface;
5
use \Comodojo\Exception\SimpleCacheException;
6
use \Exception;
7
8
/**
9
 *
10
 * @package     Comodojo Spare Parts
11
 * @author      Marco Giovinazzi <[email protected]>
12
 * @license     MIT
13
 *
14
 * LICENSE:
15
 *
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
 * THE SOFTWARE.
23
 */
24
25 View Code Duplication
class StackManager extends AbstractStackManager {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
27 34
    public function add(EnhancedSimpleCacheInterface $provider, $weight) {
28
29 34
        return $this->genericAdd($provider, $weight);
30
31
    }
32
33 1
    public function remove($id) {
34
35
        try {
36
37 1
            return parent::remove($id);
38
39
        } catch (Exception $e) {
40
41
            throw new SimpleCacheException($e->getMessage());
42
43
        }
44
45
    }
46
47 1
    public function get($id) {
48
49
        try {
50
51 1
            return parent::get($id);
52
53
        } catch (Exception $e) {
54
55
            throw new SimpleCacheException($e->getMessage());
56
57
        }
58
59
    }
60
61
}
62