Completed
Push — master ( 334344...573b25 )
by Peter
05:17
created

InvalidSetException::notInstanceOf()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
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
 * GpsLab component.
5
 *
6
 * @author    Peter Gribanov <[email protected]>
7
 * @copyright Copyright (c) 2011, Peter Gribanov
8
 * @license   http://opensource.org/licenses/MIT
9
 */
10
11
namespace GpsLab\Component\Enum\Exception;
12
13
class InvalidSetException extends \InvalidArgumentException
14
{
15
    /**
16
     * @param string $expected
17
     * @param string $actual
18
     *
19
     * @return self
20
     */
21 7
    public static function notInstanceOf($expected, $actual)
22
    {
23 7
        return new self(sprintf(
24 7
            'Set should be an instance of "%s" of the same enum as this "%s".',
25 7
            $expected,
26
            $actual
27 7
        ));
28
    }
29
}
30