Skip to content

Commit 27d1cc2

Browse files
committed
Updating to Moodle 4.5.
1 parent fad220c commit 27d1cc2

33 files changed

+159
-135
lines changed

.github/workflows/moodle-plugin-ci.yml

+37-25
Original file line numberDiff line numberDiff line change
@@ -30,35 +30,29 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
include:
33-
- php: 7.4
34-
moodle-branch: MOODLE_401_STABLE
35-
database: mariadb
36-
- php: 7.4
37-
moodle-branch: MOODLE_401_STABLE
38-
database: pgsql
39-
- php: 8.0
40-
moodle-branch: MOODLE_401_STABLE
33+
- php: 8.1
34+
moodle-branch: MOODLE_402_STABLE
4135
database: mariadb
42-
- php: 8.0
43-
moodle-branch: MOODLE_401_STABLE
36+
- php: 8.1
37+
moodle-branch: MOODLE_402_STABLE
4438
database: pgsql
4539
- php: 8.1
46-
moodle-branch: MOODLE_401_STABLE
40+
moodle-branch: MOODLE_403_STABLE
4741
database: mariadb
4842
- php: 8.1
49-
moodle-branch: MOODLE_401_STABLE
43+
moodle-branch: MOODLE_403_STABLE
5044
database: pgsql
5145
- php: 8.1
52-
moodle-branch: MOODLE_402_STABLE
46+
moodle-branch: MOODLE_404_STABLE
5347
database: mariadb
5448
- php: 8.1
55-
moodle-branch: MOODLE_402_STABLE
49+
moodle-branch: MOODLE_404_STABLE
5650
database: pgsql
5751
- php: 8.1
58-
moodle-branch: MOODLE_403_STABLE
52+
moodle-branch: MOODLE_405_STABLE
5953
database: mariadb
6054
- php: 8.1
61-
moodle-branch: MOODLE_403_STABLE
55+
moodle-branch: MOODLE_405_STABLE
6256
database: pgsql
6357
- php: 8.2
6458
moodle-branch: MOODLE_402_STABLE
@@ -72,10 +66,34 @@ jobs:
7266
- php: 8.2
7367
moodle-branch: MOODLE_403_STABLE
7468
database: pgsql
69+
- php: 8.2
70+
moodle-branch: MOODLE_404_STABLE
71+
database: mariadb
72+
- php: 8.2
73+
moodle-branch: MOODLE_404_STABLE
74+
database: pgsql
75+
- php: 8.2
76+
moodle-branch: MOODLE_405_STABLE
77+
database: mariadb
78+
- php: 8.2
79+
moodle-branch: MOODLE_405_STABLE
80+
database: pgsql
81+
- php: 8.3
82+
moodle-branch: MOODLE_404_STABLE
83+
database: mariadb
84+
- php: 8.3
85+
moodle-branch: MOODLE_404_STABLE
86+
database: pgsql
87+
- php: 8.3
88+
moodle-branch: MOODLE_405_STABLE
89+
database: mariadb
90+
- php: 8.3
91+
moodle-branch: MOODLE_405_STABLE
92+
database: pgsql
7593

7694
steps:
7795
- name: Check out repository code
78-
uses: actions/checkout@v3
96+
uses: actions/checkout@v4
7997
with:
8098
path: plugin
8199

@@ -107,11 +125,6 @@ jobs:
107125
if: ${{ always() }}
108126
run: moodle-plugin-ci phplint
109127

110-
- name: PHP Copy/Paste Detector
111-
continue-on-error: true # This step will show errors but will not fail
112-
if: ${{ always() }}
113-
run: moodle-plugin-ci phpcpd
114-
115128
- name: PHP Mess Detector
116129
continue-on-error: true # This step will show errors but will not fail
117130
if: ${{ always() }}
@@ -142,9 +155,8 @@ jobs:
142155
run: moodle-plugin-ci grunt --max-lint-warnings 0
143156

144157
- name: PHPUnit tests
145-
# if: ${{ always() }}
146-
if: ${{ matrix.php != 8.2 && matrix.php != 8.1 }}
147-
run: moodle-plugin-ci phpunit --coverage-text
158+
if: ${{ always() }}
159+
run: moodle-plugin-ci phpunit --fail-on-warning
148160

149161
- name: Behat features
150162
if: ${{ always() }}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# moodle-report_datawarehouse
22
[![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)
3-
[![PHP Support](https://img.shields.io/badge/php-7.4_--_8.2-blue)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions)
4-
[![Moodle Support](https://img.shields.io/badge/Moodle-4.1--4.3-blue)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions)
3+
[![PHP Support](https://img.shields.io/badge/php-8.1_--_8.3-blue)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions)
4+
[![Moodle Support](https://img.shields.io/badge/Moodle-4.2--4.5-orange)](https://github.com/lucaboesch/moodle-report_datawarehouse/actions)
55
[![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)
66
[![GitHub contributors](https://img.shields.io/github/contributors/lucaboesch/moodle-report_datawarehouse)](https://github.com/lucaboesch/moodle-report_datawarehouseA/graphs/contributors)
77

classes/backend.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ protected function validate_backend(string $backend) {
9898
*
9999
* @return bool
100100
*/
101-
public function can_delete() : bool {
101+
public function can_delete(): bool {
102102
$result = true;
103103

104104
// phpcs:disable

classes/backend_controller.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected function set_external_page() {
127127
*
128128
* @return \report_datawarehouse\backend
129129
*/
130-
protected function get_instance($id = 0, \stdClass $data = null) {
130+
protected function get_instance($id = 0, ?\stdClass $data = null) {
131131
return new backend($id, $data);
132132
}
133133

@@ -157,7 +157,7 @@ public function get_sorted_backends_list() {
157157
* Returns a text for create new record button.
158158
* @return string
159159
*/
160-
protected function get_create_button_text() : string {
160+
protected function get_create_button_text(): string {
161161
return get_string('addbackend', 'report_datawarehouse');
162162
}
163163

@@ -168,7 +168,7 @@ protected function get_create_button_text() : string {
168168
*
169169
* @return \report_datawarehouse\local\form\backend
170170
*/
171-
protected function get_form($instance) : \report_datawarehouse\local\form\backend {
171+
protected function get_form($instance): \report_datawarehouse\local\form\backend {
172172
global $PAGE;
173173

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

185185
/**
186186
* New backend heading string.
187187
* @return string
188188
*/
189-
protected function get_new_heading() : string {
189+
protected function get_new_heading(): string {
190190
return get_string('newbackend', 'report_datawarehouse');
191191
}
192192

193193
/**
194194
* Edit backend heading string.
195195
* @return string
196196
*/
197-
protected function get_edit_heading() : string {
197+
protected function get_edit_heading(): string {
198198
return get_string('editbackend', 'report_datawarehouse');
199199
}
200200

201201
/**
202202
* Returns base URL for the manager.
203203
* @return string
204204
*/
205-
public static function get_base_url() : string {
205+
public static function get_base_url(): string {
206206
return '/report/datawarehouse/backend.php';
207207
}
208208

classes/event/backend_created.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class backend_created extends base {
4545
* @param \context_system $context Context system.
4646
* @return base
4747
*/
48-
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context) : base {
48+
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context): base {
4949
global $USER;
5050
$tid = $backend->get('id');
5151

@@ -101,7 +101,7 @@ public function get_description() {
101101
*
102102
* @return array Mapping of object id.
103103
*/
104-
public static function get_objectid_mapping() : array {
104+
public static function get_objectid_mapping(): array {
105105
return ['db' => 'report_datawarehouse_backends', 'restore' => 'report_datawarehouse_backends'];
106106
}
107107

@@ -111,7 +111,7 @@ public static function get_objectid_mapping() : array {
111111
*
112112
* @return array List of mapping of other ids.
113113
*/
114-
public static function get_other_mapping() : array {
114+
public static function get_other_mapping(): array {
115115
return [];
116116
}
117117
}

classes/event/backend_deleted.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class backend_deleted extends base {
4545
* @param \context_system $context Context system.
4646
* @return base
4747
*/
48-
public static function create_strict(string $id, \context_system $context) : base {
48+
public static function create_strict(string $id, \context_system $context): base {
4949
global $USER;
5050

5151
return self::create([
@@ -96,7 +96,7 @@ public function get_description() {
9696
*
9797
* @return array Mapping of object id.
9898
*/
99-
public static function get_objectid_mapping() : array {
99+
public static function get_objectid_mapping(): array {
100100
return ['db' => 'report_datawarehouse_bkends', 'restore' => 'report_datawarehouse_bkends'];
101101
}
102102

@@ -106,7 +106,7 @@ public static function get_objectid_mapping() : array {
106106
*
107107
* @return array List of mapping of other ids.
108108
*/
109-
public static function get_other_mapping() : array {
109+
public static function get_other_mapping(): array {
110110
return [];
111111
}
112112
}

classes/event/backend_disabled.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class backend_disabled extends base {
4545
* @param \context_system $context Context system.
4646
* @return base
4747
*/
48-
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context) : base {
48+
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context): base {
4949
global $USER;
5050
$tid = $backend->get('id');
5151

@@ -101,7 +101,7 @@ public function get_description() {
101101
*
102102
* @return array Mapping of object id.
103103
*/
104-
public static function get_objectid_mapping() : array {
104+
public static function get_objectid_mapping(): array {
105105
return ['db' => 'report_datawarehouse_bkends', 'restore' => 'report_datawarehouse_bkends'];
106106
}
107107

@@ -111,7 +111,7 @@ public static function get_objectid_mapping() : array {
111111
*
112112
* @return array List of mapping of other ids.
113113
*/
114-
public static function get_other_mapping() : array {
114+
public static function get_other_mapping(): array {
115115
return [];
116116
}
117117
}

classes/event/backend_enabled.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class backend_enabled extends base {
4545
* @param \context_system $context Context system.
4646
* @return base
4747
*/
48-
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context) : base {
48+
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context): base {
4949
global $USER;
5050
$tid = $backend->get('id');
5151

@@ -101,7 +101,7 @@ public function get_description() {
101101
*
102102
* @return array Mapping of object id.
103103
*/
104-
public static function get_objectid_mapping() : array {
104+
public static function get_objectid_mapping(): array {
105105
return ['db' => 'report_datawarehouse_bkends', 'restore' => 'report_datawarehouse_bkends'];
106106
}
107107

@@ -111,7 +111,7 @@ public static function get_objectid_mapping() : array {
111111
*
112112
* @return array List of mapping of other ids.
113113
*/
114-
public static function get_other_mapping() : array {
114+
public static function get_other_mapping(): array {
115115
return [];
116116
}
117117
}

classes/event/backend_updated.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class backend_updated extends base {
3737
* @param \context_system $context Context system.
3838
* @return base
3939
*/
40-
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context) : base {
40+
public static function create_strict(\report_datawarehouse\backend $backend, \context_system $context): base {
4141
global $USER;
4242
$tid = $backend->get('id');
4343

@@ -93,7 +93,7 @@ public function get_description() {
9393
*
9494
* @return array Mapping of object id.
9595
*/
96-
public static function get_objectid_mapping() : array {
96+
public static function get_objectid_mapping(): array {
9797
return ['db' => 'report_datawarehouse_bkends', 'restore' => 'report_datawarehouse_bkends'];
9898
}
9999

@@ -103,7 +103,7 @@ public static function get_objectid_mapping() : array {
103103
*
104104
* @return array List of mapping of other ids.
105105
*/
106-
public static function get_other_mapping() : array {
106+
public static function get_other_mapping(): array {
107107
return [];
108108
}
109109
}

classes/event/query_created.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class query_created extends base {
4545
* @param \context_system $context Context system.
4646
* @return base
4747
*/
48-
public static function create_strict(\report_datawarehouse\query $query, \context_system $context) : base {
48+
public static function create_strict(\report_datawarehouse\query $query, \context_system $context): base {
4949
global $USER;
5050
$tid = $query->get('id');
5151

@@ -101,7 +101,7 @@ public function get_description() {
101101
*
102102
* @return array Mapping of object id.
103103
*/
104-
public static function get_objectid_mapping() : array {
104+
public static function get_objectid_mapping(): array {
105105
return ['db' => 'report_datawarehouse_queries', 'restore' => 'report_datawarehouse_queries'];
106106
}
107107

@@ -111,7 +111,7 @@ public static function get_objectid_mapping() : array {
111111
*
112112
* @return array List of mapping of other ids.
113113
*/
114-
public static function get_other_mapping() : array {
114+
public static function get_other_mapping(): array {
115115
return [];
116116
}
117117
}

classes/event/query_deleted.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class query_deleted extends base {
4545
* @param \context_system $context Context system.
4646
* @return base
4747
*/
48-
public static function create_strict(string $id, \context_system $context) : base {
48+
public static function create_strict(string $id, \context_system $context): base {
4949
global $USER;
5050

5151
return self::create([
@@ -96,7 +96,7 @@ public function get_description() {
9696
*
9797
* @return array Mapping of object id.
9898
*/
99-
public static function get_objectid_mapping() : array {
99+
public static function get_objectid_mapping(): array {
100100
return ['db' => 'report_datawarehouse_queries', 'restore' => 'report_datawarehouse_queries'];
101101
}
102102

@@ -106,7 +106,7 @@ public static function get_objectid_mapping() : array {
106106
*
107107
* @return array List of mapping of other ids.
108108
*/
109-
public static function get_other_mapping() : array {
109+
public static function get_other_mapping(): array {
110110
return [];
111111
}
112112
}

0 commit comments

Comments
 (0)