Completed
Push — master ( d154ad...604248 )
by Valentin
05:10
created

Properties   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getProperties() 0 14 3
A isIgnoredProperty() 0 4 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Cycle\ORM\Promise\Declaration\Extractor;
5
6
final class Properties
7
{
8
    public function getProperties(\ReflectionClass $reflection): array
9
    {
10
        $properties = [];
11
12
        foreach ($reflection->getProperties() as $property) {
13
            if ($this->isIgnoredProperty($property)) {
14
                continue;
15
            }
16
17
            $properties[] = $property->getName();
18
        }
19
20
        return $properties;
21
    }
22
23
    private function isIgnoredProperty(\ReflectionProperty $property): bool
24
    {
25
        return $property->isPrivate() || $property->isStatic();
26
    }
27
}