ArraysComparer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCompared() 0 10 3
1
<?php
2
3
namespace Locastic\Loggastic\Util;
4
5
final class ArraysComparer
6
{
7
    public static function getCompared(array $currentData, array $previousData): ?array
8
    {
9
        $previousValues = ArrayDiff::arrayDiffRecursive($previousData, $currentData);
10
        $currentValues = ArrayDiff::arrayDiffRecursive($currentData, $previousData);
11
12
        if (!$previousValues && !$currentValues) {
13
            return null;
14
        }
15
16
        return ['previousValues' => $previousValues, 'currentValues' => $currentValues];
17
    }
18
}
19