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

ReflectionMethodAnalyzer::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\MethodAnalyzerInterface;
11
use samsonframework\container\definition\ClassDefinition;
12
use samsonframework\container\definition\MethodDefinition;
13
14
/**
15
 * Class ReflectionMethodAnalyzer
16
 *
17
 * @author Ruslan Molodyko <[email protected]>
18
 */
19
class ReflectionMethodAnalyzer implements MethodAnalyzerInterface
20
{
21
    /** {@inheritdoc} */
22 6
    public function analyze(
23
        DefinitionAnalyzer $analyzer,
24
        \ReflectionMethod $reflectionMethod,
25
        ClassDefinition $classDefinition,
26
        MethodDefinition $methodDefinition = null
27
    ) {
28 6
        if ($methodDefinition) {
29
            // Set method metadata
30 6
            $methodDefinition->setModifiers($reflectionMethod->getModifiers());
31 6
            $methodDefinition->setIsPublic($reflectionMethod->isPublic());
32
        }
33 6
    }
34
}
35