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