Skip to content

Commit

Permalink
Make codechecker happy again
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Aug 20, 2024
1 parent d1c6338 commit 3de3380
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions classes/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
4 changes: 2 additions & 2 deletions lang/en/availability_role.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) <em>{$a}</em>';
$string['requires_notrole'] = 'You are not a(n) <em>{$a}</em>';
$string['requires_role'] = 'You are a(n) <em>{$a}</em>';
$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';
6 changes: 3 additions & 3 deletions tests/condition_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* on behalf of Alexander Bias, Ulm University <[email protected]>
* @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.
*/
Expand All @@ -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;
Expand Down Expand Up @@ -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';
Expand Down

0 comments on commit 3de3380

Please sign in to comment.