Skip to content

Commit

Permalink
MDL-71539 tool_brickfield: PHP8 optional param error fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchurchward committed May 5, 2021
1 parent 4e01410 commit f816040
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions admin/tool/brickfield/classes/accessibility.php
Expand Up @@ -17,7 +17,7 @@
namespace tool_brickfield;

use context_system;
use core\log\sql_reader;
use moodle_exception;
use moodle_url;
use stdClass;
use tool_brickfield\local\tool\filter;
Expand Down Expand Up @@ -59,11 +59,11 @@ public static function is_accessibility_enabled(): bool {
/**
* Throw an error if the toolkit is not enabled.
* @return bool
* @throws \moodle_exception
* @throws moodle_exception
*/
public static function require_accessibility_enabled(): bool {
if (!static::is_accessibility_enabled()) {
print_error('accessibilitydisabled', manager::PLUGINNAME);
throw new moodle_exception('accessibilitydisabled', manager::PLUGINNAME);
}
return true;
}
Expand Down Expand Up @@ -217,10 +217,8 @@ public static function bulk_process_caches_cron() {
* @param int $contentid The content area ID
* @param int $processingtime
* @param int $resultstime
* @throws \coding_exception
* @throws \dml_exception
*/
public static function run_check(string $html = '', int $contentid, int &$processingtime, int &$resultstime) {
public static function run_check(string $html, int $contentid, int &$processingtime, int &$resultstime) {
global $DB;

// Change the limit if 10,000 is not appropriate.
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/brickfield/index.php
Expand Up @@ -58,7 +58,7 @@
if ($courseid != 0) {
// If accessing a course, check that the user has capability to use toolkit at course level.
if (!$course = $DB->get_record('course', ['id' => $courseid], '*')) {
print_error('invalidcourseid', manager::PLUGINNAME);
throw new moodle_exception('invalidcourseid', manager::PLUGINNAME);
}
require_login($course);
$context = context_course::instance($courseid);
Expand Down Expand Up @@ -101,7 +101,7 @@
if (isset($tools[$tab])) {
$tool = $tools[$tab];
} else {
print_error('invalidaccessibilitytool', manager::PLUGINNAME);
throw new moodle_exception('invalidaccessibilitytool', manager::PLUGINNAME);
}

$perpagedefault = $config->perpage;
Expand Down

0 comments on commit f816040

Please sign in to comment.