1 | <?php |
||
12 | class routes |
||
13 | { |
||
14 | /** @var \phpbb\cache\driver\driver_interface */ |
||
15 | protected $cache; |
||
16 | |||
17 | /** @var \phpbb\config\config */ |
||
18 | protected $config; |
||
19 | |||
20 | /** @var \phpbb\user */ |
||
21 | protected $user; |
||
22 | |||
23 | /** @var \blitze\sitemaker\services\blocks\factory */ |
||
24 | protected $block_factory; |
||
25 | |||
26 | /** @var \blitze\sitemaker\model\mapper_factory */ |
||
27 | protected $mapper_factory; |
||
28 | |||
29 | /** @var string phpEx */ |
||
30 | protected $php_ext; |
||
31 | |||
32 | public $sub_route = false; |
||
33 | |||
34 | /** |
||
35 | * Constructor |
||
36 | * |
||
37 | * @param \phpbb\cache\driver\driver_interface $cache Cache driver interface |
||
38 | * @param \phpbb\config\config $config Config object |
||
39 | * @param \phpbb\user $user User object |
||
40 | * @param \blitze\sitemaker\services\blocks\factory $block_factory Blocks factory object |
||
41 | * @param \blitze\sitemaker\model\mapper_factory $mapper_factory Mapper factory object |
||
42 | * @param string $php_ext phpEx |
||
43 | */ |
||
44 | 33 | public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\config\config $config, \phpbb\user $user, \blitze\sitemaker\services\blocks\factory $block_factory, \blitze\sitemaker\model\mapper_factory $mapper_factory, $php_ext) |
|
53 | |||
54 | /** |
||
55 | * @param string $current_route |
||
56 | * @param string $page_dir |
||
57 | * @param int $style_id |
||
58 | * @param bool|false $edit_mode |
||
59 | * @return array |
||
60 | */ |
||
61 | 19 | public function get_route_info($current_route, $page_dir, $style_id, $edit_mode = false) |
|
78 | |||
79 | /** |
||
80 | * @param array $route_info |
||
81 | * @param int $style_id |
||
82 | * @param bool $edit_mode |
||
83 | * @return array |
||
84 | */ |
||
85 | 19 | public function get_blocks_for_route(array $route_info, $style_id, $edit_mode) |
|
92 | |||
93 | /** |
||
94 | * @param array $df_settings |
||
95 | * @param array $db_settings |
||
96 | * @return array |
||
97 | */ |
||
98 | 33 | public function sync_settings(array $df_settings, array $db_settings = array()) |
|
112 | |||
113 | /** |
||
114 | * Clear blocks cache |
||
115 | */ |
||
116 | public function clear_cache() |
||
121 | |||
122 | /** |
||
123 | * @param bool $edit_mode |
||
124 | * @return array |
||
125 | */ |
||
126 | 19 | protected function get_cached_blocks($edit_mode) |
|
136 | |||
137 | /** |
||
138 | * @return array |
||
139 | */ |
||
140 | 19 | protected function get_all_blocks() |
|
165 | |||
166 | /** |
||
167 | * @return array|mixed |
||
168 | */ |
||
169 | 19 | protected function get_all_routes() |
|
189 | |||
190 | /** |
||
191 | * @param array $all_routes |
||
192 | * @param string $current_route |
||
193 | * @param string $page_dir |
||
194 | * @param int $style_id |
||
195 | * @param bool $edit_mode |
||
196 | * @return array |
||
197 | */ |
||
198 | 9 | protected function get_default_route_info(array $all_routes, $current_route, $page_dir, $style_id, $edit_mode, &$is_sub_route) |
|
218 | |||
219 | /** |
||
220 | * @param array $all_routes |
||
221 | * @param string $current_route |
||
222 | * @param string $page_dir |
||
223 | * @param int $style_id |
||
224 | * @param bool $is_sub_route |
||
225 | * @return string |
||
226 | */ |
||
227 | 7 | protected function get_parent_route(array $all_routes, $current_route, $page_dir, $style_id, &$is_sub_route) |
|
244 | |||
245 | /** |
||
246 | * @param array $routes |
||
247 | * @param string $current_route |
||
248 | * @param bool $is_sub_route |
||
249 | * @return string |
||
250 | */ |
||
251 | 4 | protected function get_virtual_parent(array $routes, $current_route, &$is_sub_route) |
|
267 | |||
268 | /** |
||
269 | * @param array $all_routes |
||
270 | * @param int $style_id |
||
271 | * @return array |
||
272 | */ |
||
273 | 4 | protected function get_routes_for_style(array $all_routes, $style_id) |
|
277 | |||
278 | /** |
||
279 | * @param array $route_info |
||
280 | * @param int $style_id |
||
281 | * @param bool $edit_mode |
||
282 | * @return int |
||
283 | */ |
||
284 | 19 | protected function get_display_route_id(array $route_info, $style_id, $edit_mode) |
|
295 | |||
296 | /** |
||
297 | * @param array $blocks |
||
298 | * @param bool $edit_mode |
||
299 | */ |
||
300 | 19 | protected function cache_block(array $blocks, $edit_mode) |
|
307 | } |
||
308 |
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.