Modifier::getAll()   A
last analyzed

Complexity

Conditions 2
Paths 3

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
rs 9.4285
cc 2
eloc 5
nc 3
nop 1
1
<?php declare(strict_types = 1);
2
3
4
namespace Console\Modifier;
5
6
7
use ReflectionClass;
8
use ReflectionException;
9
10
abstract class Modifier implements ModifierInterface
11
{
12
    /**
13
     * @param string $class
14
     *
15
     * @return array
16
     */
17
    public static function getAll(string $class = __CLASS__): array
18
    {
19
        try {
20
            $class = new ReflectionClass($class);
21
22
            return $class->getConstants();
23
        } catch (ReflectionException $e) {
24
            return [];
25
        }
26
27
    }
28
}