From ca4e6be60547a8aa152c099aa832b80afe26e58a Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Wed, 20 Jul 2022 10:21:00 -0700 Subject: [PATCH] Rework code before running Rector --- src/Connection.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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(); }