Code Duplication    Length = 6-7 lines in 2 locations

system/Inji/Model.php 2 locations

@@ 1145-1150 (lines=6) @@
1142
            $storage[$classPath[1]] = [];
1143
        }
1144
        if ($id) {
1145
            foreach ($storage[$classPath[1]] as $key => $item) {
1146
                if ($item[$col] == $id) {
1147
                    $storage[$classPath[1]][$key] = $this->_params;
1148
                    break;
1149
                }
1150
            }
1151
        } else {
1152
            $id = !empty($storage['scheme'][$classPath[1]]['ai']) ? $storage['scheme'][$classPath[1]]['ai'] : 1;
1153
            $this->$col = $id;
@@ 1347-1353 (lines=7) @@
1344
        if (empty($storage[$classPath[1]])) {
1345
            $storage[$classPath[1]] = [];
1346
        }
1347
        foreach ($storage[$classPath[1]] as $key => $item) {
1348
1349
            if ($item[$col] == $id) {
1350
                unset($storage[$classPath[1]][$key]);
1351
                break;
1352
            }
1353
        }
1354
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1355
            $moduleConfig['storage'][$appType] = $storage;
1356
        } else {