Code Duplication    Length = 8-10 lines in 4 locations

system/Inji/Model.php 4 locations

@@ 809-816 (lines=8) @@
806
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
807
        }
808
        $appType = App::$cur->type;
809
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
810
            if (!empty($options['appType'])) {
811
                $appType = $options['appType'];
812
            }
813
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
814
        } else {
815
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
816
        }
817
        if (!empty($storage[$classPath[1]])) {
818
            $items = $storage[$classPath[1]];
819
            $class = get_called_class();
@@ 848-857 (lines=10) @@
845
        } else {
846
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
847
        }
848
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
849
            if (empty($options['appType'])) {
850
                $appType = App::$cur->type;
851
            } else {
852
                $appType = $options['appType'];
853
            }
854
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
855
        } else {
856
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
857
        }
858
        if (!empty($storage[$classPath[1]])) {
859
            $items = [];
860
            $class = get_called_class();
@@ 1131-1140 (lines=10) @@
1128
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1129
        }
1130
1131
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1132
            if (empty($options['appType'])) {
1133
                $appType = App::$cur->type;
1134
            } else {
1135
                $appType = $options['appType'];
1136
            }
1137
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1138
        } else {
1139
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1140
        }
1141
        if (empty($storage[$classPath[1]])) {
1142
            $storage[$classPath[1]] = [];
1143
        }
@@ 1334-1343 (lines=10) @@
1331
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1332
        }
1333
1334
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1335
            if (empty($options['appType'])) {
1336
                $appType = App::$cur->type;
1337
            } else {
1338
                $appType = $options['appType'];
1339
            }
1340
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1341
        } else {
1342
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1343
        }
1344
        if (empty($storage[$classPath[1]])) {
1345
            $storage[$classPath[1]] = [];
1346
        }