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

AnnotationClassAnalyzer::analyze()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 3
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