Skip to content

Commit

Permalink
MBS-9797: Coding style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg committed Dec 16, 2024
1 parent 4b1b808 commit c6cc5c6
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 24 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

services:
postgres:
image: postgres:13
image: postgres:14
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
Expand Down Expand Up @@ -43,28 +43,22 @@ jobs:
- php: '8.2'
moodle-branch: 'main'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'main'
database: 'mariadb'
- php: '8.1'
moodle-branch: 'main'
database: 'pgsql'
- php: '8.3'
moodle-branch: 'MOODLE_404_STABLE'
moodle-branch: 'MOODLE_405_STABLE'
database: 'mariadb'
- php: '8.3'
moodle-branch: 'MOODLE_404_STABLE'
moodle-branch: 'MOODLE_405_STABLE'
database: 'pgsql'
- php: '8.3'
moodle-branch: 'MOODLE_404_STABLE'
database: 'mariadb'
- php: '8.3'
moodle-branch: 'MOODLE_404_STABLE'
database: 'pgsql'
- php: '8.1'
- php: '7.4'
moodle-branch: 'MOODLE_401_STABLE'
database: 'mariadb'
- php: '8.1'
- php: '7.4'
moodle-branch: 'MOODLE_401_STABLE'
database: 'pgsql'

Expand Down
2 changes: 1 addition & 1 deletion classes/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static function send_notification(
string $messagename,
array $users,
object $data,
string $altmessagename = null,
string $altmessagename = null, // phpcs:ignore
bool $tocurrentuser = false
) {
global $OUTPUT, $USER;
Expand Down
12 changes: 6 additions & 6 deletions lang/en/kanban.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
$string['cardtitle'] = 'Card title';
$string['changegroup'] = 'Change group board';
$string['changeuser'] = 'Change user board';
$string['closecard'] = 'Close card';
$string['color'] = 'Color';
$string['column'] = 'Column';
$string['columntitle'] = 'Column title';
$string['completioncreate'] = 'Create this number of cards';
$string['completioncomplete'] = 'Complete this number of cards';
$string['completiondetail:create'] = 'Create cards: {$a}';
$string['completioncreate'] = 'Create this number of cards';
$string['completiondetail:complete'] = 'Complete cards: {$a}';
$string['completiondetail:create'] = 'Create cards: {$a}';
$string['courseboard'] = 'Shared board';
$string['closecard'] = 'Close card';
$string['createtemplate'] = 'Create template';
$string['deleteboard'] = 'Delete board';
$string['deleteboardconfirm'] = 'Are you sure you want to delete this board? A new board will be created based on the template.';
Expand Down Expand Up @@ -79,18 +79,18 @@
$string['history_card_deleted'] = '{$a->username} deleted card from column "{$a->columnname}"';
$string['history_card_moved'] = '{$a->username} moved card to column "{$a->columnname}"';
$string['history_card_reopened'] = '{$a->username} reopened the card';
$string['history_card_updated'] = '{$a->username} changed card title to "{$a->title}"';
$string['history_card_unassigned'] = '{$a->username} unassigned card from user {$a->affectedusername}';
$string['history_card_updated'] = '{$a->username} changed card title to "{$a->title}"';
$string['history_discussion_added'] = '{$a->username} added discussion message';
$string['history_discussion_deleted'] = '{$a->username} deleted discussion message';
$string['kanban:addcard'] = 'Add a card to a Kanban board';
$string['kanban:addinstance'] = 'Add a Kanban board';
$string['kanban:assignothers'] = 'Assign others to a card';
$string['kanban:assignself'] = 'Assign self to a card';
$string['kanban:editallboards'] = 'Edit all boards';
$string['kanban:manageboard'] = 'Manage the board (templates, delete the board)';
$string['kanban:manageallcards'] = 'Edit / move all cards';
$string['kanban:manageassignedcards'] = 'Edit / move cards assigned to oneself';
$string['kanban:manageboard'] = 'Manage the board (templates, delete the board)';
$string['kanban:managecolumns'] = 'Edit the columns of the board';
$string['kanban:view'] = 'View a Kanban board';
$string['kanban:viewallboards'] = 'View all boards';
Expand Down Expand Up @@ -167,8 +167,8 @@
$string['pushcardconfirm'] = 'This will send a copy of this card to all boards inside this kanban activity including templates. Existing copies will be replaced.';
$string['reminderdate'] = 'Reminder date';
$string['remindertask'] = 'Send reminder notifications';
$string['reset_kanban'] = 'Reset shared boards';
$string['reset_group'] = 'Reset group boards';
$string['reset_kanban'] = 'Reset shared boards';
$string['reset_personal'] = 'Reset personal boards';
$string['saveastemplate'] = 'Save as template';
$string['saveastemplateconfirm'] = 'Are you sure you want to save this board as a template? It will replace the current template if there is one.';
Expand Down
7 changes: 5 additions & 2 deletions tests/boardmanager_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \mod_kanban\boardmanager
*/
class boardmanager_test extends \advanced_testcase {
final class boardmanager_test extends \advanced_testcase {
/** @var \stdClass The course used for testing */
private $course;
/** @var \stdClass The kanban used for testing */
Expand All @@ -39,8 +39,11 @@ class boardmanager_test extends \advanced_testcase {
* Prepare testing environment
*/
public function setUp(): void {
$this->resetAfterTest();
global $DB;

parent::setUp();

$this->resetAfterTest();
$this->course = $this->getDataGenerator()->create_course();
$this->kanban = $this->getDataGenerator()->create_module('kanban', ['course' => $this->course]);

Expand Down
5 changes: 4 additions & 1 deletion tests/change_kanban_content_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @covers \mod_kanban\external\change_kanban_content
* @runTestsInSeparateProcesses
*/
class change_kanban_content_test extends \advanced_testcase {
final class change_kanban_content_test extends \advanced_testcase {
/** @var \stdClass The course used for testing */
private $course;
/** @var \stdClass The kanban used for testing */
Expand All @@ -39,6 +39,9 @@ class change_kanban_content_test extends \advanced_testcase {
*/
public function setUp(): void {
global $DB, $SCRIPT;

parent::setUp();

$this->course = $this->getDataGenerator()->create_course();
$this->kanban = $this->getDataGenerator()->create_module('kanban', ['course' => $this->course]);

Expand Down
2 changes: 1 addition & 1 deletion tests/generation_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \mod_kanban_generator
*/
class generation_test extends \advanced_testcase {
final class generation_test extends \advanced_testcase {
/**
* Tests the data generator for this module
*
Expand Down
2 changes: 1 addition & 1 deletion tests/generator/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class mod_kanban_generator extends testing_module_generator {
* @param array|null $options
* @return stdClass kanban instance
*/
public function create_instance($record = null, array $options = null): stdClass {
public function create_instance($record = null, array $options = null): stdClass { // phpcs:ignore
$record = (array) $record + [
'name' => 'test kanban',
'intro' => '',
Expand Down
5 changes: 4 additions & 1 deletion tests/task/reminder_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \mod_kanban\task\reminder
*/
class reminder_test extends \advanced_testcase {
final class reminder_test extends \advanced_testcase {
/** @var \stdClass The course used for testing */
private $course;
/** @var \stdClass The kanban used for testing */
Expand All @@ -40,6 +40,9 @@ class reminder_test extends \advanced_testcase {
*/
public function setUp(): void {
global $DB;

parent::setUp();

$this->course = $this->getDataGenerator()->create_course();
$this->kanban = $this->getDataGenerator()->create_module('kanban', ['course' => $this->course]);

Expand Down

0 comments on commit c6cc5c6

Please sign in to comment.