Merge branch 'MDL-71539_master_PHP8optionalparams' of https://github.com/brickfield/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2021-05-05 20:00:17 +02:00
commit 3a839a62c6
2 changed files with 6 additions and 8 deletions

View File

@ -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;
@ -59,11 +59,11 @@ class accessibility {
/**
* 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;
}
@ -217,10 +217,8 @@ class accessibility {
* @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.

View File

@ -58,7 +58,7 @@ $layout = optional_param('layout', 'admin', PARAM_ALPHA);
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);
@ -101,7 +101,7 @@ $tools = tool::build_all_accessibilitytools();
if (isset($tools[$tab])) {
$tool = $tools[$tab];
} else {
print_error('invalidaccessibilitytool', manager::PLUGINNAME);
throw new moodle_exception('invalidaccessibilitytool', manager::PLUGINNAME);
}
$perpagedefault = $config->perpage;