Code Duplication    Length = 12-13 lines in 2 locations

PHPDaemon/Clients/MySQL/Connection.php 1 location

@@ 417-428 (lines=12) @@
414
     * @callback $cb ( Connection $conn, boolean $success )
415
     * @return boolean            Success
416
     */
417
    public function command($cmd, $q = '', $cb = null)
418
    {
419
        if ($this->phase !== self::PHASE_HANDSHAKED) {
420
            return false;
421
        }
422
423
        $this->onResponse->push($cb);
424
        $this->seq = 0;
425
        $this->sendPacket(chr($cmd) . $q);
426
427
        return true;
428
    }
429
430
    /**
431
     * Sets default database name

PHPDaemon/Clients/PostgreSQL/Connection.php 1 location

@@ 390-402 (lines=13) @@
387
     * @callback $cb ( )
388
     * @return boolean Success
389
     */
390
    public function command($cmd, $q = '', $cb = null)
391
    {
392
        if ($this->state !== self::STATE_AUTH_OK) {
393
            return false;
394
        }
395
396
        $this->sendPacket($cmd, $q);
397
398
        $this->onResponse->push($cb);
399
        $this->checkFree();
400
401
        return true;
402
    }
403
404
    /**
405
     * Set default database name