File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -98,14 +98,16 @@ public function commit(iterable $statements = []): CypherList
98
98
public function rollback (): void
99
99
{
100
100
if ($ this ->isFinished ()) {
101
- switch ($ this ->state ) {
102
- case TransactionState::TERMINATED :
103
- throw new ClientException ("Can't rollback, transaction has been terminated " );
104
- case TransactionState::COMMITTED :
105
- throw new ClientException ("Can't rollback, transaction has already been committed " );
106
- case TransactionState::ROLLED_BACK :
107
- throw new ClientException ("Can't rollback, transaction has already been rolled back " );
108
- default :
101
+ if ($ this ->state === TransactionState::TERMINATED ) {
102
+ throw new ClientException ("Can't rollback, transaction has been terminated " );
103
+ }
104
+
105
+ if ($ this ->state === TransactionState::COMMITTED ) {
106
+ throw new ClientException ("Can't rollback, transaction has already been committed " );
107
+ }
108
+
109
+ if ($ this ->state === TransactionState::ROLLED_BACK ) {
110
+ throw new ClientException ("Can't rollback, transaction has already been rolled back " );
109
111
}
110
112
}
111
113
You can’t perform that action at this time.
0 commit comments