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

Properties::getProperties()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 3
nc 3
nop 1
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
}