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

CriteriaConfigurationException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 19
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A unknown() 0 4 1
A invalid() 0 4 1
A invalidType() 0 6 1
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