Code Duplication    Length = 14-14 lines in 2 locations

system/modules/Migrations/objects/Parser/Object/Value.php 1 location

@@ 31-44 (lines=14) @@
28
          case'selfMethod':
29
            $type = $this->model->{$col['selfMethod']}();
30
            if (is_array($type)) {
31
              if (strpos($type['relation'], ':')) {
32
                $relationPath = explode(':', $type['relation']);
33
                $relationName = array_pop($relationPath);
34
                $item = $this->model;
35
                foreach ($relationPath as $path) {
36
                  $item = $item->$path;
37
                }
38
                $itemModel = get_class($item);
39
                $relation = $itemModel::getRelation($relationName);
40
                $sourceModel = $relation['model'];
41
              } else {
42
                $relation = $modelName::getRelation($type['relation']);
43
                $sourceModel = $relation['model'];
44
              }
45
              $objectId = \App::$cur->migrations->findObject((string) $value, $sourceModel);
46
              if ($objectId) {
47
                $value = $objectId->object_id;

system/Inji/Model.php 1 location

@@ 292-305 (lines=14) @@
289
          case'selfMethod':
290
            $type = $item->{$colInfo['colParams']['selfMethod']}();
291
            if (is_array($type)) {
292
              if (strpos($type['relation'], ':')) {
293
                $relationPath = explode(':', $type['relation']);
294
                $relationName = array_pop($relationPath);
295
                $curItem = $item;
296
                foreach ($relationPath as $path) {
297
                  $curItem = $curItem->$path;
298
                }
299
                $itemModel = get_class($curItem);
300
                $relation = $itemModel::getRelation($relationName);
301
                $sourceModel = $relation['model'];
302
              } else {
303
                $relation = static::getRelation($type['relation']);
304
                $sourceModel = $relation['model'];
305
              }
306
              $inputType = 'select';
307
              $value = $sourceModel::get($item->$colName);
308
              if ($value) {