Skip to content

Commit

Permalink
Updating to Moodle 4.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Oct 12, 2024
1 parent fad220c commit 27d1cc2
Show file tree
Hide file tree
Showing 33 changed files with 159 additions and 135 deletions.
62 changes: 37 additions & 25 deletions .github/workflows/moodle-plugin-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,29 @@ jobs:
fail-fast: false
matrix:
include:
- php: 7.4
moodle-branch: MOODLE_401_STABLE
database: mariadb
- php: 7.4
moodle-branch: MOODLE_401_STABLE
database: pgsql
- php: 8.0
moodle-branch: MOODLE_401_STABLE
- php: 8.1
moodle-branch: MOODLE_402_STABLE
database: mariadb
- php: 8.0
moodle-branch: MOODLE_401_STABLE
- php: 8.1
moodle-branch: MOODLE_402_STABLE
database: pgsql
- php: 8.1
moodle-branch: MOODLE_401_STABLE
moodle-branch: MOODLE_403_STABLE
database: mariadb
- php: 8.1
moodle-branch: MOODLE_401_STABLE
moodle-branch: MOODLE_403_STABLE
database: pgsql
- php: 8.1
moodle-branch: MOODLE_402_STABLE
moodle-branch: MOODLE_404_STABLE
database: mariadb
- php: 8.1
moodle-branch: MOODLE_402_STABLE
moodle-branch: MOODLE_404_STABLE
database: pgsql
- php: 8.1
moodle-branch: MOODLE_403_STABLE
moodle-branch: MOODLE_405_STABLE
database: mariadb
- php: 8.1
moodle-branch: MOODLE_403_STABLE
moodle-branch: MOODLE_405_STABLE
database: pgsql
- php: 8.2
moodle-branch: MOODLE_402_STABLE
Expand All @@ -72,10 +66,34 @@ jobs:
- php: 8.2
moodle-branch: MOODLE_403_STABLE
database: pgsql
- php: 8.2
moodle-branch: MOODLE_404_STABLE
database: mariadb
- php: 8.2
moodle-branch: MOODLE_404_STABLE
database: pgsql
- php: 8.2
moodle-branch: MOODLE_405_STABLE
database: mariadb
- php: 8.2
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.3
moodle-branch: MOODLE_405_STABLE
database: mariadb
- php: 8.3
moodle-branch: MOODLE_405_STABLE
database: pgsql

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: plugin

Expand Down Expand Up @@ -107,11 +125,6 @@ jobs:
if: ${{ always() }}
run: moodle-plugin-ci phplint

- name: PHP Copy/Paste Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpcpd

- name: PHP Mess Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
Expand Down Expand Up @@ -142,9 +155,8 @@ jobs:
run: moodle-plugin-ci grunt --max-lint-warnings 0

- name: PHPUnit tests
# if: ${{ always() }}
if: ${{ matrix.php != 8.2 && matrix.php != 8.1 }}
run: moodle-plugin-ci phpunit --coverage-text
if: ${{ always() }}
run: moodle-plugin-ci phpunit --fail-on-warning

- name: Behat features
if: ${{ always() }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# moodle-report_datawarehouse
[![Moodle Plugin CI](https://github.com/lucaboesch/moodle-report_datawarehouse/workflows/Moodle%20Plugin%20CI/badge.svg?branch=main)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions?query=workflow%3A%22Moodle+Plugin+CI%22+branch%3Amain)
[![PHP Support](https://img.shields.io/badge/php-7.4_--_8.2-blue)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions)
[![Moodle Support](https://img.shields.io/badge/Moodle-4.1--4.3-blue)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions)
[![PHP Support](https://img.shields.io/badge/php-8.1_--_8.3-blue)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions)
[![Moodle Support](https://img.shields.io/badge/Moodle-4.2--4.5-orange)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions)
[![License GPL-3.0](https://img.shields.io/github/license/lucaboesch/moodle-report_datawarehouse?color=lightgrey)](https://github.com/lucaboesch/moodle-report_datawarehouse/blob/main/LICENSE)
[![GitHub contributors](https://img.shields.io/github/contributors/lucaboesch/moodle-report_datawarehouse)](https://github.com/lucaboesch/moodle-report_datawarehouseA/graphs/contributors)

Expand Down
2 changes: 1 addition & 1 deletion classes/backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function validate_backend(string $backend) {
*
* @return bool
*/
public function can_delete() : bool {
public function can_delete(): bool {
$result = true;

// phpcs:disable
Expand Down
14 changes: 7 additions & 7 deletions classes/backend_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected function set_external_page() {
*
* @return \report_datawarehouse\backend
*/
protected function get_instance($id = 0, \stdClass $data = null) {
protected function get_instance($id = 0, ?\stdClass $data = null) {
return new backend($id, $data);
}

Expand Down Expand Up @@ -157,7 +157,7 @@ public function get_sorted_backends_list() {
* Returns a text for create new record button.
* @return string
*/
protected function get_create_button_text() : string {
protected function get_create_button_text(): string {
return get_string('addbackend', 'report_datawarehouse');
}

Expand All @@ -168,7 +168,7 @@ protected function get_create_button_text() : string {
*
* @return \report_datawarehouse\local\form\backend
*/
protected function get_form($instance) : \report_datawarehouse\local\form\backend {
protected function get_form($instance): \report_datawarehouse\local\form\backend {
global $PAGE;

return new \report_datawarehouse\local\form\backend($PAGE->url->out(false), ['persistent' => $instance]);
Expand All @@ -178,31 +178,31 @@ protected function get_form($instance) : \report_datawarehouse\local\form\backen
* View backend heading string.
* @return string
*/
protected function get_view_heading() : string {
protected function get_view_heading(): string {
return get_string('managebackends', 'report_datawarehouse');
}

/**
* New backend heading string.
* @return string
*/
protected function get_new_heading() : string {
protected function get_new_heading(): string {
return get_string('newbackend', 'report_datawarehouse');
}

/**
* Edit backend heading string.
* @return string
*/
protected function get_edit_heading() : string {
protected function get_edit_heading(): string {
return get_string('editbackend', 'report_datawarehouse');
}

/**
* Returns base URL for the manager.
* @return string
*/
public static function get_base_url() : string {
public static function get_base_url(): string {
return '/report/datawarehouse/backend.php';
}

Expand Down
6 changes: 3 additions & 3 deletions classes/event/backend_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class backend_created extends base {
* @param \context_system $context Context system.
* @return base
*/
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context) : base {
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context): base {
global $USER;
$tid = $backend->get('id');

Expand Down Expand Up @@ -101,7 +101,7 @@ public function get_description() {
*
* @return array Mapping of object id.
*/
public static function get_objectid_mapping() : array {
public static function get_objectid_mapping(): array {
return ['db' => 'report_datawarehouse_backends', 'restore' => 'report_datawarehouse_backends'];
}

Expand All @@ -111,7 +111,7 @@ public static function get_objectid_mapping() : array {
*
* @return array List of mapping of other ids.
*/
public static function get_other_mapping() : array {
public static function get_other_mapping(): array {
return [];
}
}
6 changes: 3 additions & 3 deletions classes/event/backend_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class backend_deleted extends base {
* @param \context_system $context Context system.
* @return base
*/
public static function create_strict(string $id, \context_system $context) : base {
public static function create_strict(string $id, \context_system $context): base {
global $USER;

return self::create([
Expand Down Expand Up @@ -96,7 +96,7 @@ public function get_description() {
*
* @return array Mapping of object id.
*/
public static function get_objectid_mapping() : array {
public static function get_objectid_mapping(): array {
return ['db' => 'report_datawarehouse_bkends', 'restore' => 'report_datawarehouse_bkends'];
}

Expand All @@ -106,7 +106,7 @@ public static function get_objectid_mapping() : array {
*
* @return array List of mapping of other ids.
*/
public static function get_other_mapping() : array {
public static function get_other_mapping(): array {
return [];
}
}
6 changes: 3 additions & 3 deletions classes/event/backend_disabled.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class backend_disabled extends base {
* @param \context_system $context Context system.
* @return base
*/
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context) : base {
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context): base {
global $USER;
$tid = $backend->get('id');

Expand Down Expand Up @@ -101,7 +101,7 @@ public function get_description() {
*
* @return array Mapping of object id.
*/
public static function get_objectid_mapping() : array {
public static function get_objectid_mapping(): array {
return ['db' => 'report_datawarehouse_bkends', 'restore' => 'report_datawarehouse_bkends'];
}

Expand All @@ -111,7 +111,7 @@ public static function get_objectid_mapping() : array {
*
* @return array List of mapping of other ids.
*/
public static function get_other_mapping() : array {
public static function get_other_mapping(): array {
return [];
}
}
6 changes: 3 additions & 3 deletions classes/event/backend_enabled.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class backend_enabled extends base {
* @param \context_system $context Context system.
* @return base
*/
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context) : base {
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context): base {
global $USER;
$tid = $backend->get('id');

Expand Down Expand Up @@ -101,7 +101,7 @@ public function get_description() {
*
* @return array Mapping of object id.
*/
public static function get_objectid_mapping() : array {
public static function get_objectid_mapping(): array {
return ['db' => 'report_datawarehouse_bkends', 'restore' => 'report_datawarehouse_bkends'];
}

Expand All @@ -111,7 +111,7 @@ public static function get_objectid_mapping() : array {
*
* @return array List of mapping of other ids.
*/
public static function get_other_mapping() : array {
public static function get_other_mapping(): array {
return [];
}
}
6 changes: 3 additions & 3 deletions classes/event/backend_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class backend_updated extends base {
* @param \context_system $context Context system.
* @return base
*/
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context) : base {
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context): base {
global $USER;
$tid = $backend->get('id');

Expand Down Expand Up @@ -93,7 +93,7 @@ public function get_description() {
*
* @return array Mapping of object id.
*/
public static function get_objectid_mapping() : array {
public static function get_objectid_mapping(): array {
return ['db' => 'report_datawarehouse_bkends', 'restore' => 'report_datawarehouse_bkends'];
}

Expand All @@ -103,7 +103,7 @@ public static function get_objectid_mapping() : array {
*
* @return array List of mapping of other ids.
*/
public static function get_other_mapping() : array {
public static function get_other_mapping(): array {
return [];
}
}
6 changes: 3 additions & 3 deletions classes/event/query_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class query_created extends base {
* @param \context_system $context Context system.
* @return base
*/
public static function create_strict(\report_datawarehouse\query $query, \context_system $context) : base {
public static function create_strict(\report_datawarehouse\query $query, \context_system $context): base {
global $USER;
$tid = $query->get('id');

Expand Down Expand Up @@ -101,7 +101,7 @@ public function get_description() {
*
* @return array Mapping of object id.
*/
public static function get_objectid_mapping() : array {
public static function get_objectid_mapping(): array {
return ['db' => 'report_datawarehouse_queries', 'restore' => 'report_datawarehouse_queries'];
}

Expand All @@ -111,7 +111,7 @@ public static function get_objectid_mapping() : array {
*
* @return array List of mapping of other ids.
*/
public static function get_other_mapping() : array {
public static function get_other_mapping(): array {
return [];
}
}
6 changes: 3 additions & 3 deletions classes/event/query_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class query_deleted extends base {
* @param \context_system $context Context system.
* @return base
*/
public static function create_strict(string $id, \context_system $context) : base {
public static function create_strict(string $id, \context_system $context): base {
global $USER;

return self::create([
Expand Down Expand Up @@ -96,7 +96,7 @@ public function get_description() {
*
* @return array Mapping of object id.
*/
public static function get_objectid_mapping() : array {
public static function get_objectid_mapping(): array {
return ['db' => 'report_datawarehouse_queries', 'restore' => 'report_datawarehouse_queries'];
}

Expand All @@ -106,7 +106,7 @@ public static function get_objectid_mapping() : array {
*
* @return array List of mapping of other ids.
*/
public static function get_other_mapping() : array {
public static function get_other_mapping(): array {
return [];
}
}
Loading

0 comments on commit 27d1cc2

Please sign in to comment.