1 | <?php |
||
27 | class Article extends ViewAbstract |
||
28 | { |
||
29 | /** |
||
30 | * instance of the request class |
||
31 | * |
||
32 | * @var Request |
||
33 | */ |
||
34 | |||
35 | protected $_request; |
||
36 | |||
37 | /** |
||
38 | * instance of the config class |
||
39 | * |
||
40 | * @var Config |
||
41 | */ |
||
42 | |||
43 | protected $_config; |
||
44 | |||
45 | /** |
||
46 | * options of the article |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | |||
51 | protected $_optionArray = |
||
52 | [ |
||
53 | 'tag' => |
||
54 | [ |
||
55 | 'title' => 'h2', |
||
56 | 'box' => 'div' |
||
57 | ], |
||
58 | 'className' => |
||
59 | [ |
||
60 | 'title' => 'rs-title-content', |
||
61 | 'box' => 'rs-box-content' |
||
62 | ], |
||
63 | 'orderColumn' => 'rank', |
||
64 | 'partial' => |
||
65 | [ |
||
66 | 'error' => 'error.phtml' |
||
67 | ] |
||
68 | ]; |
||
69 | |||
70 | /** |
||
71 | * constructor of the class |
||
72 | * |
||
73 | * @since 4.0.0 |
||
74 | * |
||
75 | * @param Registry $registry instance of the registry class |
||
76 | * @param Request $request instance of the request class |
||
77 | * @param Language $language instance of the language class |
||
78 | * @param Config $config instance of the config class |
||
79 | */ |
||
80 | |||
81 | public function __construct(Registry $registry, Request $request, Language $language, Config $config) |
||
87 | |||
88 | /** |
||
89 | * stringify the article |
||
90 | * |
||
91 | * @since 4.0.0 |
||
92 | * |
||
93 | * @return string |
||
94 | */ |
||
95 | |||
96 | public function __toString() : string |
||
100 | |||
101 | /** |
||
102 | * init the class |
||
103 | * |
||
104 | * @since 4.0.0 |
||
105 | * |
||
106 | * @param array $optionArray options of the article |
||
107 | */ |
||
108 | |||
109 | public function init(array $optionArray = []) : void |
||
113 | |||
114 | /** |
||
115 | * render the view |
||
116 | * |
||
117 | * @since 4.0.0 |
||
118 | * |
||
119 | * @param int $categoryId identifier of the category |
||
120 | * @param int $articleId identifier of the article |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | |||
125 | public function render(int $categoryId = null, int $articleId = null) : string |
||
200 | |||
201 | /** |
||
202 | * query the articles |
||
203 | * |
||
204 | * @since 4.0.0 |
||
205 | * |
||
206 | * @param int $categoryId identifier of the category |
||
207 | * @param int $articleId identifier of the article |
||
208 | * |
||
209 | * @return object|null |
||
210 | */ |
||
211 | |||
212 | public function queryArticles(int $categoryId = null, int $articleId = null) : ?object |
||
235 | } |
||
236 |
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.