Code Duplication    Length = 10-10 lines in 4 locations

htdocs/modules/notifications/class/notification.php 1 location

@@ 171-180 (lines=10) @@
168
        if (!$result) {
169
            return $ret;
170
        }
171
        while ($myrow = $result->fetch(\PDO::FETCH_ASSOC)) {
172
            $notification = new NotificationsNotification();
173
            $notification->assignVars($myrow);
174
            if (!$id_as_key) {
175
                $ret[] = $notification;
176
            } else {
177
                $ret[$myrow['id']] = $notification;
178
            }
179
            unset($notification);
180
        }
181
        return $ret;
182
    }
183

htdocs/xoops_lib/Xoops/Core/Kernel/Handlers/XoopsBlockHandler.php 1 location

@@ 110-119 (lines=10) @@
107
        if (!$result) {
108
            return $ret;
109
        }
110
        while ($myrow = $result->fetch(\PDO::FETCH_ASSOC)) {
111
            $block = new XoopsBlock();
112
            $block->assignVars($myrow);
113
            if (!$id_as_key) {
114
                $ret[] = $block;
115
            } else {
116
                $ret[$myrow['bid']] = $block;
117
            }
118
            unset($block);
119
        }
120
        return $ret;
121
122
    }

htdocs/xoops_lib/Xoops/Core/Kernel/Handlers/XoopsModuleHandler.php 1 location

@@ 273-282 (lines=10) @@
270
        } catch (\PDOException $e) {
271
            return $ret;
272
        }
273
        while ($myrow = $result->fetch(\PDO::FETCH_ASSOC)) {
274
            $module = new XoopsModule();
275
            $module->assignVars($myrow);
276
            if (!$id_as_key) {
277
                $ret[] = $module;
278
            } else {
279
                $ret[$myrow['mid']] = $module;
280
            }
281
            unset($module);
282
        }
283
        return $ret;
284
    }
285

htdocs/xoops_lib/Xoops/Core/Kernel/Handlers/XoopsTplFileHandler.php 1 location

@@ 325-334 (lines=10) @@
322
        if (!$result) {
323
            return $ret;
324
        }
325
        while ($myrow = $result->fetch(\PDO::FETCH_ASSOC)) {
326
            $tplfile = new XoopsTplFile();
327
            $tplfile->assignVars($myrow);
328
            if (!$id_as_key) {
329
                $ret[] = $tplfile;
330
            } else {
331
                $ret[$myrow['tpl_id']] = $tplfile;
332
            }
333
            unset($tplfile);
334
        }
335
        return $ret;
336
    }
337