Transaction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rollback() 0 4 1
A commit() 0 4 1
1
<?php
2
3
namespace Pixie\QueryBuilder;
4
5
class Transaction extends QueryBuilderHandler
6
{
7
    /**
8
     * Commit the database changes
9
     *
10
     * @throws TransactionHaltException
11
     */
12
    public function commit(): void
13
    {
14
        $this->dbInstance->query('COMMIT');
15
        throw new TransactionHaltException();
16
    }
17
18
    /**
19
     * Rollback the database changes
20
     *
21
     * @throws TransactionHaltException
22
     */
23
    public function rollback(): void
24
    {
25
        $this->dbInstance->query('ROLLBACK');
26
        throw new TransactionHaltException();
27
    }
28
}
29