IntersectKey   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 12
ccs 3
cts 3
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A intersectKey() 0 5 2
1
<?php
2
3
namespace Cocur\Chain\Link;
4
5
use Cocur\Chain\Chain;
6
7
/**
8
 * IntersectKey.
9
 *
10
 * @author    Florian Eckerstorfer
11
 * @copyright 2015-2018 Florian Eckerstorfer
12
 */
13
trait IntersectKey
14
{
15
    /**
16
     * @param Chain|array $array
17
     *
18
     * @return self
19
     */
20 2
    public function intersectKey($array): self
21
    {
22 2
        $this->array = array_intersect_key($this->array, $array instanceof Chain ? $array->array : $array);
23
24 2
        return $this;
25
    }
26
}
27