1 | <?php |
||
7 | final class RenderContext |
||
8 | { |
||
9 | public $render; |
||
10 | public $template; |
||
11 | |||
12 | private $func_stack; |
||
13 | |||
14 | public function __construct( |
||
23 | |||
24 | public function __get($name) { |
||
36 | |||
37 | public function __set($name, $value) { |
||
40 | |||
41 | public function __call($name, array $args) { |
||
54 | |||
55 | public function __invoke(...$args) { |
||
68 | |||
69 | public static function factory($func_stack = null) { |
||
80 | } |
||
81 |
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.