EnumTrait::isSupported()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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