1 | <?php |
||
12 | abstract class base_view implements views_interface |
||
13 | { |
||
14 | /** @var \phpbb\event\dispatcher_interface */ |
||
15 | protected $phpbb_dispatcher; |
||
16 | |||
17 | /** @var\phpbb\language\language */ |
||
18 | protected $language; |
||
19 | |||
20 | /** @var \phpbb\pagination */ |
||
21 | protected $pagination; |
||
22 | |||
23 | /** @var \phpbb\template\template */ |
||
24 | protected $template; |
||
25 | |||
26 | /* @var \blitze\content\services\fields */ |
||
27 | protected $fields; |
||
28 | |||
29 | /** @var \blitze\sitemaker\services\forum\data */ |
||
30 | protected $forum; |
||
31 | |||
32 | /* @var \blitze\content\services\helper */ |
||
33 | protected $helper; |
||
34 | |||
35 | /* @var \blitze\content\services\quickmod */ |
||
36 | protected $quickmod; |
||
37 | |||
38 | /** @var \blitze\content\services\topic\blocks_factory */ |
||
39 | protected $topic_blocks_factory; |
||
40 | |||
41 | /** |
||
42 | * Constructor |
||
43 | * |
||
44 | * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object |
||
45 | * @param \phpbb\language\language $language Language Object |
||
46 | * @param \phpbb\pagination $pagination Pagination object |
||
47 | * @param \phpbb\template\template $template Template object |
||
48 | * @param \blitze\content\services\fields $fields Content fields object |
||
49 | * @param \blitze\sitemaker\services\forum\data $forum Forum Data object |
||
50 | * @param \blitze\content\services\helper $helper Content helper object |
||
51 | * @param \blitze\content\services\quickmod $quickmod Quick moderator tools |
||
52 | * @param \blitze\content\services\topic\blocks_factory $topic_blocks_factory Topic blocks factory object |
||
53 | */ |
||
54 | public function __construct(\phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\language\language $language, \phpbb\pagination $pagination, \phpbb\template\template $template, \blitze\content\services\fields $fields, \blitze\sitemaker\services\forum\data $forum, \blitze\content\services\helper $helper, \blitze\content\services\quickmod $quickmod, \blitze\content\services\topic\blocks_factory $topic_blocks_factory) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function get_detail_template() |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function build_index_query(array $filters, \blitze\content\model\entity\type $entity = null) |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | * @param array $topic_data_overwrite |
||
93 | */ |
||
94 | public function render_index(\blitze\content\model\entity\type $entity, $page, array $filters, array $topic_data_overwrite = array()) |
||
118 | |||
119 | /** |
||
120 | * @param \blitze\content\model\entity\type $entity |
||
121 | * @param int $items_per_page |
||
122 | * @param int $start |
||
123 | * @param array $topic_data_overwrite |
||
124 | * @return int |
||
125 | */ |
||
126 | protected function display_topics(\blitze\content\model\entity\type $entity, $items_per_page = 1, $start = 0, array $topic_data_overwrite = array()) |
||
156 | |||
157 | /** |
||
158 | * {@inheritdoc} |
||
159 | * @param array $topic_data_overwrite |
||
160 | */ |
||
161 | public function render_detail(\blitze\content\model\entity\type $entity, $topic_id, array &$update_count, array $topic_data_overwrite = array()) |
||
175 | |||
176 | /** |
||
177 | * @param int $topic_id |
||
178 | * @param \blitze\content\model\entity\type $entity |
||
179 | * @param array $update_count |
||
180 | * @param array $topic_data_overwrite |
||
181 | * @return array |
||
182 | * @throws \Exception |
||
183 | */ |
||
184 | protected function display_topic($topic_id, \blitze\content\model\entity\type $entity, array &$update_count, array $topic_data_overwrite) |
||
222 | |||
223 | /** |
||
224 | * @param array $attachments |
||
225 | * @param int $post_id |
||
226 | * @return void |
||
227 | */ |
||
228 | protected function show_attachments(array $attachments, $post_id) |
||
240 | |||
241 | /** |
||
242 | * @param string $view_mode |
||
243 | * @param int $total_topics |
||
244 | * @param int $start |
||
245 | * @param int $items_per_page |
||
246 | * @param array $params |
||
247 | */ |
||
248 | protected function generate_pagination($view_mode, $total_topics, &$start, $items_per_page, array $params) |
||
264 | |||
265 | /** |
||
266 | * @param string $view_mode |
||
267 | * @param array $params |
||
268 | * @return string |
||
269 | */ |
||
270 | protected function get_route_type($view_mode, array $params) |
||
283 | |||
284 | /** |
||
285 | * {@inheritdoc} |
||
286 | */ |
||
287 | protected function get_filter_sql(array $filters, $forum_id) |
||
304 | |||
305 | /** |
||
306 | * @param \blitze\content\model\entity\type $entity |
||
307 | * @param array $topic_data |
||
308 | * @param array $post_data |
||
309 | * @param array $user_cache |
||
310 | * @return void |
||
311 | */ |
||
312 | protected function show_topic_blocks(\blitze\content\model\entity\type $entity, array $topic_data, array $post_data, array $user_cache) |
||
323 | |||
324 | /** |
||
325 | * @param int $forum_id |
||
326 | * @param int $topic_id |
||
327 | * @return void |
||
328 | */ |
||
329 | protected function set_mcp_url($forum_id, $topic_id = 0) |
||
333 | |||
334 | /** |
||
335 | * @param array $field_types |
||
336 | * @param array $topic_data |
||
337 | * @return array |
||
338 | */ |
||
339 | protected function set_meta_tags(array $field_types, array $topic_data) |
||
354 | |||
355 | /** |
||
356 | * @param array $field_types |
||
357 | * @param array $fields_data |
||
358 | * @return string |
||
359 | */ |
||
360 | protected function get_topic_image_url(array $field_types, array $fields_data) |
||
372 | |||
373 | /** |
||
374 | * @param array $field_types |
||
375 | * @param array $fields_data |
||
376 | * @return string |
||
377 | */ |
||
378 | protected function get_topic_description(array $field_types, array $fields_data) |
||
389 | } |
||
390 |
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.