Code Duplication    Length = 8-10 lines in 4 locations

system/Inji/Model.php 4 locations

@@ 828-835 (lines=8) @@
825
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
826
        }
827
        $appType = App::$cur->type;
828
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
829
            if (!empty($options['appType'])) {
830
                $appType = $options['appType'];
831
            }
832
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
833
        } else {
834
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
835
        }
836
        if (!empty($storage[$classPath[1]])) {
837
            $items = $storage[$classPath[1]];
838
            $class = get_called_class();
@@ 867-876 (lines=10) @@
864
        } else {
865
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
866
        }
867
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
868
            if (empty($options['appType'])) {
869
                $appType = App::$cur->type;
870
            } else {
871
                $appType = $options['appType'];
872
            }
873
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
874
        } else {
875
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
876
        }
877
        if (!empty($storage[$classPath[1]])) {
878
            $items = [];
879
            $class = get_called_class();
@@ 1150-1159 (lines=10) @@
1147
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1148
        }
1149
1150
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1151
            if (empty($options['appType'])) {
1152
                $appType = App::$cur->type;
1153
            } else {
1154
                $appType = $options['appType'];
1155
            }
1156
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1157
        } else {
1158
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1159
        }
1160
        if (empty($storage[$classPath[1]])) {
1161
            $storage[$classPath[1]] = [];
1162
        }
@@ 1353-1362 (lines=10) @@
1350
            $moduleConfig = Config::module($classPath[0], strpos(static::$storage['type'], 'system') !== false);
1351
        }
1352
1353
        if (!empty($moduleConfig['storage']['appTypeSplit'])) {
1354
            if (empty($options['appType'])) {
1355
                $appType = App::$cur->type;
1356
            } else {
1357
                $appType = $options['appType'];
1358
            }
1359
            $storage = !empty($moduleConfig['storage'][$appType]) ? $moduleConfig['storage'][$appType] : [];
1360
        } else {
1361
            $storage = !empty($moduleConfig['storage']) ? $moduleConfig['storage'] : [];
1362
        }
1363
        if (empty($storage[$classPath[1]])) {
1364
            $storage[$classPath[1]] = [];
1365
        }