Code Duplication    Length = 3-3 lines in 3 locations

src/qb.php 3 locations

@@ 179-181 (lines=3) @@
176
        // limits
177
        //
178
        $limit = null;
179
        if ($this->limit > 0) {
180
            $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit;
181
        }
182
183
        //
184
        // group bys
@@ 244-246 (lines=3) @@
241
        }
242
        $update_fields = implode(', ', $updates);
243
        $limit = null;
244
        if ($this->limit > 0) {
245
            $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit;
246
        }
247
        $where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null;
248
        $string = sprintf('update %1$s set %2$s %3$s %4$s', $this->_table_names[0], $update_fields, $where, $limit);
249
@@ 286-288 (lines=3) @@
283
        $table = $this->_table_names[0];
284
        $where = count($this->_conditions) > 0 ? (' where '.implode(' and ', $this->_conditions)) : null;
285
        $limit = null;
286
        if ($this->limit > 0) {
287
            $limit = ' limit '.($this->limit_offset != -1 ? $this->limit_offset.', ' : null).$this->limit;
288
        }
289
        $string = sprintf('delete from %1$s %2$s %3$s', $table, $where, $limit);
290
291
        return $string;