Code Duplication    Length = 3-3 lines in 2 locations

src/Repository.php 2 locations

@@ 195-197 (lines=3) @@
192
            unset($this->persisted[$key]);
193
194
            $pk = [];
195
            foreach($this->space->getPrimaryIndex()->parts as $part) {
196
                $pk[] = $this->original[$key][$part[0]];
197
            }
198
            foreach($this->space->getMapper()->getPlugins() as $plugin) {
199
                $plugin->beforeRemove($instance, $this->space);
200
            }
@@ 251-253 (lines=3) @@
248
            }
249
250
            $pk = [];
251
            foreach($this->space->getPrimaryIndex()->parts as $part) {
252
                $pk[] = $this->original[$key][$part[0]];
253
            }
254
255
            foreach($this->space->getMapper()->getPlugins() as $plugin) {
256
                $plugin->beforeCreate($instance, $this->space);