Completed
Pull Request — master (#3808)
by Sergei
60:47
created

ExecutionMode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
dl 0
loc 18
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
final class ExecutionMode
11
{
12
    /** @var bool */
13
    private $isAutoCommitEnabled = true;
14
15
    public function enableAutoCommit() : void
16
    {
17
        $this->isAutoCommitEnabled = true;
18
    }
19
20
    public function disableAutoCommit() : void
21
    {
22
        $this->isAutoCommitEnabled = false;
23
    }
24
25
    public function isAutoCommitEnabled() : bool
26
    {
27
        return $this->isAutoCommitEnabled;
28
    }
29
}
30