Skip to content

Commit 9b9ab36

Browse files
committed
Use local scope
1 parent 360be7d commit 9b9ab36

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/Codeception/Module/Phalcon4.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,18 +197,19 @@ public function _before(TestInterface $test)
197197
public function _after(TestInterface $test)
198198
{
199199
if ($this->config['cleanup'] && isset($this->di['db'])) {
200-
while ($this->di['db']->isUnderTransaction()) {
201-
$level = $this->di['db']->getTransactionLevel();
200+
$db = $this->di['db'];
201+
while ($db->isUnderTransaction()) {
202+
$level = $db->getTransactionLevel();
202203
try {
203-
$this->di['db']->rollback(true);
204+
$db->rollback(true);
204205
$this->debugSection('Database', 'Transaction cancelled; all changes reverted.');
205206
} catch (PDOException $e) {
206207
}
207-
if ($level == $this->di['db']->getTransactionLevel()) {
208+
if ($level == $db->getTransactionLevel()) {
208209
break;
209210
}
210211
}
211-
$this->di['db']->close();
212+
$db->close();
212213
}
213214
$this->di = null;
214215
Di::reset();

0 commit comments

Comments
 (0)