Completed
Push — master ( 4ff9cc...589f5d )
by Pavel
07:24
created

CriteriaConfigurationException::invalid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 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