Passed
Push — type-registry ( f9a1df...0931f1 )
by Michael
24:09
created

ConnectionException::noActiveTransaction()   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 101
    public static function commitFailedRollbackOnly()
11
    {
12 101
        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 176
    public static function noActiveTransaction()
19
    {
20 176
        return new self('There is no active transaction.');
21
    }
22
23
    /**
24
     * @return \Doctrine\DBAL\ConnectionException
25
     */
26 3
    public static function savepointsNotSupported()
27
    {
28 3
        return new self('Savepoints are not supported by this driver.');
29
    }
30
31
    /**
32
     * @return \Doctrine\DBAL\ConnectionException
33
     */
34 48
    public static function mayNotAlterNestedTransactionWithSavepointsInTransaction()
35
    {
36 48
        return new self('May not alter the nested transaction with savepoints behavior while a transaction is open.');
37
    }
38
}
39