diff --git a/src/Connection.php b/src/Connection.php index 553d1b5514c..b8a445bf3b8 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -145,14 +145,9 @@ public function __construct( ?EventManager $eventManager = null ) { $this->_driver = $driver; - $this->params = $params; - // Create default config and event manager if none given - $config ??= new Configuration(); - $eventManager ??= new EventManager(); - - $this->_config = $config; - $this->_eventManager = $eventManager; + $this->_config = $config ?? new Configuration(); + $this->_eventManager = $eventManager ?? new EventManager(); if (isset($params['platform'])) { if (! $params['platform'] instanceof Platforms\AbstractPlatform) { @@ -163,6 +158,7 @@ public function __construct( $this->platform->setEventManager($this->_eventManager); } + $this->params = $params; $this->autoCommit = $config->getAutoCommit(); }