Completed
Push — master ( 3c559e...05a21e )
by Nikola
02:55
created

forMissingMandatoryParameter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.008

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 5
cp 0.8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 1.008
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cascader\Exception;
6
7
use InvalidArgumentException;
8
9
class InvalidOptionsException extends InvalidArgumentException implements ExceptionInterface
10
{
11 1
    public static function forInvalidKeys()
12
    {
13 1
        return new static('Options should be in form of an associate array (string keys)');
14
    }
15
16 1
    public static function forMissingMandatoryParameter(string $className, string $parameterName)
17
    {
18 1
        return new static(sprintf(
19 1
            'Mandatory parameter: \'%2$s\' of class: %1$s is missing from options',
20
            $className,
21 1
            $parameterName
22
        ));
23
    }
24
}
25