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

ReflectionPropertyAnalyzer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A analyze() 0 12 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