EnumConstantTypeException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 2
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 3
crap 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