Completed
Push — master ( c623e8...f78604 )
by Pavel
05:18
created

invalidCriteriaConfiguration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
ccs 0
cts 0
cp 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace ScayTrase\Api\Cruds\Exception;
4
5
class CriteriaConfigurationException extends \InvalidArgumentException implements CrudsExceptionInterface
6
{
7
    public static function unknown(array $names)
8
    {
9
        return new self(sprintf('Unknown criteria configurators: %s', implode(', ', $names)));
10
    }
11
12
    public static function invalid($name, $value)
13
    {
14
        return new self(sprintf('Invalid data passed to criteria configurators "%s": %s', $name, json_encode($value)));
15
    }
16
17
    public static function invalidType($expected, $actual)
18
    {
19
        return new self(
20
            sprintf('Invalid data format passed to criteria configurator: %s expected, %s given', $expected, $actual)
21
        );
22
    }
23
24
    public static function invalidCriteriaConfiguration($field)
25
    {
26
        return new self(
27
            sprintf('Invalid data passed to criteria configurator: %s', $field)
28
        );
29
    }
30
}
31