Code Duplication    Length = 8-10 lines in 4 locations

system/Inji/Model.php 4 locations

@@ 841-848 (lines=8) @@
838
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
839
        }
840
        $appType = App::$cur->type;
841
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
842
            if (!empty($options['appType'])) {
843
                $appType = $options['appType'];
844
            }
845
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
846
        } else {
847
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
848
        }
849
        if (!empty($storage[$classPath[1]])) {
850
            $items = $storage[$classPath[1]];
851
            $class = get_called_class();
@@ 880-889 (lines=10) @@
877
        } else {
878
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
879
        }
880
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
881
            if (empty($options['appType'])) {
882
                $appType = App::$cur->type;
883
            } else {
884
                $appType = $options['appType'];
885
            }
886
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
887
        } else {
888
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
889
        }
890
        if (!empty($storage[$classPath[1]])) {
891
            $items = [];
892
            $class = get_called_class();
@@ 1168-1177 (lines=10) @@
1165
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1166
        }
1167
1168
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1169
            if (empty($options['appType'])) {
1170
                $appType = App::$cur->type;
1171
            } else {
1172
                $appType = $options['appType'];
1173
            }
1174
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1175
        } else {
1176
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1177
        }
1178
        if (empty($storage[$classPath[1]])) {
1179
            $storage[$classPath[1]] = [];
1180
        }
@@ 1371-1380 (lines=10) @@
1368
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1369
        }
1370
1371
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1372
            if (empty($options['appType'])) {
1373
                $appType = App::$cur->type;
1374
            } else {
1375
                $appType = $options['appType'];
1376
            }
1377
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1378
        } else {
1379
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1380
        }
1381
        if (empty($storage[$classPath[1]])) {
1382
            $storage[$classPath[1]] = [];
1383
        }