Skip to content

Commit

Permalink
Fix false coding style warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Apr 16, 2024
1 parent 22caa95 commit 5eeeda6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/event/question_version_imported.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
*/
class question_version_imported extends question_base {

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
protected function init() {
parent::init();
$this->data['crud'] = 'u';
}

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['questionbankentryid'])) {
Expand All @@ -52,20 +54,24 @@ protected function validate_data() {
}
}

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public static function get_name() {
return get_string('event:question_version_imported', 'qbank_importasversion');
}

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public function get_description() {
return "The user with id '$this->userid' imported a new version " .
"'{$this->other['version']}' (question id '$this->objectid') of the " .
"question bank entry with id '{$this->other['questionbankentryid']}' in course '$this->courseid'.";
}

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public static function get_objectid_mapping() {
return ['db' => 'question', 'restore' => 'question'];
}

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public static function get_other_mapping() {
return [
'questionbankentryid' => ['db' => 'question_bank_entries', 'restore' => 'question_bank_entries'],
Expand Down
4 changes: 4 additions & 0 deletions classes/import_as_version_action_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,23 @@ class import_as_version_action_column extends qbank_importasversion_column_paren
/** @var string store the value of the name lang string for performance. */
protected $actionname;

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public function init(): void {
parent::init();
$this->actionname = get_string('importasversion', 'qbank_importasversion');
}

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public function get_name(): string {
return 'importasversion';
}

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public function get_menu_position(): int {
return 650;
}

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
protected function get_url_icon_and_label(\stdClass $question): array {
if (!\question_bank::is_qtype_installed($question->qtype)) {
// It sometimes happens that people end up with junk questions
Expand Down
2 changes: 2 additions & 0 deletions classes/plugin_feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
class plugin_feature extends plugin_features_base {

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public function get_question_actions(view $qbank): array {
// This is what is used in Moodle 4.3+.
return [
Expand All @@ -36,6 +37,7 @@ public function get_question_actions(view $qbank): array {
}

// Support multiple Moodle versions. This method can be removed once 4.3 is the lowest supported version.
// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public function get_question_columns($qbank): array {
if (class_exists('\core_question\local\bank\question_action_base')) {
// We are in Moodle 4.3+. We don't need to implement this method.
Expand Down
1 change: 1 addition & 0 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
class provider implements null_provider {

// phpcs:ignore moodle.Commenting.MissingDocblock.Missing
public static function get_reason(): string {
return 'privacy:metadata';
}
Expand Down

0 comments on commit 5eeeda6

Please sign in to comment.