Skip to content

Commit 9d75348

Browse files
Codestyle PHPCBF
1 parent 5c86a7c commit 9d75348

31 files changed

+103
-103
lines changed

db/caches.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
'application' => [
3232
'mode' => cache_store::MODE_APPLICATION,
3333
'simplekeys' => true,
34-
'simpledata' => true
35-
]
34+
'simpledata' => true,
35+
],
3636
];

step/createbackup/classes/privacy/provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class provider implements null_provider {
3434
*
3535
* @return string the reason
3636
*/
37-
public static function get_reason() : string {
37+
public static function get_reason(): string {
3838
return 'privacy:metadata';
3939
}
4040
}

step/deletecourse/classes/privacy/provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class provider implements null_provider {
3434
*
3535
* @return string the reason
3636
*/
37-
public static function get_reason() : string {
37+
public static function get_reason(): string {
3838
return 'privacy:metadata';
3939
}
4040
}

step/duplicate/classes/privacy/provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class provider implements null_provider {
3434
*
3535
* @return string the reason
3636
*/
37-
public static function get_reason() : string {
37+
public static function get_reason(): string {
3838
return 'privacy:metadata';
3939
}
4040
}

step/email/tests/privacy/provider_test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* @author Philipp Memmel
4545
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
4646
*/
47-
class provider_test extends provider_testcase {
47+
final class provider_test extends provider_testcase {
4848

4949
/**
5050
* Basic setup for the provider tests.
@@ -190,7 +190,7 @@ public function test_get_users_in_context(): void {
190190
* @return void
191191
* @throws dml_exception
192192
*/
193-
public function test_delete_data_for_users() {
193+
public function test_delete_data_for_users(): void {
194194
global $DB;
195195
$approveduserlist = new approved_userlist(context_system::instance(), 'lifecyclestep_email',
196196
[$this->user1->id, $this->user2->id]);
@@ -212,7 +212,7 @@ public function test_delete_data_for_users() {
212212
* @return void
213213
* @throws dml_exception
214214
*/
215-
public function test_delete_data_for_users_coursecontext() {
215+
public function test_delete_data_for_users_coursecontext(): void {
216216
global $DB;
217217
$approveduserlist = new approved_userlist(context_course::instance($this->course1->id), 'lifecyclestep_email',
218218
[$this->user1->id, $this->user2->id]);

tests/active_workflow_is_manual_test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* @copyright 2018 WWU
4141
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
4242
*/
43-
class active_workflow_is_manual_test extends \advanced_testcase {
43+
final class active_workflow_is_manual_test extends \advanced_testcase {
4444

4545
/** Icon of the trigger. */
4646
const MANUAL_TRIGGER1_ICON = 't/up';
@@ -58,7 +58,7 @@ class active_workflow_is_manual_test extends \advanced_testcase {
5858
* Setup the testcase.
5959
* @throws \coding_exception
6060
*/
61-
public function setUp() : void {
61+
public function setUp(): void {
6262
global $USER;
6363
$this->resetAfterTest(true);
6464
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');
@@ -85,7 +85,7 @@ public function setUp() : void {
8585
* @throws \dml_transaction_exception
8686
* @throws \moodle_exception
8787
*/
88-
public function test_activate_manual() {
88+
public function test_activate_manual(): void {
8989
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->manualworkflow->id);
9090
$reloadworkflow = workflow_manager::get_workflow($this->manualworkflow->id);
9191
$this->assertTrue(workflow_manager::is_active($this->manualworkflow->id));
@@ -100,7 +100,7 @@ public function test_activate_manual() {
100100
* @throws \dml_transaction_exception
101101
* @throws \moodle_exception
102102
*/
103-
public function test_activate_automatic() {
103+
public function test_activate_automatic(): void {
104104
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->automaticworkflow->id);
105105
$reloadworkflow = workflow_manager::get_workflow($this->automaticworkflow->id);
106106
$this->assertTrue(workflow_manager::is_active($this->automaticworkflow->id));

tests/active_workflow_sortindex_updown_test.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
* @copyright 2017 Tobias Reischmann WWU
4242
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
4343
*/
44-
class active_workflow_sortindex_updown_test extends workflow_actions_testcase {
44+
final class active_workflow_sortindex_updown_test extends workflow_actions_testcase {
4545

4646
/**
4747
* Test to put down the first workflow.
4848
* @covers \tool_lifecycle\local\manager\workflow_manager move actions down
4949
*/
50-
public function test_down_first() {
50+
public function test_down_first(): void {
5151
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
5252
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
5353
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
@@ -67,7 +67,7 @@ public function test_down_first() {
6767
* Test to put down the second workflow.
6868
* @covers \tool_lifecycle\local\manager\workflow_manager move actions down
6969
*/
70-
public function test_down_second() {
70+
public function test_down_second(): void {
7171
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
7272
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
7373
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
@@ -87,7 +87,7 @@ public function test_down_second() {
8787
* Test to put down the third workflow.
8888
* @covers \tool_lifecycle\local\manager\workflow_manager move actions down
8989
*/
90-
public function test_down_third() {
90+
public function test_down_third(): void {
9191
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
9292
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
9393
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
@@ -107,7 +107,7 @@ public function test_down_third() {
107107
* Test to put up the third workflow.
108108
* @covers \tool_lifecycle\local\manager\workflow_manager move actions up
109109
*/
110-
public function test_up_first() {
110+
public function test_up_first(): void {
111111
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
112112
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
113113
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
@@ -127,7 +127,7 @@ public function test_up_first() {
127127
* Test to put up the third workflow.
128128
* @covers \tool_lifecycle\local\manager\workflow_manager move actions up
129129
*/
130-
public function test_up_second() {
130+
public function test_up_second(): void {
131131
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
132132
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
133133
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
@@ -147,7 +147,7 @@ public function test_up_second() {
147147
* Test to put up the third workflow.
148148
* @covers \tool_lifecycle\local\manager\workflow_manager move actions up
149149
*/
150-
public function test_up_third() {
150+
public function test_up_third(): void {
151151
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
152152
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
153153
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);

tests/backup_and_restore_workflow_test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* @copyright 2018 WWU
4545
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
4646
*/
47-
class backup_and_restore_workflow_test extends \advanced_testcase {
47+
final class backup_and_restore_workflow_test extends \advanced_testcase {
4848

4949
/** @var $workflow workflow */
5050
private $workflow;
@@ -56,7 +56,7 @@ class backup_and_restore_workflow_test extends \advanced_testcase {
5656
* Setup the testcase.
5757
* @throws \coding_exception
5858
*/
59-
public function setUp() : void {
59+
public function setUp(): void {
6060
$this->resetAfterTest(true);
6161
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');
6262
$this->workflow = $generator->create_workflow(['startdatedelay', 'categories'], ['email', 'createbackup', 'deletecourse']);
@@ -69,7 +69,7 @@ public function setUp() : void {
6969
* Test to activate the manual workflow.
7070
* @covers \tool_lifecycle\local\manager\workflow_manager check if backup is created
7171
*/
72-
public function test_backup_workflow() {
72+
public function test_backup_workflow(): void {
7373
$backuptask = new backup_lifecycle_workflow($this->workflow->id);
7474
$backuptask->execute();
7575
$filename = $backuptask->get_temp_filename();

tests/backup_manager_test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
* @copyright 2017 Tobias Reischmann WWU
3535
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3636
*/
37-
class backup_manager_test extends \advanced_testcase {
37+
final class backup_manager_test extends \advanced_testcase {
3838

3939
/** @var array $course Instance of the course under test. */
4040
private $course;
4141

4242
/**
4343
* Setup the testcase.
4444
*/
45-
public function setUp() : void {
45+
public function setUp(): void {
4646
$this->resetAfterTest(false);
4747
$this->course = $this->getDataGenerator()->create_course();
4848
}
@@ -51,7 +51,7 @@ public function setUp() : void {
5151
* Test creating a backup for a course.
5252
* @covers \tool_lifecycle\local\manager\backup_manager create backup
5353
*/
54-
public function test_backup_create() {
54+
public function test_backup_create(): void {
5555
global $DB;
5656
$result = backup_manager::create_course_backup($this->course->id);
5757
$this->assertTrue($result);
@@ -63,7 +63,7 @@ public function test_backup_create() {
6363
* Test redirect without errors when starting to restore a backup.
6464
* @covers \tool_lifecycle\local\manager\backup_manager restore backup
6565
*/
66-
public function test_backup_restore() {
66+
public function test_backup_restore(): void {
6767
global $DB;
6868
$backups = $DB->get_records('tool_lifecycle_backups');
6969
$this->assertEquals(1, count($backups));

tests/manual_trigger_tools_test.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* @copyright 2018 Tobias Reischmann, Jan Dageforde WWU
3939
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
4040
*/
41-
class manual_trigger_tools_test extends \advanced_testcase {
41+
final class manual_trigger_tools_test extends \advanced_testcase {
4242
/** Icon of the manual trigger 1. */
4343
const MANUAL_TRIGGER1_ICON = 't/up';
4444
/** Display name of the manual trigger 1. */
@@ -62,7 +62,7 @@ class manual_trigger_tools_test extends \advanced_testcase {
6262
* Setup the testcase.
6363
* @throws \coding_exception
6464
*/
65-
public function setUp() : void {
65+
public function setUp(): void {
6666
global $USER;
6767
$this->resetAfterTest(true);
6868
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');
@@ -87,7 +87,7 @@ public function setUp() : void {
8787
* Test getting manual trigger tools of active workflows.
8888
* @covers \tool_lifecycle\local\manager\workflow_manager get triggers for one wf
8989
*/
90-
public function test_get_manual_trigger_tools_for_one_active_workflow() {
90+
public function test_get_manual_trigger_tools_for_one_active_workflow(): void {
9191
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
9292
$tools = workflow_manager::get_manual_trigger_tools_for_active_workflows();
9393
$this->assertCount(1, $tools);
@@ -102,7 +102,7 @@ public function test_get_manual_trigger_tools_for_one_active_workflow() {
102102
* Test getting manual trigger tools of active workflows.
103103
* @covers \tool_lifecycle\local\manager\workflow_manager get triggers for multiple wf
104104
*/
105-
public function test_get_manual_trigger_tools_for_active_workflows() {
105+
public function test_get_manual_trigger_tools_for_active_workflows(): void {
106106
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
107107
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
108108
$tools = workflow_manager::get_manual_trigger_tools_for_active_workflows();

0 commit comments

Comments
 (0)