Code Duplication    Length = 9-10 lines in 2 locations

system/modules/Db/objects/InjiStorage/Result.php 2 locations

@@ 37-46 (lines=10) @@
34
        $item = $this->result[$this->curKey];
35
        next($this->result);
36
        $this->curKey = key($this->result);
37
        if ($className) {
38
            /**
39
             * @var Model
40
             */
41
            $item = new $className($item);
42
            $item->connectionName = $this->query->connection->dbInstance;
43
            $item->dbOptions = $this->query->dbOptions;
44
            $item->app = $this->query->connection->dbInstance->app;
45
            return $item;
46
        }
47
        return $item;
48
    }
49
@@ 56-64 (lines=9) @@
53
        }
54
        $items = [];
55
        foreach ($this->result as $item) {
56
            if ($className) {
57
                /**
58
                 * @var Model
59
                 */
60
                $item = new $className($item);
61
                $item->connectionName = $this->query->connection->dbInstance;
62
                $item->dbOptions = $this->query->dbOptions;
63
                $item->app = $this->query->connection->dbInstance->app;
64
            }
65
            if ($keyCol) {
66
                $key = $className ? $item->$keyCol : $item[$keyCol];
67
                $items[$key] = $item;