Constants   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConstants() 0 14 3
1
<?php
2
3
/**
4
 * Spiral Framework. Cycle ProxyFactory
5
 *
6
 * @license MIT
7
 * @author  Valentin V (Vvval)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\ORM\Promise\Declaration\Extractor;
13
14
use ReflectionClass;
15
16
final class Constants
17
{
18
    /**
19
     * @param ReflectionClass $reflection
20
     * @return array
21
     */
22
    public function getConstants(ReflectionClass $reflection): array
23
    {
24
        $properties = [];
25
26
        foreach ($reflection->getReflectionConstants() as $constant) {
27
            if ($constant->isPrivate()) {
28
                continue;
29
            }
30
31
            $properties[] = $constant->name;
32
        }
33
34
        return $properties;
35
    }
36
}
37