Code Duplication    Length = 16-16 lines in 2 locations

src/Query.php 1 location

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

src/Updatable.php 1 location

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