Code Duplication    Length = 16-16 lines in 2 locations

src/Query.php 1 location

@@ 207-222 (lines=16) @@
204
        return $join;
205
    }
206
    
207
    protected function getWhere()
208
    {
209
        $where = [];
210
        $params = [];
211
212
        foreach ($this->where as $item) {
213
            $where[] = $item['filter'];
214
            $params = array_merge($params, $item['params']);
215
        }
216
        
217
        if (empty($where)) {
218
            return null;
219
        }
220
        
221
        return [ implode(' AND ', $where), $params ];
222
    }
223
224
    /**
225
     * @param \ByJG\AnyDataset\DbDriverInterface|null $dbDriver

src/Updatable.php 1 location

@@ 69-84 (lines=16) @@
66
        return ' ' . implode(', ', $this->fields) . ' ';
67
    }
68
    
69
    protected function getWhere()
70
    {
71
        $where = [];
72
        $params = [];
73
74
        foreach ($this->where as $item) {
75
            $where[] = $item['filter'];
76
            $params = array_merge($params, $item['params']);
77
        }
78
        
79
        if (empty($where)) {
80
            return null;
81
        }
82
        
83
        return [ implode(' AND ', $where), $params ];
84
    }
85
86
    /**
87
     * @param \ByJG\AnyDataset\DbFunctionsInterface|null $dbHelper