Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
45 | protected function deltas(array $a, array $b): array |
||
46 | { |
||
47 | $count = count($a); |
||
48 | |||
49 | if ($count !== count($b)) { |
||
50 | throw new InvalidArgumentException('Size of given arrays does not match'); |
||
51 | } |
||
52 | |||
53 | $deltas = []; |
||
54 | |||
55 | for ($i = 0; $i < $count; $i++) { |
||
56 | $deltas[] = abs($a[$i] - $b[$i]); |
||
57 | } |
||
58 | |||
59 | return $deltas; |
||
60 | } |
||
61 | } |
||
62 |