Completed
Push — master ( ba55b5...96e451 )
by Zoltán
02:51
created

EnumerationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidValue() 0 3 1
A invalidKeyType() 0 3 1
1
<?php namespace BuildR\Utils\Enumeration\Exception;
2
3
use BuildR\Foundation\Exception\Exception;
4
5
class EnumerationException extends Exception {
6
7
    const MESSAGE_INVALID_VALUE = 'This enumeration is not contains any constant like: %s';
8
9
    const MESSAGE_INVALID_KEY_TYPE = 'The key must be a string! %s given!';
10
11
    public static function invalidValue($value) {
12
        return self::createByFormat(self::MESSAGE_INVALID_VALUE, [$value]);
13
    }
14
15
    public static function invalidKeyType($keyType) {
16
        return self::createByFormat(self::MESSAGE_INVALID_KEY_TYPE, [$keyType]);
17
    }
18
19
}
20