Code Duplication    Length = 4-4 lines in 2 locations

src/Repository.php 2 locations

@@ 58-61 (lines=4) @@
55
                    }
56
                }
57
            }
58
            if (!$this->type->hasProperty($k)) {
59
                $name = $this->type->getName();
60
                throw new Exception("Unknown property $name.$k");
61
            }
62
            $data[$k] = $this->type->encodeProperty($k, $v);
63
        }
64
        foreach ($this->type->getRequiredProperties() as $property) {
@@ 265-268 (lines=4) @@
262
            }
263
264
            foreach ($changes as $k => $v) {
265
                if (!$this->type->hasProperty($k)) {
266
                    $name = $this->type->getName();
267
                    throw new Exception("Unknown property $name.$k");
268
                }
269
            }
270
271
            if (count($changes)) {