1 | <?php |
||
18 | class admin_helper |
||
19 | { |
||
20 | /** @var \phpbb\user */ |
||
21 | protected $user; |
||
22 | |||
23 | /** @var \phpbb\template\template */ |
||
24 | protected $template; |
||
25 | |||
26 | /** @var \phpbb\log\log */ |
||
27 | protected $log; |
||
28 | |||
29 | /** @var \phpbb\ads\location\manager */ |
||
30 | protected $location_manager; |
||
31 | |||
32 | /** @var string root_path */ |
||
33 | protected $root_path; |
||
34 | |||
35 | /** @var string php_ext */ |
||
36 | protected $php_ext; |
||
37 | |||
38 | /** |
||
39 | * Constructor |
||
40 | * |
||
41 | * @param \phpbb\user $user User object |
||
42 | * @param \phpbb\template\template $template Template object |
||
43 | * @param \phpbb\log\log $log The phpBB log system |
||
44 | * @param \phpbb\ads\location\manager $location_manager Template location manager object |
||
45 | * @param string $root_path phpBB root path |
||
46 | * @param string $php_ext PHP extension |
||
47 | */ |
||
48 | 12 | public function __construct(\phpbb\user $user, \phpbb\template\template $template, \phpbb\log\log $log, \phpbb\ads\location\manager $location_manager, $root_path, $php_ext) |
|
57 | |||
58 | /** |
||
59 | * Assign template locations data to the template. |
||
60 | * |
||
61 | * @param mixed $ad_locations The form data or nothing. |
||
62 | * @return void |
||
63 | */ |
||
64 | 2 | public function assign_locations($ad_locations = false) |
|
76 | |||
77 | /** |
||
78 | * Assign form data to the template. |
||
79 | * |
||
80 | * @param array $data The form data. |
||
81 | * @return void |
||
82 | */ |
||
83 | 5 | public function assign_form_data($data) |
|
97 | |||
98 | 3 | public function assign_errors(array $errors) |
|
107 | |||
108 | /** |
||
109 | * Log action |
||
110 | * |
||
111 | * @param string $action Performed action in uppercase |
||
112 | * @param string $ad_name Advertisement name |
||
113 | * @return void |
||
114 | */ |
||
115 | 1 | public function log($action, $ad_name) |
|
119 | |||
120 | 1 | public function get_find_username_link() |
|
124 | |||
125 | |||
126 | /** |
||
127 | * Prepare end date for display |
||
128 | * |
||
129 | * @param mixed $end_date End date. |
||
130 | * @return string End date prepared for display. |
||
131 | */ |
||
132 | 5 | protected function prepare_end_date($end_date) |
|
146 | |||
147 | /** |
||
148 | * Prepare ad owner for display. Method takes user_id |
||
149 | * of the ad owner and returns his/her username. |
||
150 | * |
||
151 | * @param int $ad_owner User ID |
||
152 | * @return string Username belonging to $ad_owner. |
||
153 | */ |
||
154 | 5 | protected function prepare_ad_owner($ad_owner) |
|
167 | } |
||
168 |
This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name.
The variable may have been renamed without also renaming all references.