Skip to content

Commit cbae8b5

Browse files
committed
Fix phpdoc errors
1 parent 611c9d8 commit cbae8b5

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

classes/helper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,18 @@ public static function send_email($courseid) {
252252
/**
253253
* Count broken links
254254
*
255-
* @param $courseid
255+
* @param int $courseid
256256
* @throws \dml_exception
257257
*/
258-
public static function count_broken_links($courseid) {
258+
public static function count_broken_links(int $courseid) {
259259
global $DB;
260260
$sql = "SELECT count(1) AS count
261261
FROM {tool_crawler_url} b
262262
LEFT JOIN {tool_crawler_edge} l ON l.b = b.id
263263
LEFT JOIN {tool_crawler_url} a ON l.a = a.id
264264
LEFT JOIN {course} c ON c.id = a.courseid
265-
WHERE b.httpcode != '200' AND c.id = $courseid";
266-
return $DB->count_records_sql($sql);
265+
WHERE b.httpcode != '200' AND c.id = :courseid";
266+
return $DB->count_records_sql($sql, ['courseid'=> $courseid]);
267267
}
268268

269269
}

classes/table/course_links.php

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,22 @@
3030
use tool_crawler\helper;
3131
use moodle_url;
3232
use html_writer;
33+
use stdClass;
3334

3435
class course_links extends table_sql implements renderable {
3536

3637
private $courseid;
38+
39+
private $page;
3740
/**
3841
* table constructor.
3942
*
40-
* @param $uniqueid table unique id
43+
* @param string $uniqueid table unique id
4144
* @param \moodle_url $url base url
45+
* @param int $courseid course id
4246
* @param int $page current page
4347
* @param int $perpage number of records per page
4448
* @throws \coding_exception
45-
* @throws \coding_exception
4649
*/
4750
public function __construct($uniqueid, \moodle_url $url, $courseid, $page = 0, $perpage = 20) {
4851
parent::__construct($uniqueid);
@@ -165,30 +168,30 @@ public function query_db($pagesize, $useinitialsbar = true) {
165168

166169
/**
167170
*
168-
* @param $row
171+
* @param stdClass $row
169172
* @return string
170173
*/
171-
protected function col_lastcrawledtime($row) {
174+
protected function col_lastcrawledtime(stdClass $row) {
172175
return userdate($row->lastcrawled);
173176
}
174177

175178
/**
176179
*
177-
* @param $row
178-
* @return string
180+
* @param stdClass $row
181+
* @return stdClass $row
179182
* @throws \coding_exception
180183
*/
181-
protected function col_priority($row) {
184+
protected function col_priority(stdClass $row) {
182185
return tool_crawler_priority_level($row->priority);
183186
}
184187

185188
/**
186189
*
187-
* @param $row
190+
* @param stdClass $row
188191
* @return mixed
189192
* @throws \coding_exception
190193
*/
191-
protected function col_httpcode($row) {
194+
protected function col_httpcode(stdClass $row) {
192195
$text = tool_crawler_http_code($row);
193196
if ($translation = \tool_crawler\helper::translate_httpcode($row->httpcode)) {
194197
$text .= "<br/>" . $translation;
@@ -198,11 +201,11 @@ protected function col_httpcode($row) {
198201

199202
/**
200203
*
201-
* @param $row
204+
* @param stdClass $row
202205
* @return mixed
203206
* @throws \coding_exception
204207
*/
205-
protected function col_target($row) {
208+
protected function col_target(stdClass $row) {
206209
$text = trim($row->text);
207210
if ($text == "") {
208211
$text = get_string('missing', 'tool_crawler');
@@ -216,11 +219,11 @@ protected function col_target($row) {
216219

217220
/**
218221
*
219-
* @param $row
222+
* @param stdClass $row
220223
* @return mixed
221224
* @throws \coding_exception
222225
*/
223-
protected function col_url($row) {
226+
protected function col_url(stdClass $row) {
224227
return tool_crawler_link($row->url, $row->title, $row->redirect, false, $this->courseid);
225228
}
226229

locallib.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* @param string $redirect The final URL if a redirect was served.
4343
* @param string $labelishtml Whether the $label parameter contains an HTML snippet (if true) or plain text (if false). Defaults to
4444
* plain text.
45+
* @param int $courseid course id
4546
* @return string HTML snippet which can be used in output.
4647
*/
4748
function tool_crawler_link($url, $label, $redirect = '', $labelishtml = false, $courseid = 0) {
@@ -241,6 +242,7 @@ function tool_crawler_url_gen_table($data) {
241242
* Generates and returns a full HTML page with details about a URL.
242243
*
243244
* @param string $url The URL.
245+
* @param int $courseid course id
244246
* @return string A HTML page about the URL.
245247
*/
246248
function tool_crawler_url_create_page($url, $courseid = 0) {

renderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class tool_crawler_renderer extends plugin_renderer_base {
2929

3030
/**
3131
* Render table.
32-
* @param dismissed_notice $table dismissed notice table
32+
* @param course_links $table course_links table
3333
* @return false|string
3434
*/
3535
public function render_course_links(course_links $table) {

0 commit comments

Comments
 (0)