Code Duplication    Length = 14-15 lines in 2 locations

src/Database.php 2 locations

@@ 215-229 (lines=15) @@
212
     * @param  mixed|array $params    (Optional) The array of values that will be binded to the prepared statement
213
     * @return int         Returns the number of rows affected
214
     */
215
    public function execute($queryText, $params = false)
216
    {
217
        if (!is_array($params)) {
218
            $params = array($params);
219
        }
220
221
        $debug = new DatabaseQuery($queryText, $params);
222
223
        $query = $this->doQuery($queryText, $params);
224
        $return = $query->rowCount();
225
226
        $debug->finish($return);
227
228
        return $return;
229
    }
230
231
    /**
232
     * Prepares and executes a MySQL prepared SELECT statement. <em>The second parameter is optional when using this function to execute a query with no placeholders.</em>
@@ 238-251 (lines=14) @@
235
     * @param  mixed|array $params    (Optional) The array of values that will be binded to the prepared statement
236
     * @return array       Returns an array of the values received from the query
237
     */
238
    public function query($queryText, $params = false)
239
    {
240
        if (!is_array($params)) {
241
            $params = array($params);
242
        }
243
244
        $debug = new DatabaseQuery($queryText, $params);
245
246
        $return = $this->doQuery($queryText, $params)->fetchAll();
247
248
        $debug->finish($return);
249
250
        return $return;
251
    }
252
253
    /**
254
     * Perform a query