Code Duplication    Length = 5-5 lines in 2 locations

application/helpers/widget_helper.php 2 locations

@@ 27-31 (lines=5) @@
24
25
        $query = $ci->db->limit(1)->get_where('widgets', ['name' => $name]);
26
27
        if ($query->num_rows() == 1) {
28
            $widget = $query->row_array();
29
        } else {
30
            log_message('error', 'Can\'t run widget <b>' . $name . '</b>');
31
        }
32
33
        if (($data = $ci->cache->fetch('widget' . $name, 'widgets')) != FALSE AND $cache != FALSE) {
34
            return $data;
@@ 104-108 (lines=5) @@
101
102
        $query = $ci->db->limit(1)->get_where('widgets', ['name' => $name]);
103
104
        if ($query->num_rows() == 1) {
105
            $widget = $query->row_array();
106
        } else {
107
            log_message('error', 'Can\'t run widget <b>' . $name . '</b>');
108
        }
109
110
        $widget = unserialize($widget['settings']);
111