Skip to content

Commit 7921d44

Browse files
authored
Fix collected actions [debug] (yiisoft#751)
1 parent b64a4cc commit 7921d44

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 1.1.2 under development
44

5-
- no changes in this release.
5+
- Bug #751: Fix collected debug actions (@xepozz)
66

77
## 1.1.1 August 16, 2023
88

src/Debug/DatabaseCollector.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ public function collectQueryStart(
7676
'line' => $line,
7777
'status' => self::QUERY_STATUS_INITIALIZED,
7878
'actions' => [
79-
'action' => self::ACTION_QUERY_START,
80-
'time' => microtime(true),
79+
[
80+
'action' => self::ACTION_QUERY_START,
81+
'time' => microtime(true),
82+
],
8183
],
8284
];
8385
}
@@ -127,8 +129,10 @@ public function collectTransactionStart(
127129
'line' => $line,
128130
'level' => $isolationLevel,
129131
'actions' => [
130-
'action' => self::ACTION_TRANSACTION_START,
131-
'time' => microtime(true),
132+
[
133+
'action' => self::ACTION_TRANSACTION_START,
134+
'time' => microtime(true),
135+
],
132136
],
133137
];
134138
}
@@ -140,7 +144,7 @@ public function collectTransactionRollback(
140144
string $line,
141145
): void {
142146
$this->transactions[$this->currentTransactionId]['status'] = self::TRANSACTION_STATUS_ROLLBACK;
143-
$this->transactions[$this->currentTransactionId]['actions'] = [
147+
$this->transactions[$this->currentTransactionId]['actions'][] = [
144148
'action' => self::ACTION_TRANSACTION_ROLLBACK,
145149
'line' => $line,
146150
'time' => microtime(true),
@@ -155,7 +159,7 @@ public function collectTransactionCommit(
155159
string $line,
156160
): void {
157161
$this->transactions[$this->currentTransactionId]['status'] = self::TRANSACTION_STATUS_COMMIT;
158-
$this->transactions[$this->currentTransactionId]['actions'] = [
162+
$this->transactions[$this->currentTransactionId]['actions'][] = [
159163
'action' => self::ACTION_TRANSACTION_COMMIT,
160164
'line' => $line,
161165
'time' => microtime(true),

0 commit comments

Comments
 (0)