Commit f771cecc authored by Benjamin Eberlei's avatar Benjamin Eberlei

Fix whitespaces

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