1 | <?php |
||
25 | class Extra extends ViewAbstract |
||
26 | { |
||
27 | /** |
||
28 | * instance of the request class |
||
29 | * |
||
30 | * @var Request |
||
31 | */ |
||
32 | |||
33 | protected $_request; |
||
34 | |||
35 | /** |
||
36 | * instance of the config class |
||
37 | * |
||
38 | * @var Config |
||
39 | */ |
||
40 | |||
41 | protected $_config; |
||
42 | |||
43 | /** |
||
44 | * options of the extra |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | |||
49 | protected $_optionArray = |
||
50 | [ |
||
51 | 'tag' => |
||
52 | [ |
||
53 | 'title' => 'h3', |
||
54 | 'box' => 'div' |
||
55 | ], |
||
56 | 'className' => |
||
57 | [ |
||
58 | 'title' => 'rs-title-extra', |
||
59 | 'box' => 'rs-box-extra' |
||
60 | ], |
||
61 | 'orderColumn' => 'rank' |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * constructor of the class |
||
66 | * |
||
67 | * @since 4.0.0 |
||
68 | * |
||
69 | * @param Registry $registry instance of the registry class |
||
70 | * @param Request $request instance of the request class |
||
71 | * @param Language $language instance of the language class |
||
72 | * @param Config $config instance of the config class |
||
73 | */ |
||
74 | |||
75 | public function __construct(Registry $registry, Request $request, Language $language, Config $config) |
||
81 | |||
82 | /** |
||
83 | * stringify the extra |
||
84 | * |
||
85 | * @since 4.0.0 |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | |||
90 | public function __toString() : string |
||
94 | |||
95 | /** |
||
96 | * init the class |
||
97 | * |
||
98 | * @since 4.0.0 |
||
99 | * |
||
100 | * @param array $optionArray options of the extra |
||
101 | */ |
||
102 | |||
103 | public function init(array $optionArray = []) |
||
107 | |||
108 | /** |
||
109 | * render the view |
||
110 | * |
||
111 | * @since 4.0.0 |
||
112 | * |
||
113 | * @param int $extraId identifier of the extra |
||
114 | * |
||
115 | * @return string |
||
116 | */ |
||
117 | |||
118 | public function render(int $extraId = null) : string |
||
195 | } |
||
196 |
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.