Completed
Push — master ( d10f54...00ced4 )
by
unknown
05:32
created

ReflectionPropertyAnalyzer::analyze()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
ccs 5
cts 5
cp 1
cc 2
eloc 8
nc 2
nop 4
crap 2
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by Ruslan Molodyko.
4
 * Date: 10.09.2016
5
 * Time: 15:33
6
 */
7
namespace samsonframework\container\definition\analyzer\reflection;
8
9
use samsonframework\container\definition\analyzer\DefinitionAnalyzer;
10
use samsonframework\container\definition\analyzer\PropertyAnalyzerInterface;
11
use samsonframework\container\definition\ClassDefinition;
12
use samsonframework\container\definition\PropertyDefinition;
13
14
/**
15
 * Class ReflectionPropertyAnalyzer
16
 *
17
 * @author Ruslan Molodyko <[email protected]>
18
 */
19
class ReflectionPropertyAnalyzer implements PropertyAnalyzerInterface
20
{
21
    /** {@inheritdoc} */
22 6
    public function analyze(
23
        DefinitionAnalyzer $analyzer,
24
        \ReflectionProperty $reflectionProperty,
25
        ClassDefinition $classDefinition,
26
        PropertyDefinition $propertyDefinition = null
27
    ) {
28 6
        if ($propertyDefinition) {
29
            // Set property metadata
30 5
            $propertyDefinition->setIsPublic($reflectionProperty->isPublic());
31 5
            $propertyDefinition->setModifiers($reflectionProperty->getModifiers());
32
        }
33 6
    }
34
}
35