Skip to content

Commit 3d819ee

Browse files
committed
Make code checker happy
1 parent cc76f8e commit 3d819ee

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

classes/element_helper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,11 @@ public static function get_grade_item_info($gradeitemid, $gradeformat, $userid)
687687
);
688688
}
689689

690+
/**
691+
* Helper function to return all the date formats.
692+
*
693+
* @return array the list of date formats
694+
*/
690695
public static function get_date_formats(): array {
691696
// Hard-code date so users can see the difference between short dates with and without the leading zero.
692697
// Eg. 06/07/18 vs 6/07/18.

classes/report_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace mod_customcert;
2626

27-
use \customcertelement_expiry\element as expiry_element;
27+
use customcertelement_expiry\element as expiry_element;
2828

2929
defined('MOODLE_INTERNAL') || die;
3030

classes/template.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,11 @@ public function delete_element($elementid) {
266266
* Generate the PDF for the template.
267267
*
268268
* @param bool $preview true if it is a preview, false otherwise
269-
* @param int $userid the id of the user whose certificate we want to view
269+
* @param int|null $userid the id of the user whose certificate we want to view
270270
* @param bool $return Do we want to return the contents of the PDF?
271271
* @return string|void Can return the PDF in string format if specified.
272272
*/
273-
public function generate_pdf(bool $preview = false, int $userid = null, bool $return = false) {
273+
public function generate_pdf(bool $preview = false, ?int $userid = null, bool $return = false) {
274274
global $CFG, $DB, $USER;
275275

276276
if (empty($userid)) {

element/expiry/classes/element.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace customcertelement_expiry;
2626

27-
use \mod_customcert\element_helper;
27+
use mod_customcert\element_helper;
2828

2929
/**
3030
* The customcert element expiry's core interaction API.

tests/email_certificate_task_test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,10 @@ public function test_email_certificates_students_havent_met_required_criteria():
483483
],
484484
],
485485
'showc' => [
486-
false
486+
false,
487487
],
488-
]
489-
)
488+
],
489+
),
490490
]);
491491

492492
// Create template object.

tests/generator/lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class mod_customcert_generator extends testing_module_generator {
4040
* @param array|null $options
4141
* @return stdClass
4242
*/
43-
public function create_instance($record = null, array $options = null) {
43+
public function create_instance($record = null, ?array $options = null) {
4444
$record = (object)(array)$record;
4545

4646
$defaultsettings = [

0 commit comments

Comments
 (0)