Passed
Pull Request — master (#3808)
by Sergei
09:45
created

ExecutionMode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
dl 0
loc 18
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isAutoCommitEnabled() 0 3 1
A enableAutoCommit() 0 3 1
A disableAutoCommit() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Driver\OCI8;
6
7
/**
8
 * Encapsulates the execution mode that is shared between the connection and its statements.
9
 *
10
 * @internal This class is not covered by the backward compatibility promise
11
 */
12
final class ExecutionMode
13
{
14
    /** @var bool */
15
    private $isAutoCommitEnabled = true;
16
17 43
    public function enableAutoCommit() : void
18
    {
19 43
        $this->isAutoCommitEnabled = true;
20 43
    }
21
22 43
    public function disableAutoCommit() : void
23
    {
24 43
        $this->isAutoCommitEnabled = false;
25 43
    }
26
27 405
    public function isAutoCommitEnabled() : bool
28
    {
29 405
        return $this->isAutoCommitEnabled;
30
    }
31
}
32