Failed Conditions
Push — master ( 4d0d2a...06d1d8 )
by Marco
22s queued 16s
created

OCI8Exception   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 14
ccs 3
cts 6
cp 0.5
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromErrorInfo() 0 7 2
1
<?php
2
3
namespace Doctrine\DBAL\Driver\OCI8;
4
5
use Doctrine\DBAL\Driver\AbstractDriverException;
6
7
class OCI8Exception extends AbstractDriverException
8
{
9
    /**
10
     * @param mixed[]|false $error
11
     *
12
     * @return \Doctrine\DBAL\Driver\OCI8\OCI8Exception
13
     */
14 151
    public static function fromErrorInfo($error)
15
    {
16 151
        if ($error === false) {
17
            return new self('Database error occurred but no error information was retrieved from the driver.');
18
        }
19
20 151
        return new self($error['message'], null, $error['code']);
21
    }
22
}
23