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 ffd769e commit 69dff79
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions classes/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ protected function get_javascript_strings() {
*
* @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) {
// Get course context.
$context = \context_course::instance($course->id);
// Get all cohorts.
Expand Down Expand Up @@ -94,8 +94,8 @@ protected function get_all_current_context_cohorts($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) {

// Only show this option if there are some cohorts.
return count($this->get_all_current_context_cohorts(\context_course::instance($course->id))) > 0;
Expand Down
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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_cohort.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

$string['anycohort'] = '(Any cohort)';
$string['description'] = 'Allow only students who belong to a specified cohort.';
$string['error_selectcohort'] = 'You must select a cohort.';
$string['missing'] = '(Missing cohort)';
$string['pluginname'] = 'Restriction by cohort';
$string['error_selectcohort'] = 'You must select a cohort.';
$string['privacy:metadata'] = 'The Restriction by cohort plugin does not store any personal data.';
$string['requires_anycohort'] = 'You belong to <strong>any cohort</strong>';
$string['requires_cohort'] = 'You belong to <strong>{$a}</strong>';
$string['requires_notanycohort'] = 'You do <strong>not</strong> belong to <strong>any cohort</strong>';
$string['requires_notcohort'] = 'You do <strong>not</strong> belong to <strong>{$a}</strong>';
$string['title'] = 'Cohort';
$string['privacy:metadata'] = 'The Restriction by cohort plugin does not store any personal data.';
8 changes: 4 additions & 4 deletions tests/condition_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* based on code of availability_group 2014 The Open 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.
*/
Expand All @@ -49,7 +49,7 @@ public function setUp(): void {
* @covers \availability_cohort\condition::is_available()
* @covers \availability_cohort\condition::get_description()
*/
public function test_usage() {
public function test_usage(): void {
global $CFG, $USER;
$this->resetAfterTest();
$CFG->enableavailability = true;
Expand Down Expand Up @@ -112,7 +112,7 @@ public function test_usage() {
*
* @covers \availability_cohort\condition::__construct()
*/
public function test_constructor() {
public function test_constructor(): void {
// Invalid id (not int).
$structure = (object)['id' => 'bourne'];
try {
Expand All @@ -138,7 +138,7 @@ public function test_constructor() {
*
* @covers \availability_cohort\condition::save()
*/
public function test_save() {
public function test_save(): void {
$structure = (object)['id' => 123];
$cond = new condition($structure);
$structure->type = 'cohort';
Expand Down

0 comments on commit 69dff79

Please sign in to comment.