IntEnum   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A value() 0 3 1
A _validate_constants() 0 3 1
1
<?php
2
3
namespace Akizuki\enum;
4
5
use Akizuki\enum\Enum;
6
7
/**
8
 * [ Abstract Class ] Enumeration for Int
9
 *
10
 * Provides basic function of Integer Enumeration.
11
 *
12
 * @author 4kizuki <[email protected]>
13
 * @copyright 2017 4kizuki. All Rights Reserved.
14
 * @package 4kizuki/php-enum
15
 * @since 1.0.0
16
 */
17
abstract class IntEnum extends Enum {
18
19 3
    public function __construct( int $scalar ) {
20
21 3
        parent::__construct( $scalar );
22
23 1
    }
24
25 1
    final public function value( ) : int { 
26
27 1
        return parent::value( );
28
29
    }
30
31 3
    final protected static function _validate_constants( $value ) : bool {
32
33 3
        return is_int( $value );
34
35
    }
36
    
37
}
38