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 6fe97ca commit b9d02ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
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 classes/profiletheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function output_form() {
* Called after the user has logged in, to apply any mappings and set the session theme
* @param \core\event\base|null $event
*/
public static function set_theme_from_profile(\core\event\base $event = null) {
public static function set_theme_from_profile(?\core\event\base $event = null) {
global $USER, $SESSION;

if ($event && $event->userid != $USER->id) {
Expand All @@ -69,7 +69,7 @@ public static function set_theme_from_profile(\core\event\base $event = null) {
* Called after the user has logged in as another user, to apply any mappings and set the session theme
* @param \core\event\base|null $event
*/
public static function set_theme_from_profile_loginas(\core\event\base $event = null) {
public static function set_theme_from_profile_loginas(?\core\event\base $event = null) {
global $USER, $SESSION;

if ($event && $event->relateduserid != $USER->id) {
Expand Down
18 changes: 9 additions & 9 deletions tests/rules_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @copyright 2016 Davo Smith, Synergy Learning UK on behalf of Alexander Bias, Ulm University <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class rules_test extends \advanced_testcase {
final class rules_test extends \advanced_testcase {

/** @var int[] mapping user profile field shortname => field id */
protected $fieldids = [];
Expand Down Expand Up @@ -75,7 +75,7 @@ public function setUp(): void {
* It is adopted from block_html and does not have a coverage tag there either. Thus, we set coversNothing.
* @coversNothing
*/
public function test_create_rules() {
public function test_create_rules(): void {
// Create a 'checkbox' rule.
$ruledata = (object) [
'fieldid' => $this->fieldids['checkboxfield'], 'datatype' => 'checkbox',
Expand Down Expand Up @@ -152,7 +152,7 @@ public function test_create_rules() {
* It is adopted from block_html and does not have a coverage tag there either. Thus, we set coversNothing.
* @coversNothing
*/
public function test_update_rule() {
public function test_update_rule(): void {
// Create a 'text' rule.
$ruledata = (object) [
'fieldid' => $this->fieldids['textfield'], 'datatype' => 'text',
Expand Down Expand Up @@ -197,7 +197,7 @@ public function test_update_rule() {
* It is adopted from block_html and does not have a coverage tag there either. Thus, we set coversNothing.
* @coversNothing
*/
public function test_delete_rule() {
public function test_delete_rule(): void {
// Create a 'text' rule.
$ruledata = (object) [
'fieldid' => $this->fieldids['textfield'], 'datatype' => 'text',
Expand Down Expand Up @@ -235,7 +235,7 @@ public function test_delete_rule() {
* It is adopted from block_html and does not have a coverage tag there either. Thus, we set coversNothing.
* @coversNothing
*/
public function test_update_from_form_data() {
public function test_update_from_form_data(): void {
// Create a 'text' rule + reload.
$ruledata = (object) [
'fieldid' => $this->fieldids['textfield'], 'datatype' => 'text',
Expand Down Expand Up @@ -329,7 +329,7 @@ public function test_update_from_form_data() {
* It is adopted from block_html and does not have a coverage tag there either. Thus, we set coversNothing.
* @coversNothing
*/
public function test_match_checkbox() {
public function test_match_checkbox(): void {
global $DB;
// Set up 3 users:
// user1 has profile field unchecked.
Expand Down Expand Up @@ -373,7 +373,7 @@ public function test_match_checkbox() {
* It is adopted from block_html and does not have a coverage tag there either. Thus, we set coversNothing.
* @coversNothing
*/
public function test_match_menu() {
public function test_match_menu(): void {
global $DB;
// Set up 3 users:
// user1 has profile field 'Opt 1'.
Expand Down Expand Up @@ -417,7 +417,7 @@ public function test_match_menu() {
* It is adopted from block_html and does not have a coverage tag there either. Thus, we set coversNothing.
* @coversNothing
*/
public function test_match_text() {
public function test_match_text(): void {
global $DB;
// Set up 3 users:
// user1 has profile field 'Testing ABC'.
Expand Down Expand Up @@ -503,7 +503,7 @@ public function test_match_text() {
* It is adopted from block_html and does not have a coverage tag there either. Thus, we set coversNothing.
* @coversNothing
*/
public function test_and_rules() {
public function test_and_rules(): void {
global $DB;

// Set up a user with 'menufield' set to 'Opt 1', 'checkboxfield' set to 'No', 'textfield' set to 'Fred'.
Expand Down

0 comments on commit b9d02ec

Please sign in to comment.