Failed Conditions
Pull Request — develop (#3581)
by Jonathan
12:44
created

OCI8Exception   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 12
ccs 4
cts 6
cp 0.6667
rs 10
c 0
b 0
f 0

1 Method

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