1 | <?php |
||
17 | class RouteTest extends TestCase |
||
18 | { |
||
19 | public function routeMethodDataProvider(): array |
||
28 | |||
29 | /** |
||
30 | * @test |
||
31 | * @dataProvider routeMethodDataProvider |
||
32 | */ |
||
33 | public function objectCanBeCreated($method): void |
||
39 | |||
40 | /** |
||
41 | * @test |
||
42 | */ |
||
43 | public function objectCanNotBeCreatedWithWrongMethod(): void |
||
48 | |||
49 | /** |
||
50 | * @test |
||
51 | * @dataProvider routeMethodDataProvider |
||
52 | */ |
||
53 | public function objectCanNotBeCreatedWithLowerCaseMethods($method): void |
||
58 | } |
||
59 |
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.