Failed Conditions
Pull Request — master (#3319)
by Massimiliano
11:33
created

mayNotAlterNestedTransactionWithSavepointsInTransaction()   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 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Doctrine\DBAL;
4
5
class ConnectionException extends DBALException
6
{
7
    /**
8
     * @return \Doctrine\DBAL\ConnectionException
9
     */
10 42
    public static function commitFailedRollbackOnly()
11
    {
12 42
        return new self('Transaction commit failed because the transaction has been marked for rollback only.');
13
    }
14
15
    /**
16
     * @return \Doctrine\DBAL\ConnectionException
17
     */
18 84
    public static function noActiveTransaction()
19
    {
20 84
        return new self('There is no active transaction.');
21
    }
22
23
    /**
24
     * @return \Doctrine\DBAL\ConnectionException
25
     */
26
    public static function savepointsNotSupported()
27
    {
28
        return new self('Savepoints are not supported by this driver.');
29
    }
30
31
    /**
32
     * @return \Doctrine\DBAL\ConnectionException
33
     */
34 42
    public static function mayNotAlterNestedTransactionWithSavepointsInTransaction()
35
    {
36 42
        return new self('May not alter the nested transaction with savepoints behavior while a transaction is open.');
37
    }
38
}
39