File tree Expand file tree Collapse file tree
src/Codeception/Lib/Connector Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,23 +73,15 @@ protected function ensureKernelShutdown(): void
7373
7474 $ kernel = $ this ->kernel ;
7575 (function () use ($ kernel ): void {
76- $ parameters = property_exists ($ this , 'parameters ' ) ? $ this ->parameters : null ;
77- if (!is_array ($ parameters ) || !array_key_exists ('doctrine.connections ' , $ parameters )) {
76+ if (!property_exists ($ this , 'parameters ' ) || !is_array ($ this ->parameters )) {
7877 $ kernel ->shutdown ();
79-
8078 return ;
8179 }
82-
83- $ connections = $ parameters ['doctrine.connections ' ];
84- unset($ parameters ['doctrine.connections ' ]);
85- $ this ->parameters = $ parameters ;
86-
87- try {
88- $ kernel ->shutdown ();
89- } finally {
90- $ parameters = $ this ->parameters ;
91- $ parameters ['doctrine.connections ' ] = $ connections ;
92- $ this ->parameters = $ parameters ;
80+ $ connections = $ this ->parameters ['doctrine.connections ' ] ?? null ;
81+ unset($ this ->parameters ['doctrine.connections ' ]);
82+ $ kernel ->shutdown ();
83+ if ($ connections !== null ) {
84+ $ this ->parameters ['doctrine.connections ' ] = $ connections ;
9385 }
9486 })->call ($ kernel ->getContainer ());
9587 }
You can’t perform that action at this time.
0 commit comments