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::deleteItems()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
ccs 6
cts 6
cp 1
cc 3
eloc 5
nc 3
nop 1
crap 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