Enumerable   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 31
ccs 5
cts 7
cp 0.7143
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getCostants() 0 5 1
A isValidValue() 0 4 1
A getCostantsValues() 0 4 1
1
<?php
2
3
namespace Padosoft\HTTPClient\traits;
4
5
/**
6
 * Class Enumerable
7
 * @package Padosoft\TesseraSanitaria\traits
8
 */
9
trait Enumerable
10
{
11
    /**
12
     * @return array
13
     */
14 6
    public static function getCostants()
15
    {
16 6
        $oClass = new \ReflectionClass(__CLASS__);
17 6
        return $oClass->getConstants();
18
    }
19
20
    /**
21
     * @param $valore
22
     *
23
     * @return bool
24
     */
25 6
    public static function isValidValue($valore)
26
    {
27 6
        return in_array($valore, self::getCostants(), null);
28
    }
29
30
    /**
31
     * @param string $separator
32
     *
33
     * @return string
34
     */
35
    public static function getCostantsValues($separator = ', ')
36
    {
37
        return implode($separator, self::getCostants());
38
    }
39
}
40