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

ExecutionMode::enableAutoCommit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
crap 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