Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (warning)
50.00%
1 / 2
CRAP
50.00% covered (warning)
50.00%
1 / 2
MySQLDriver
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (warning)
50.00%
1 / 2
2.50
50.00% covered (warning)
50.00%
1 / 2
 quote
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 connect
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
<?php
declare(strict_types = 1);
namespace Siesta\Driver\MySQL;
use Siesta\Database\Connection;
use Siesta\Database\ConnectionData;
use Siesta\Database\Driver;
use Siesta\Database\Exception\ConnectException;
/**
 * @author Gregor Müller
 */
class MySQLDriver implements Driver
{
    const MYSQL_QUOTE = "`";
    const MYSQL_DRIVER_NAME = "mysql";
    const DRIVER_CLASS = 'Siesta\Driver\MySQL\MySQLDriver';
    /**
     * @param $name
     *
     * @return string
     */
    public static function quote(string $name) : string
    {
        return self::MYSQL_QUOTE . $name . self::MYSQL_QUOTE;
    }
    /**
     * @param ConnectionData $connectionData
     *
     * @return Connection
     * @throws ConnectException
     */
    public function connect(ConnectionData $connectionData) : Connection
    {
        return new MySQLConnection($connectionData);
    }
}