GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

MultiCacheTrait   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 8
c 2
b 1
f 0
lcom 0
cbo 0
dl 0
loc 57
ccs 18
cts 18
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
set() 0 1 ?
get() 0 1 ?
delete() 0 1 ?
A setItems() 0 9 3
A getItems() 0 9 2
A deleteItems() 0 9 3
1
<?php
2
3
namespace Cmp\Cache\Traits;
4
5
/**
6
 * Interface MultiCacheTrait
7
 *
8
 * Apply to a non multi cache backend to convert it
9
 *
10
 * @package Cmp\Cache
11
 */
12
trait MultiCacheTrait
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    abstract public function set($key, $item, $timeToLive = null);
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    abstract public function get($key, $default = null);
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    abstract public function delete($key);
28
29
    
30
    /**
31
     * {@inheritdoc}
32
     */
33 1
    public function setItems(array $items, $timeToLive = null)
34
    {
35 1
        $success = true;
36 1
        foreach ($items as $key => $item) {
37 1
            $success = $success && $this->set($key, $item, $timeToLive);
38 1
        }
39
40 1
        return $success;
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46 1
    public function getItems(array $keys)
47
    {
48 1
        $items = [];
49 1
        foreach ($keys as $key) {
50 1
            $items[$key] = $this->get($key);
51 1
        }
52
53 1
        return $items;
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59 1
    public function deleteItems(array $keys)
60
    {
61 1
        $success = true;
62 1
        foreach ($keys as $key) {
63 1
            $success = $success && $this->delete($key);
64 1
        }
65
66 1
        return $success;
67
    }
68
}
69