EnumTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isSupported() 0 4 1
A getSupported() 0 4 1
1
<?php
2
3
namespace Dazzle\Util\Enum;
4
5
trait EnumTrait
6
{
7
    /**
8
     * @see EnumInterface::isSupported
9
     */
10 3
    public static function isSupported($value)
11
    {
12 3
        return in_array($value, static::getSupported(), true);
13
    }
14
15
    /**
16
     * @see EnumInterface::getSupported
17
     */
18 5
    public static function getSupported()
19
    {
20 5
        return (new \ReflectionClass(__CLASS__))->getConstants();
21
    }
22
}
23