File tree Expand file tree Collapse file tree 4 files changed +17
-13
lines changed
stubs/Doctrine/DBAL/Driver/PDO/MySql Expand file tree Collapse file tree 4 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 7474 "phpstan/phpstan" : " ^1.0" ,
7575 "phpstan/phpstan-webmozart-assert" : " ^1.0" ,
7676 "pimple/pimple" : " ^3.2" ,
77- "rector/rector" : " dev-main " ,
77+ "rector/rector" : " 0.12.7 " ,
7878 "symfony/dependency-injection" : " ^5.0"
7979 },
8080 "suggest" : {
Original file line number Diff line number Diff line change 66
77// autoload hack
88file_put_contents ('vendor/laminas/laminas-zendframework-bridge/src/autoload.php ' , '' );
9- class_alias (Laminas \Cache \PatternPluginManager \PatternPluginManagerV2Polyfill::class, Zend \Cache \PatternPluginManager \PatternPluginManagerV2Polyfill::class);
109class_alias (Laminas \ServiceManager \AbstractPluginManager::class, Zend \ServiceManager \AbstractPluginManager::class);
1110class_alias (Laminas \ModuleManager \Feature \ConfigProviderInterface::class, Zend \ModuleManager \Feature \ConfigProviderInterface::class);
1211class_alias (Laminas \ModuleManager \Feature \InitProviderInterface::class, Zend \ModuleManager \Feature \InitProviderInterface::class);
Original file line number Diff line number Diff line change 1515 $ containerConfigurator ->import (LevelSetList::UP_TO_PHP_80 );
1616 $ containerConfigurator ->import (SetList::CODE_QUALITY );
1717 $ containerConfigurator ->import (SetList::CODING_STYLE );
18- $ containerConfigurator ->import (SetList::CODING_STYLE_ADVANCED );
1918 $ containerConfigurator ->import (SetList::DEAD_CODE );
2019 $ containerConfigurator ->import (SetList::NAMING );
2120 $ containerConfigurator ->import (SetList::ORDER );
Original file line number Diff line number Diff line change 66
77use Doctrine \DBAL \Driver \AbstractMySQLDriver ;
88use Doctrine \DBAL \Driver \PDO \Connection ;
9+ use Doctrine \DBAL \Driver \PDO \Exception ;
910use PDO ;
11+ use PDOException ;
1012
1113if (class_exists (Driver::class)) {
1214 return ;
@@ -27,22 +29,26 @@ public function connect(array $params)
2729 $ driverOptions [PDO ::ATTR_PERSISTENT ] = true ;
2830 }
2931
30- return new Connection (
31- $ this ->constructPdoDsn ($ params ),
32- $ params ['user ' ] ?? '' ,
33- $ params ['password ' ] ?? '' ,
34- $ driverOptions
35- );
32+ try {
33+ $ pdo = new PDO (
34+ $ this ->constructPdoDsn ($ params ),
35+ $ params ['user ' ] ?? '' ,
36+ $ params ['password ' ] ?? '' ,
37+ $ driverOptions
38+ );
39+ } catch (PDOException $ exception ) {
40+ throw Exception::new ($ exception );
41+ }
42+
43+ return new Connection ($ pdo );
3644 }
3745
3846 /**
3947 * Constructs the MySQL PDO DSN.
4048 *
4149 * @param mixed[] $params
42- *
43- * @return string The DSN.
4450 */
45- protected function constructPdoDsn (array $ params )
51+ private function constructPdoDsn (array $ params ): string
4652 {
4753 $ dsn = 'mysql: ' ;
4854 if (isset ($ params ['host ' ]) && $ params ['host ' ] !== '' ) {
@@ -67,4 +73,4 @@ protected function constructPdoDsn(array $params)
6773
6874 return $ dsn ;
6975 }
70- }
76+ }
You can’t perform that action at this time.
0 commit comments