Completed
Push — master ( d401ab...1f0fb6 )
by Łukasz
02:47
created

Exception::unsupportedCandidateState()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
3
4
namespace Tworzenieweb\SqlProvisioner\Model;
5
6
7
use LogicException;
8
9
/**
10
 * Class Exception
11
 * @package Tworzenieweb\SqlProvisioner\Model
12
 */
13
class Exception extends LogicException
14
{
15
    /**
16
     * @param $state
17
     * @param array $supportedStates
18
     * @return Exception
19
     */
20 1
    public static function unsupportedCandidateState($state, array $supportedStates)
21
    {
22 1
        return new self(sprintf(
23 1
            'Provided candidate state %s is not supported. Supported states: %s',
24 1
            $state,
25 1
            implode(',', $supportedStates)
26 1
        ));
27
    }
28
29
30
    /**
31
     * @param string $name
32
     * @return Exception
33
     */
34
    public static function wrongFilename($name)
35
    {
36
        return new self(sprintf('Provided file %s is not matching Candidate format', $name));
37
    }
38
}