Passed
Push — master ( 2f6942...d6d802 )
by Chris
28:11
created

Contrast::remix()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 13
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace WebTheory\Collection\Fusion;
4
5
use WebTheory\Collection\Contracts\ArrayFusionInterface;
6
use WebTheory\Collection\Fusion\Abstracts\AbstractArrayFusion;
7
8
class Contrast extends AbstractArrayFusion implements ArrayFusionInterface
9
{
10 21
    public function remix(array ...$collections): array
11
    {
12 21
        $fusion = array_shift($collections);
13 21
        $callback = $this->getComparisonCallback();
14
15 21
        foreach ($collections as $collection) {
16 21
            $fusion = array_merge(
17 21
                array_udiff($fusion, $collection, $callback),
18 21
                array_udiff($collection, $fusion, $callback)
19
            );
20
        }
21
22 21
        return $fusion;
23
    }
24
}
25