PediException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 3
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidQuantifier() 0 3 1
A invalidInput() 0 3 1
1
<?php
2
3
namespace Claudsonm\Pedi\Exceptions;
4
5
use Claudsonm\Pedi\Structure\Field;
6
use Exception;
7
8
class PediException extends Exception
9
{
10 4
    public static function invalidInput(Field $field, $value): self
11
    {
12 4
        return new static("The value `{$value}` is not compatible with the field {$field->getName()}");
13
    }
14
15 5
    public static function invalidQuantifier()
16
    {
17 5
        return new static('Only integers higher than zero or the wildcard `*` are allowed as valid occurrences quantifiers.');
18
    }
19
}
20