Skip to content

Commit 2eeb77d

Browse files
committed
Codechecker Fixes #122
1 parent 541ecda commit 2eeb77d

File tree

6 files changed

+29
-22
lines changed

6 files changed

+29
-22
lines changed

backup/moodle2/backup_mooduell_activity_task.class.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
* Provides the steps to perform one complete backup of the Page instance
3232
*/
3333
class backup_mooduell_activity_task extends backup_activity_task {
34-
3534
/**
3635
* No specific settings for this activity
3736
*/
@@ -57,11 +56,11 @@ public static function encode_content_links($content) {
5756
$base = preg_quote($CFG->wwwroot, "/");
5857

5958
// Link to the list of pxages.
60-
$search = "/(".$base."\/mod\/mooduell\/index.php\?id\=)([0-9]+)/";
59+
$search = "/(" . "$base" . "\/mod\/mooduell\/index.php\?id\=)([0-9]+)/";
6160
$content = preg_replace($search, '$@MODUELLINDEX*$2@$', $content);
6261

6362
// Link to pxage view by moduleid.
64-
$search = "/(".$base."\/mod\/mooduell\/view.php\?id\=)([0-9]+)/";
63+
$search = "/(" . "$base" . "\/mod\/mooduell\/view.php\?id\=)([0-9]+)/";
6564
$content = preg_replace($search, '$@MOODUELLVIEWBYID*$2@$', $content);
6665

6766
return $content;

backup/moodle2/backup_mooduell_stepslib.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
* Define the complete mooduell structure for backup, with file and id annotations
3131
*/
3232
class backup_mooduell_activity_structure_step extends backup_activity_structure_step {
33-
3433
/**
3534
* define structure.
3635
* @return backup_nested_element

backup/moodle2/restore_mooduell_activity_task.class.php

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
* mooduell restore task that provides all the settings and steps to perform one complete restore of the activity
3131
*/
3232
class restore_mooduell_activity_task extends restore_activity_task {
33-
3433
/**
3534
* Define (add) particular settings this activity can have.
3635
*/
@@ -53,9 +52,11 @@ protected function define_my_steps() {
5352
public static function define_decode_contents() {
5453
$contents = [];
5554

56-
$contents[] = new restore_decode_content('mooduell',
57-
['intro', 'content'],
58-
'mooduell');
55+
$contents[] = new restore_decode_content(
56+
'mooduell',
57+
['intro', 'content'],
58+
'mooduell'
59+
);
5960
return $contents;
6061
}
6162

@@ -66,11 +67,13 @@ public static function define_decode_contents() {
6667
public static function define_decode_rules() {
6768
$rules = [];
6869

69-
$rules[] = new restore_decode_rule('MOODUELLVIEWBYID',
70-
'/mod/mooduell/view.php?id=$1', 'course_module');
70+
$rules[] = new restore_decode_rule(
71+
'MOODUELLVIEWBYID',
72+
'/mod/mooduell/view.php?id=$1',
73+
'course_module'
74+
);
7175

7276
return $rules;
73-
7477
}
7578

7679
/**
@@ -80,8 +83,12 @@ public static function define_decode_rules() {
8083
public static function define_restore_log_rules() {
8184
$rules = [];
8285

83-
$rules[] = new restore_log_rule('mooduell',
84-
'view', 'view.php?id={course_module}', '{mooduell}');
86+
$rules[] = new restore_log_rule(
87+
'mooduell',
88+
'view',
89+
'view.php?id={course_module}',
90+
'{mooduell}'
91+
);
8592

8693
return $rules;
8794
}
@@ -97,8 +104,12 @@ public static function define_restore_log_rules() {
97104
public static function define_restore_log_rules_for_course() {
98105
$rules = [];
99106

100-
$rules[] = new restore_log_rule('mooduell',
101-
'view all', 'index.php?id={course}', null);
107+
$rules[] = new restore_log_rule(
108+
'mooduell',
109+
'view all',
110+
'index.php?id={course}',
111+
null
112+
);
102113

103114
return $rules;
104115
}

backup/moodle2/restore_mooduell_stepslib.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
* Structure step to restore one mooduell activity
3131
*/
3232
class restore_mooduell_activity_structure_step extends restore_activity_structure_step {
33-
3433
/**
3534
* define structure
3635
* @return mixed
@@ -114,7 +113,6 @@ protected function process_mooduell_games($data) {
114113
$newgameitemid = $DB->insert_record('mooduell_games', $data);
115114

116115
$this->set_mapping('mooduell_game', $oldid, $newgameitemid);
117-
118116
}
119117

120118
/**

classes/privacy/provider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ class provider implements
4242
// This plugin stores personal data.
4343
\core_privacy\local\metadata\provider,
4444

45-
// This plugin is a core_user_data_provider.
46-
\core_privacy\local\request\plugin\provider,
47-
4845
// This plugin is capable of determining which users have data within it.
49-
\core_privacy\local\request\core_userlist_provider {
46+
\core_privacy\local\request\core_userlist_provider,
47+
48+
// This plugin is a core_user_data_provider.
49+
\core_privacy\local\request\plugin\provider {
5050
/**
5151
* Return the fields which contain personal data.
5252
* @param collection $collection a reference to the collection to use to store the metadata.

lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ function mooduell_pluginfile($course, $cm, $context, $filearea, $args, $forcedow
341341
// We can now send the file back to the browser - in this case with a cache lifetime of 1 day and no filtering.
342342
send_stored_file($file, 86400, 0, $forcedownload, $options);
343343
}
344-
};
344+
}
345345

346346
/**
347347
* Serves files for question text in MooDuell.

0 commit comments

Comments
 (0)