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 @@ -68,14 +68,16 @@ public function __construct(
68
68
public function commit (iterable $ statements = []): CypherList
69
69
{
70
70
if ($ this ->isFinished ()) {
71
- switch ($ this ->state ) {
72
- case TransactionState::TERMINATED :
73
- throw new ClientException ("Can't commit, transaction has been terminated " );
74
- case TransactionState::COMMITTED :
75
- throw new ClientException ("Can't commit, transaction has already been committed " );
76
- case TransactionState::ROLLED_BACK :
77
- throw new ClientException ("Can't commit, transaction has already been rolled back " );
78
- default :
71
+ if ($ this ->state === TransactionState::TERMINATED ) {
72
+ throw new ClientException ("Can't commit, transaction has been terminated " );
73
+ }
74
+
75
+ if ($ this ->state === TransactionState::COMMITTED ) {
76
+ throw new ClientException ("Can't commit, transaction has already been committed " );
77
+ }
78
+
79
+ if ($ this ->state === TransactionState::ROLLED_BACK ) {
80
+ throw new ClientException ("Can't commit, transaction has already been rolled back " );
79
81
}
80
82
}
81
83
You can’t perform that action at this time.
0 commit comments