TOperations::removeMulti()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 4
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 7
rs 10
ccs 5
cts 5
cp 1
crap 3
1
<?php
2
3
namespace kalanis\kw_storage\Storage\Target;
4
5
6
/**
7
 * Trait TOperations
8
 * @package kalanis\kw_storage\Storage\Target
9
 * Operations over storages - what is similar
10
 */
11
trait TOperations
12
{
13
    abstract public function exists(string $key): bool;
14
15
    abstract public function remove(string $key): bool;
16
17 4
    public function removeMulti(array $keys): array
18
    {
19 4
        $result = [];
20 4
        foreach ($keys as $index => $key) {
21 4
            $result[$index] = $this->exists($key) ? $this->remove($key) : false;
22
        }
23 4
        return $result;
24
    }
25
}
26