1 | <?php |
||
7 | class ReflectionTest extends \PHPUnit_Framework_TestCase |
||
8 | { |
||
9 | /** |
||
10 | * @var Reflection |
||
11 | */ |
||
12 | protected $object; |
||
13 | |||
14 | /** |
||
15 | * Sets up the fixture, for example, opens a network connection. |
||
16 | * This method is called before a test is executed. |
||
17 | */ |
||
18 | protected function setUp() |
||
22 | |||
23 | /** |
||
24 | * Tears down the fixture, for example, closes a network connection. |
||
25 | * This method is called after a test is executed. |
||
26 | */ |
||
27 | protected function tearDown() |
||
31 | |||
32 | /** |
||
33 | * @covers Koch\Code\Reflection::setClassName |
||
34 | * @covers Koch\Code\Reflection::__construct |
||
35 | */ |
||
36 | public function testSetClassName() |
||
46 | |||
47 | /** |
||
48 | * @covers Koch\Code\Reflection::getClassName |
||
49 | */ |
||
50 | public function testGetClassName() |
||
54 | |||
55 | /** |
||
56 | * @covers Koch\Code\Reflection::getMethods |
||
57 | * @covers Koch\Code\Reflection::__construct |
||
58 | * @covers Koch\Autoload\Loader::autoload |
||
59 | */ |
||
60 | public function testGetMethods() |
||
71 | } |
||
72 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
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.