Completed
Push — master ( 5be531...114bf3 )
by Łukasz
03:06
created

Exception::candidateScriptError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Tworzenieweb\SqlProvisioner\Database;
4
5
use Tworzenieweb\SqlProvisioner\Model\Candidate;
6
7
/**
8
 * @author Luke Adamczewski
9
 * @package Tworzenieweb\SqlProvisioner\Database
10
 */
11
class Exception extends \Exception
12
{
13
14
    /**
15
     * @param Candidate     $candidate
16
     * @param \PDOException $pdoException
17
     * @return Exception
18
     */
19 1
    public static function candidateScriptError(Candidate $candidate, \PDOException $pdoException)
20
    {
21 1
        $exception = new self(sprintf('There was an error during execution of %s.', $candidate->getName()), 0, $pdoException);
22
23 1
        return $exception;
24
    }
25
}
26