1 | <?php |
||
8 | class BlogController extends Controller |
||
9 | { |
||
10 | /** |
||
11 | * @Route("/blog", name="blog_homepage") |
||
12 | * @return \Symfony\Component\HttpFoundation\Response |
||
13 | */ |
||
14 | public function indexAction() |
||
25 | |||
26 | /** |
||
27 | * @Route("/blog/{year}/{month}/{day}/{slug}", name="blog_show", requirements={ |
||
28 | * "year": "\d+", |
||
29 | * "month": "\d+", |
||
30 | * "day": "\d+" |
||
31 | * }) |
||
32 | * @param $slug |
||
33 | * @return \Symfony\Component\HttpFoundation\Response |
||
34 | */ |
||
35 | public function showAction($slug) |
||
54 | } |
||
55 |
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.