AnnotationClassAnalyzer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A analyze() 0 13 3
1
<?php declare(strict_types=1);
0 ignored issues
show
Coding Style introduced by
End of line character is invalid; expected "\n" but found "\r\n"
Loading history...
2
/**
3
 * Created by Ruslan Molodyko.
4
 * Date: 10.09.2016
5
 * Time: 17:48
6
 */
7
namespace samsonframework\container\definition\analyzer\annotation;
8
9
use samsonframework\container\definition\analyzer\ClassAnalyzerInterface;
10
use samsonframework\container\definition\analyzer\DefinitionAnalyzer;
11
use samsonframework\container\definition\ClassDefinition;
12
13
/**
14
 * Class AnnotationClassAnalyzer
15
 *
16
 * @author Ruslan Molodyko <[email protected]>
17
 */
18
class AnnotationClassAnalyzer extends AbstractAnnotationAnalyzer implements ClassAnalyzerInterface
19
{
20
    /**
21
     * Analyze class
22
     *
23
     * @param DefinitionAnalyzer $analyzer
24
     * @param \ReflectionClass $reflectionClass
25
     * @param ClassDefinition $classDefinition
26
     */
27
    public function analyze(
28
        DefinitionAnalyzer $analyzer,
29
        ClassDefinition $classDefinition,
30
        \ReflectionClass $reflectionClass
31
    ) {
32
        $annotations = $this->reader->getClassAnnotations($reflectionClass);
33
        // Exec class annotations
34
        foreach ($annotations as $annotation) {
35
            if ($annotation instanceof ResolveClassInterface) {
36
                $annotation->resolveClass($analyzer, $classDefinition, $reflectionClass);
37
            }
38
        }
39
    }
40
}
41