Code Duplication    Length = 5-5 lines in 2 locations

src/Repository.php 2 locations

@@ 380-384 (lines=5) @@
377
            $tuple = $this->getTuple($instance);
378
            $update = [];
379
380
            foreach ($tuple as $i => $v) {
381
                if (!array_key_exists($i, $this->original[$key]) || $v !== $this->original[$key][$i]) {
382
                    $update[$i] = $v;
383
                }
384
            }
385
386
            if (!count($update)) {
387
                return $instance;
@@ 401-405 (lines=5) @@
398
            $tuple = $this->getTuple($instance);
399
            $update = [];
400
401
            foreach ($tuple as $i => $v) {
402
                if (!array_key_exists($i, $this->original[$key]) || $v !== $this->original[$key][$i]) {
403
                    $update[$i] = $v;
404
                }
405
            }
406
407
            if (!count($update)) {
408
                return $instance;