Skip to content

Commit

Permalink
Codestyle PHPCBF
Browse files Browse the repository at this point in the history
  • Loading branch information
justusdieckmann committed Mar 22, 2024
1 parent 5c86a7c commit 9d75348
Show file tree
Hide file tree
Showing 31 changed files with 103 additions and 103 deletions.
4 changes: 2 additions & 2 deletions db/caches.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
'application' => [
'mode' => cache_store::MODE_APPLICATION,
'simplekeys' => true,
'simpledata' => true
]
'simpledata' => true,
],
];
2 changes: 1 addition & 1 deletion step/createbackup/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class provider implements null_provider {
*
* @return string the reason
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:metadata';
}
}
2 changes: 1 addition & 1 deletion step/deletecourse/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class provider implements null_provider {
*
* @return string the reason
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:metadata';
}
}
2 changes: 1 addition & 1 deletion step/duplicate/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class provider implements null_provider {
*
* @return string the reason
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:metadata';
}
}
6 changes: 3 additions & 3 deletions step/email/tests/privacy/provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @author Philipp Memmel
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider_test extends provider_testcase {
final class provider_test extends provider_testcase {

/**
* Basic setup for the provider tests.
Expand Down Expand Up @@ -190,7 +190,7 @@ public function test_get_users_in_context(): void {
* @return void
* @throws dml_exception
*/
public function test_delete_data_for_users() {
public function test_delete_data_for_users(): void {
global $DB;
$approveduserlist = new approved_userlist(context_system::instance(), 'lifecyclestep_email',
[$this->user1->id, $this->user2->id]);
Expand All @@ -212,7 +212,7 @@ public function test_delete_data_for_users() {
* @return void
* @throws dml_exception
*/
public function test_delete_data_for_users_coursecontext() {
public function test_delete_data_for_users_coursecontext(): void {
global $DB;
$approveduserlist = new approved_userlist(context_course::instance($this->course1->id), 'lifecyclestep_email',
[$this->user1->id, $this->user2->id]);
Expand Down
8 changes: 4 additions & 4 deletions tests/active_workflow_is_manual_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @copyright 2018 WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class active_workflow_is_manual_test extends \advanced_testcase {
final class active_workflow_is_manual_test extends \advanced_testcase {

/** Icon of the trigger. */
const MANUAL_TRIGGER1_ICON = 't/up';
Expand All @@ -58,7 +58,7 @@ class active_workflow_is_manual_test extends \advanced_testcase {
* Setup the testcase.
* @throws \coding_exception
*/
public function setUp() : void {
public function setUp(): void {
global $USER;
$this->resetAfterTest(true);
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');
Expand All @@ -85,7 +85,7 @@ public function setUp() : void {
* @throws \dml_transaction_exception
* @throws \moodle_exception
*/
public function test_activate_manual() {
public function test_activate_manual(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->manualworkflow->id);
$reloadworkflow = workflow_manager::get_workflow($this->manualworkflow->id);
$this->assertTrue(workflow_manager::is_active($this->manualworkflow->id));
Expand All @@ -100,7 +100,7 @@ public function test_activate_manual() {
* @throws \dml_transaction_exception
* @throws \moodle_exception
*/
public function test_activate_automatic() {
public function test_activate_automatic(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->automaticworkflow->id);
$reloadworkflow = workflow_manager::get_workflow($this->automaticworkflow->id);
$this->assertTrue(workflow_manager::is_active($this->automaticworkflow->id));
Expand Down
14 changes: 7 additions & 7 deletions tests/active_workflow_sortindex_updown_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class active_workflow_sortindex_updown_test extends workflow_actions_testcase {
final class active_workflow_sortindex_updown_test extends workflow_actions_testcase {

/**
* Test to put down the first workflow.
* @covers \tool_lifecycle\local\manager\workflow_manager move actions down
*/
public function test_down_first() {
public function test_down_first(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
Expand All @@ -67,7 +67,7 @@ public function test_down_first() {
* Test to put down the second workflow.
* @covers \tool_lifecycle\local\manager\workflow_manager move actions down
*/
public function test_down_second() {
public function test_down_second(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
Expand All @@ -87,7 +87,7 @@ public function test_down_second() {
* Test to put down the third workflow.
* @covers \tool_lifecycle\local\manager\workflow_manager move actions down
*/
public function test_down_third() {
public function test_down_third(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
Expand All @@ -107,7 +107,7 @@ public function test_down_third() {
* Test to put up the third workflow.
* @covers \tool_lifecycle\local\manager\workflow_manager move actions up
*/
public function test_up_first() {
public function test_up_first(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
Expand All @@ -127,7 +127,7 @@ public function test_up_first() {
* Test to put up the third workflow.
* @covers \tool_lifecycle\local\manager\workflow_manager move actions up
*/
public function test_up_second() {
public function test_up_second(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
Expand All @@ -147,7 +147,7 @@ public function test_up_second() {
* Test to put up the third workflow.
* @covers \tool_lifecycle\local\manager\workflow_manager move actions up
*/
public function test_up_third() {
public function test_up_third(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow3->id);
Expand Down
6 changes: 3 additions & 3 deletions tests/backup_and_restore_workflow_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @copyright 2018 WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_and_restore_workflow_test extends \advanced_testcase {
final class backup_and_restore_workflow_test extends \advanced_testcase {

/** @var $workflow workflow */
private $workflow;
Expand All @@ -56,7 +56,7 @@ class backup_and_restore_workflow_test extends \advanced_testcase {
* Setup the testcase.
* @throws \coding_exception
*/
public function setUp() : void {
public function setUp(): void {
$this->resetAfterTest(true);
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');
$this->workflow = $generator->create_workflow(['startdatedelay', 'categories'], ['email', 'createbackup', 'deletecourse']);
Expand All @@ -69,7 +69,7 @@ public function setUp() : void {
* Test to activate the manual workflow.
* @covers \tool_lifecycle\local\manager\workflow_manager check if backup is created
*/
public function test_backup_workflow() {
public function test_backup_workflow(): void {
$backuptask = new backup_lifecycle_workflow($this->workflow->id);
$backuptask->execute();
$filename = $backuptask->get_temp_filename();
Expand Down
8 changes: 4 additions & 4 deletions tests/backup_manager_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_manager_test extends \advanced_testcase {
final class backup_manager_test extends \advanced_testcase {

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

/**
* Setup the testcase.
*/
public function setUp() : void {
public function setUp(): void {
$this->resetAfterTest(false);
$this->course = $this->getDataGenerator()->create_course();
}
Expand All @@ -51,7 +51,7 @@ public function setUp() : void {
* Test creating a backup for a course.
* @covers \tool_lifecycle\local\manager\backup_manager create backup
*/
public function test_backup_create() {
public function test_backup_create(): void {
global $DB;
$result = backup_manager::create_course_backup($this->course->id);
$this->assertTrue($result);
Expand All @@ -63,7 +63,7 @@ public function test_backup_create() {
* Test redirect without errors when starting to restore a backup.
* @covers \tool_lifecycle\local\manager\backup_manager restore backup
*/
public function test_backup_restore() {
public function test_backup_restore(): void {
global $DB;
$backups = $DB->get_records('tool_lifecycle_backups');
$this->assertEquals(1, count($backups));
Expand Down
8 changes: 4 additions & 4 deletions tests/manual_trigger_tools_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @copyright 2018 Tobias Reischmann, Jan Dageforde WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class manual_trigger_tools_test extends \advanced_testcase {
final class manual_trigger_tools_test extends \advanced_testcase {
/** Icon of the manual trigger 1. */
const MANUAL_TRIGGER1_ICON = 't/up';
/** Display name of the manual trigger 1. */
Expand All @@ -62,7 +62,7 @@ class manual_trigger_tools_test extends \advanced_testcase {
* Setup the testcase.
* @throws \coding_exception
*/
public function setUp() : void {
public function setUp(): void {
global $USER;
$this->resetAfterTest(true);
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');
Expand All @@ -87,7 +87,7 @@ public function setUp() : void {
* Test getting manual trigger tools of active workflows.
* @covers \tool_lifecycle\local\manager\workflow_manager get triggers for one wf
*/
public function test_get_manual_trigger_tools_for_one_active_workflow() {
public function test_get_manual_trigger_tools_for_one_active_workflow(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
$tools = workflow_manager::get_manual_trigger_tools_for_active_workflows();
$this->assertCount(1, $tools);
Expand All @@ -102,7 +102,7 @@ public function test_get_manual_trigger_tools_for_one_active_workflow() {
* Test getting manual trigger tools of active workflows.
* @covers \tool_lifecycle\local\manager\workflow_manager get triggers for multiple wf
*/
public function test_get_manual_trigger_tools_for_active_workflows() {
public function test_get_manual_trigger_tools_for_active_workflows(): void {
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow2->id);
workflow_manager::handle_action(action::WORKFLOW_ACTIVATE, $this->workflow1->id);
$tools = workflow_manager::get_manual_trigger_tools_for_active_workflows();
Expand Down
6 changes: 3 additions & 3 deletions tests/manually_triggered_process_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @copyright 2018 WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class manually_triggered_process_test extends \advanced_testcase {
final class manually_triggered_process_test extends \advanced_testcase {
/** Icon of the manual trigger. */
const MANUAL_TRIGGER1_ICON = 't/up';
/** Display name of the manual trigger. */
Expand All @@ -66,7 +66,7 @@ class manually_triggered_process_test extends \advanced_testcase {
* @throws \coding_exception
* @throws \moodle_exception
*/
public function setUp() : void {
public function setUp(): void {
global $USER;

// We do not need a sesskey check in theses tests.
Expand Down Expand Up @@ -95,7 +95,7 @@ public function setUp() : void {
* Test to proceed a manually triggered process to step index 1.
* @covers \tool_lifecycle\local\manager\process_manager test if manual process started
*/
public function test_proceeding_of_manually_triggered_processes() {
public function test_proceeding_of_manually_triggered_processes(): void {
$process = process_manager::manually_trigger_process($this->course->id, $this->trigger->id);
$this->assertEquals(0, $process->stepindex);

Expand Down
6 changes: 3 additions & 3 deletions tests/persistence/persist_process_data_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class persist_process_data_test extends \advanced_testcase {
final class persist_process_data_test extends \advanced_testcase {

/** @var process $process Instance of the process. */
private $process;
Expand All @@ -55,7 +55,7 @@ class persist_process_data_test extends \advanced_testcase {
* @throws coding_exception
* @throws dml_exception
*/
public function setUp() : void {
public function setUp(): void {
$this->resetAfterTest(true);
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');

Expand All @@ -70,7 +70,7 @@ public function setUp() : void {
* Test the getting and setting of process data.
* @covers \tool_lifecycle\local\manager\process_data_manager
*/
public function test_get_set_process_data() {
public function test_get_set_process_data(): void {
$step = step_manager::get_step_instance_by_workflow_index($this->process->workflowid, $this->process->stepindex);
process_data_manager::set_process_data(
$this->process->id,
Expand Down
12 changes: 6 additions & 6 deletions tests/persistence/persist_process_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class persist_process_test extends \advanced_testcase {
final class persist_process_test extends \advanced_testcase {

/** @var workflow $workflow Instance of the workflow. */
private $workflow;
Expand All @@ -51,7 +51,7 @@ class persist_process_test extends \advanced_testcase {
* Setup the testcase.
* @throws coding_exception
*/
public function setUp() : void {
public function setUp(): void {
$this->resetAfterTest(true);
$generator = $this->getDataGenerator()->get_plugin_generator('tool_lifecycle');

Expand All @@ -63,7 +63,7 @@ public function setUp() : void {
* Test the creation of a process.
* @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_create() {
public function test_create(): void {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
$this->assertNotNull($process);
$this->assertNotEmpty($process->id);
Expand All @@ -77,7 +77,7 @@ public function test_create() {
* Tests setting a process on waiting.
* @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_waiting() {
public function test_process_waiting(): void {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
$this->assertFalse($process->waiting);
process_manager::set_process_waiting($process);
Expand All @@ -89,7 +89,7 @@ public function test_process_waiting() {
* Tests deletion of a process when rolledback.
* @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_rollback() {
public function test_process_rollback(): void {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
delayed_courses_manager::set_course_delayed($process->courseid, get_config('tool_lifecycle', 'duration'));
process_manager::rollback_process($process);
Expand All @@ -101,7 +101,7 @@ public function test_process_rollback() {
* Tests proceeding a process to the next step.
* @covers \tool_lifecycle\local\manager\process_manager
*/
public function test_process_proceed() {
public function test_process_proceed(): void {
$process = process_manager::create_process($this->course->id, $this->workflow->id);
$this->assertEquals(0, $process->stepindex);
process_manager::proceed_process($process);
Expand Down
Loading

0 comments on commit 9d75348

Please sign in to comment.