MDL-77530 tool_task: Fix coding errors in checks

This commit is contained in:
Brendan Heywood 2023-03-07 10:33:51 +11:00 committed by Andrew Nicols
parent 27e0329a08
commit 653ad78f43
3 changed files with 13 additions and 42 deletions

View File

@ -38,21 +38,6 @@ use core\check\result;
*/
class adhocqueue extends check {
/** @var string adhocqueue id. */
protected string $id = '';
/** @var string adhocqueue name. */
protected string $name = '';
/**
* Constructor
*/
public function __construct() {
global $CFG;
$this->id = 'adhocqueue';
$this->name = get_string('checkadhocqueue', 'tool_task');
}
/**
* Return result
* @return result

View File

@ -37,27 +37,15 @@ use core\check\result;
*/
class cronrunning extends check {
/** @var string adhocqueue id. */
protected string $id = '';
/** @var string adhocqueue name. */
protected string $name = '';
/** @var \action_link action link. */
protected $actionlink;
/**
* Constructor
* A link the running tasks report
*
* @return action_link|null
*/
public function __construct() {
global $CFG;
$this->id = 'cronrunning';
$this->name = get_string('checkcronrunning', 'tool_task');
if (empty($CFG->cronclionly)) {
$this->actionlink = new \action_link(
new \moodle_url('/admin/cron.php'),
get_string('cron', 'admin'));
}
public function get_action_link(): ?\action_link {
return new \action_link(
new \moodle_url('/admin/tool/task/runningtasks.php'),
get_string('runningtasks', 'tool_task'));
}
/**

View File

@ -39,15 +39,13 @@ use core\check\result;
class maxfaildelay extends check {
/**
* Constructor
* Links to the task log report
*
* @return \action_link|null
*/
public function __construct() {
global $CFG;
$this->id = 'cronfaildelay';
$this->name = get_string('checkmaxfaildelay', 'tool_task');
$this->actionlink = new \action_link(
new \moodle_url('/admin/tool/task/scheduledtasks.php'),
get_string('scheduledtasks', 'tool_task'));
public function get_action_link(): ?\action_link {
$url = new \moodle_url('/admin/tasklogs.php');
return new \action_link($url, get_string('tasklogs', 'tool_task'));
}
/**