Code Duplication    Length = 10-13 lines in 2 locations

src/Model.php 2 locations

@@ 844-856 (lines=13) @@
841
842
        $created = self::$driver->createModel($this, $insertArray);
843
844
        if ($created) {
845
            // determine the model's new ID
846
            $this->getNewID();
847
848
            // store the persisted values to the in-memory cache
849
            $this->_unsaved = [];
850
            $this->refreshWith(array_replace($this->_ids, $insertArray));
851
852
            // dispatch the model.created event
853
            if (!$this->performDispatch(ModelEvent::CREATED, $usesTransactions)) {
854
                return false;
855
            }
856
        }
857
858
        // commit the transaction, if used
859
        if ($usesTransactions) {
@@ 1118-1127 (lines=10) @@
1115
1116
        $updated = self::$driver->updateModel($this, $updateArray);
1117
1118
        if ($updated) {
1119
            // store the persisted values to the in-memory cache
1120
            $this->_unsaved = [];
1121
            $this->refreshWith(array_replace($this->_values, $updateArray));
1122
1123
            // dispatch the model.updated event
1124
            if (!$this->performDispatch(ModelEvent::UPDATED, $usesTransactions)) {
1125
                return false;
1126
            }
1127
        }
1128
1129
        // commit the transaction, if used
1130
        if ($usesTransactions) {