EnumConstantTypeException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 4
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
1
<?php
2
3
namespace Akizuki\enum\Exceptions;
4
5
use LogicException;
6
7
/**
8
 * [ Exception ] Enum Constant Type Exception
9
 *
10
 * This exception will be thrown when invalid constant is defined in enum class.
11
 * Enum constants must be int or string.
12
 *
13
 * @author 4kizuki <[email protected]>
14
 * @copyright 2017 4kizuki. All Rights Reserved.
15
 * @package 4kizuki/php-enum
16
 * @since 1.0.0
17
 */
18
class EnumConstantTypeException extends LogicException {
19
    
20 11
    public function __construct( string $className, string $constName, string $constType ) {
21 11
        parent::__construct( "Disallowed constant \"{$className}::{$constName}\": \"{$constType}\"." );
22 11
    }
23
    
24
}
25