Contrast::remix()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 13
ccs 9
cts 9
cp 1
rs 10
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 10
    public function remix(array ...$collections): array
11
    {
12 10
        $fusion = array_shift($collections);
13 10
        $callback = $this->getComparisonCallback();
14
15 10
        foreach ($collections as $collection) {
16 10
            $fusion = array_merge(
17 10
                array_udiff($fusion, $collection, $callback),
18 10
                array_udiff($collection, $fusion, $callback)
19 10
            );
20
        }
21
22 10
        return $fusion;
23
    }
24
}
25