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 Oct 14, 2023
1 parent 54a748b commit 6bcf786
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2023-10-14 - Make codechecker happy again
* 2023-10-10 - Updated Moodle Plugin CI to latest upstream recommendations
* 2023-04-30 - Tests: Updated Moodle Plugin CI to use PHP 8.1 and Postgres 13 from Moodle 4.1 on.

Expand Down
2 changes: 1 addition & 1 deletion classes/event/courses_sorted.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/course/index.php', array('categoryid' => $this->objectid));
return new \moodle_url('/course/index.php', ['categoryid' => $this->objectid]);
}
}
12 changes: 6 additions & 6 deletions db/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@

defined('MOODLE_INTERNAL') || die();

$observers = array(
array(
$observers = [
[
'eventname' => '\core\event\course_created',
'includefile' => '/local/resort_courses/locallib.php',
'callback' => 'resort_course_eventhandler',
),
array(
],
[
'eventname' => '\core\event\course_updated',
'includefile' => '/local/resort_courses/locallib.php',
'callback' => 'resort_course_eventhandler',
),
);
],
];
10 changes: 5 additions & 5 deletions db/tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@

defined('MOODLE_INTERNAL') || die();

$tasks = array(
array(
$tasks = [
[
'classname' => 'local_resort_courses\task\resort_courses',
'blocking' => 0,
'minute' => '0',
'hour' => '2',
'day' => '*',
'month' => '*',
'dayofweek' => '0',
'disabled' => 1
)
);
'disabled' => 1,
],
];
12 changes: 6 additions & 6 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function resort_course_eventhandler($eventdata) {
}

// Get category.
$category = $DB->get_record('course_categories', array('id' => $eventcourse->category));
$category = $DB->get_record('course_categories', ['id' => $eventcourse->category]);
if (!$category) {
// Now we have an error, but if we return false, the event will stay in the event queue.
// Let's return and leave the category unsorted.
Expand Down Expand Up @@ -178,7 +178,7 @@ function resort_course_category($category, $cronrunning = false) {
// Do the resorting.
$i = 1;
foreach ($courses as $course) {
$DB->set_field('course', 'sortorder', $category->sortorder + $i, array('id' => $course->id));
$DB->set_field('course', 'sortorder', $category->sortorder + $i, ['id' => $course->id]);
$i++;
}

Expand All @@ -187,13 +187,13 @@ function resort_course_category($category, $cronrunning = false) {
cache_helper::purge_by_event('changesincourse');

// Log the event.
$logevent = \local_resort_courses\event\courses_sorted::create(array(
$logevent = \local_resort_courses\event\courses_sorted::create([
'objectid' => $category->id,
'context' => context_coursecat::instance($category->id),
'other' => array(
'other' => [
'cronrunning' => $cronrunning,
)
));
],
]);
$logevent->trigger();
}

Expand Down
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
$page->add(new admin_setting_configmultiselect('local_resort_courses/skipcategories',
get_string('skipcategories', 'local_resort_courses', null, true),
get_string('skipcategories_desc', 'local_resort_courses', null, true),
array(),
[],
$categories));

// Create skip categories recursively widget.
Expand Down

0 comments on commit 6bcf786

Please sign in to comment.