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

AnnotationClassAnalyzer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A analyze() 0 7 1
1
<?php
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
class AnnotationClassAnalyzer extends AbstractAnnotationAnalyzer implements ClassAnalyzerInterface
14
{
15
    public function analyze(
16
        DefinitionAnalyzer $analyzer,
17
        \ReflectionClass $reflectionClass,
18
        ClassDefinition $classDefinition
19
    ) {
20
        $annotations = $this->reader->getClassAnnotations($reflectionClass);
0 ignored issues
show
Unused Code introduced by
$annotations is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
21
    }
22
}
23