Commit f771cecc authored by Benjamin Eberlei's avatar Benjamin Eberlei

Fix whitespaces

parent 5964c0b1
......@@ -55,37 +55,37 @@ final class DriverManager
* driver connection.
*
* $params must contain at least one of the following.
*
*
* Either 'driver' with one of the following values:
* pdo_mysql
* pdo_sqlite
* pdo_pgsql
* pdo_oracle
* pdo_sqlsrv
*
*
* OR 'driverClass' that contains the full class name (with namespace) of the
* driver class to instantiate.
*
*
* Other (optional) parameters:
*
*
* <b>user (string)</b>:
* The username to use when connecting.
*
* The username to use when connecting.
*
* <b>password (string)</b>:
* The password to use when connecting.
*
*
* <b>driverOptions (array)</b>:
* Any additional driver-specific options for the driver. These are just passed
* through to the driver.
*
*
* <b>pdo</b>:
* You can pass an existing PDO instance through this parameter. The PDO
* instance will be wrapped in a Doctrine\DBAL\Connection.
*
*
* <b>wrapperClass</b>:
* You may specify a custom wrapper class through the 'wrapperClass'
* parameter but this class MUST inherit from Doctrine\DBAL\Connection.
*
*
* @param array $params The parameters.
* @param Doctrine\DBAL\Configuration The configuration to use.
* @param Doctrine\Common\EventManager The event manager to use.
......@@ -103,7 +103,7 @@ final class DriverManager
if ( ! $eventManager) {
$eventManager = new EventManager();
}
// check for existing pdo object
if (isset($params['pdo']) && ! $params['pdo'] instanceof \PDO) {
throw DBALException::invalidPdoInstance();
......@@ -118,9 +118,9 @@ final class DriverManager
} else {
$className = self::$_driverMap[$params['driver']];
}
$driver = new $className();
$wrapperClass = 'Doctrine\DBAL\Connection';
if (isset($params['wrapperClass'])) {
if (is_subclass_of($params['wrapperClass'], $wrapperClass)) {
......@@ -129,7 +129,7 @@ final class DriverManager
throw DBALException::invalidWrapperClass($params['wrapperClass']);
}
}
return new $wrapperClass($params, $driver, $config, $eventManager);
}
......@@ -139,16 +139,16 @@ final class DriverManager
* @param array $params
*/
private static function _checkParams(array $params)
{
{
// check existance of mandatory parameters
// driver
if ( ! isset($params['driver']) && ! isset($params['driverClass'])) {
throw DBALException::driverRequired();
}
// check validity of parameters
// driver
if ( isset($params['driver']) && ! isset(self::$_driverMap[$params['driver']])) {
throw DBALException::unknownDriver($params['driver'], array_keys(self::$_driverMap));
......@@ -158,4 +158,4 @@ final class DriverManager
throw DBALException::invalidDriverClass($params['driverClass']);
}
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment