1 | <?php |
||
18 | class Controller implements ContainerAwareInterface |
||
19 | { |
||
20 | use ContainerAwareTrait; |
||
21 | |||
22 | /** |
||
23 | * 渲染模板 |
||
24 | * @param string $view |
||
25 | * @param array $parameters |
||
26 | * @return string |
||
27 | */ |
||
28 | protected function renderView($view, array $parameters = []) |
||
32 | |||
33 | /** |
||
34 | * 渲染模板 |
||
35 | * |
||
36 | * @param string $view |
||
37 | * @param array $parameters |
||
38 | * @return Response\HtmlResponse |
||
39 | */ |
||
40 | protected function render($view, array $parameters = []) |
||
45 | |||
46 | /** |
||
47 | * @param string $id |
||
48 | * @return mixed |
||
49 | */ |
||
50 | protected function get($id) |
||
54 | |||
55 | /** |
||
56 | * Returns a JsonResponse that uses the serializer component if enabled, or json_encode. |
||
57 | * |
||
58 | * @final |
||
59 | */ |
||
60 | protected function json($data, int $status = 200, array $headers = [], array $context = []) |
||
69 | } |
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.