| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| 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 | { |
||
| 57 | $deltas[] = abs($a[$i] - $b[$i]); |
||
| 58 | } |
||
| 59 | |||
| 60 | return $deltas; |
||
| 61 | } |
||
| 62 | } |
||
| 63 |