diff --git a/classes/frontend.php b/classes/frontend.php
index f72a438..0c7f4e2 100644
--- a/classes/frontend.php
+++ b/classes/frontend.php
@@ -44,7 +44,7 @@ class frontend extends \core_availability\frontend {
*
* @return array
*/
- protected function get_javascript_init_params($course, \cm_info $cm = null, \section_info $section = null) {
+ protected function get_javascript_init_params($course, ?\cm_info $cm = null, ?\section_info $section = null) {
// Change to JS array format and return.
$jsarray = [];
$context = \context_course::instance($course->id);
@@ -113,7 +113,7 @@ protected function get_course_roles($context) {
*
* @return bool
*/
- protected function allow_add($course, \cm_info $cm = null, \section_info $section = null) {
+ protected function allow_add($course, ?\cm_info $cm = null, ?\section_info $section = null) {
return true;
}
}
diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php
index 5ff49f1..54e7335 100644
--- a/classes/privacy/provider.php
+++ b/classes/privacy/provider.php
@@ -39,7 +39,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
*
* @return string
*/
- public static function get_reason() : string {
+ public static function get_reason(): string {
return 'privacy:metadata';
}
}
diff --git a/lang/en/availability_role.php b/lang/en/availability_role.php
index d017aa2..dc6bd61 100644
--- a/lang/en/availability_role.php
+++ b/lang/en/availability_role.php
@@ -28,13 +28,13 @@
$string['description'] = 'Allow only users with a specified course role.';
$string['error_selectrole'] = 'You must select a role';
$string['missing'] = '[Missing role]';
-$string['title'] = 'Role';
$string['pluginname'] = 'Restriction by course role';
$string['privacy:metadata'] = 'The Restriction by course role plugin does not store any personal data.';
-$string['requires_role'] = 'You are a(n) {$a}';
$string['requires_notrole'] = 'You are not a(n) {$a}';
+$string['requires_role'] = 'You are a(n) {$a}';
$string['setting_supportedrolesheading'] = 'Supported roles';
$string['setting_supportguestrole'] = 'Guest role';
$string['setting_supportguestrole_desc'] = 'If activated, the availability of activities can be restricted to or forbidden for users that are viewing a course as guest.';
$string['setting_supportnotloggedinrole'] = 'Not-logged-in role';
$string['setting_supportnotloggedinrole_desc'] = 'If activated, the availability of activities can be restricted to or forbidden for users that are not logged in.';
+$string['title'] = 'Role';
diff --git a/tests/condition_test.php b/tests/condition_test.php
index 7dfbdb2..dde5e73 100644
--- a/tests/condition_test.php
+++ b/tests/condition_test.php
@@ -33,7 +33,7 @@
* on behalf of Alexander Bias, Ulm University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-class condition_test extends \advanced_testcase {
+final class condition_test extends \advanced_testcase {
/**
* Load required classes.
*/
@@ -49,7 +49,7 @@ public function setUp(): void {
* @covers \availability_role\condition::is_available()
* @covers \availability_role\condition::get_description()
*/
- public function test_usage() {
+ public function test_usage(): void {
global $CFG, $USER, $DB;
$this->resetAfterTest();
$CFG->enableavailability = true;
@@ -82,7 +82,7 @@ public function test_usage() {
*
* @covers \availability_role\condition::save()
*/
- public function test_save() {
+ public function test_save(): void {
$structure = (object)['id' => 123];
$cond = new condition($structure);
$structure->type = 'role';