Code Duplication    Length = 10-13 lines in 2 locations

src/Model.php 2 locations

@@ 814-826 (lines=13) @@
811
812
        $created = self::$driver->createModel($this, $insertArray);
813
814
        if ($created) {
815
            // determine the model's new ID
816
            $this->getNewID();
817
818
            // store the persisted values to the in-memory cache
819
            $this->_unsaved = [];
820
            $this->refreshWith(array_replace($this->_ids, $insertArray));
821
822
            // dispatch the model.created event
823
            if (!$this->performDispatch(ModelEvent::CREATED)) {
824
                return false;
825
            }
826
        }
827
828
        return $created;
829
    }
@@ 1077-1086 (lines=10) @@
1074
1075
        $updated = self::$driver->updateModel($this, $updateArray);
1076
1077
        if ($updated) {
1078
            // store the persisted values to the in-memory cache
1079
            $this->_unsaved = [];
1080
            $this->refreshWith(array_replace($this->_values, $updateArray));
1081
1082
            // dispatch the model.updated event
1083
            if (!$this->performDispatch(ModelEvent::UPDATED)) {
1084
                return false;
1085
            }
1086
        }
1087
1088
        return $updated;
1089
    }