Skip to content

Commit fb773fb

Browse files
committed
added mutation free tags to transaction state methods
1 parent 38218e5 commit fb773fb

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

src/Basic/UnmanagedTransaction.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,25 @@ public function rollback(): void
6868
$this->tsx->rollback();
6969
}
7070

71+
/**
72+
* @psalm-mutation-free
73+
*/
7174
public function isCommitted(): bool
7275
{
7376
return $this->tsx->isCommitted();
7477
}
7578

79+
/**
80+
* @psalm-mutation-free
81+
*/
7682
public function isRolledBack(): bool
7783
{
7884
return $this->tsx->isRolledBack();
7985
}
8086

87+
/**
88+
* @psalm-mutation-free
89+
*/
8190
public function isFinished(): bool
8291
{
8392
return $this->tsx->isRolledBack();

src/Bolt/BoltUnmanagedTransaction.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,25 @@ private function handleConnectionTimeoutException(ConnectionTimeoutException $e)
191191
throw $e;
192192
}
193193

194+
/**
195+
* @psalm-mutation-free
196+
*/
194197
public function isRolledBack(): bool
195198
{
196199
return $this->isRolledBack;
197200
}
198201

202+
/**
203+
* @psalm-mutation-free
204+
*/
199205
public function isCommitted(): bool
200206
{
201207
return $this->isCommitted;
202208
}
203209

210+
/**
211+
* @psalm-mutation-free
212+
*/
204213
public function isFinished(): bool
205214
{
206215
return $this->isRolledBack() || $this->isCommitted();

src/Contracts/UnmanagedTransactionInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,22 @@ public function rollback(): void;
4343

4444
/**
4545
* Returns whether the transaction has been rolled back.
46+
*
47+
* @psalm-mutation-free
4648
*/
4749
public function isRolledBack(): bool;
4850

4951
/**
5052
* Returns whether the transaction has been committed.
53+
*
54+
* @psalm-mutation-free
5155
*/
5256
public function isCommitted(): bool;
5357

5458
/**
5559
* Returns whether the transaction is safe to use.
60+
*
61+
* @psalm-mutation-free
5662
*/
5763
public function isFinished(): bool;
5864
}

src/Http/HttpUnmanagedTransaction.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,25 @@ public function __destruct()
140140
$this->connection->close();
141141
}
142142

143+
/**
144+
* @psalm-mutation-free
145+
*/
143146
public function isRolledBack(): bool
144147
{
145148
return $this->isRolledBack;
146149
}
147150

151+
/**
152+
* @psalm-mutation-free
153+
*/
148154
public function isCommitted(): bool
149155
{
150156
return $this->isCommitted;
151157
}
152158

159+
/**
160+
* @psalm-mutation-free
161+
*/
153162
public function isFinished(): bool
154163
{
155164
return $this->isRolledBack() || $this->isCommitted();

0 commit comments

Comments
 (0)