Code Duplication    Length = 22-23 lines in 2 locations

src/database/Postgres.php 1 location

@@ 4619-4640 (lines=22) @@
4616
     *
4617
     * @return \PHPPgAdmin\Database\A 0 success
4618
     */
4619
    public function clusterIndex($table = '', $index = '')
4620
    {
4621
        $sql = 'CLUSTER';
4622
4623
        // We don't bother with a transaction here, as there's no point rolling
4624
        // back an expensive cluster if a cheap analyze fails for whatever reason
4625
4626
        if (!empty($table)) {
4627
            $f_schema = $this->_schema;
4628
            $this->fieldClean($f_schema);
4629
            $this->fieldClean($table);
4630
            $sql .= " \"{$f_schema}\".\"{$table}\"";
4631
4632
            if (!empty($index)) {
4633
                $this->fieldClean($index);
4634
                $sql .= " USING \"{$index}\"";
4635
            }
4636
        }
4637
4638
        return $this->execute($sql);
4639
    }
4640
4641
    /**
4642
     * Returns a list of all constraints on a table,
4643
     * including constraint name, definition, related col and referenced namespace,

src/database/Postgres82.php 1 location

@@ 303-325 (lines=23) @@
300
         *
301
         * @return \PHPPgAdmin\Database\A 0 success
302
         */
303
        public function clusterIndex($table = '', $index = '')
304
        {
305
            $sql = 'CLUSTER';
306
307
            // We don't bother with a transaction here, as there's no point rolling
308
            // back an expensive cluster if a cheap analyze fails for whatever reason
309
310
            if (!empty($table)) {
311
                $f_schema = $this->_schema;
312
                $this->fieldClean($f_schema);
313
                $this->fieldClean($table);
314
315
                if (!empty($index)) {
316
                    $this->fieldClean($index);
317
                    $sql .= " \"{$index}\" ON \"{$f_schema}\".\"{$table}\"";
318
                } else {
319
                    $sql .= " \"{$f_schema}\".\"{$table}\"";
320
                }
321
            }
322
323
            return $this->execute($sql);
324
        }
325
326
        // Operator functions
327
328
        /**