Skip to content

Commit

Permalink
Make code checker happy
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Aug 24, 2024
1 parent cc76f8e commit 3d819ee
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions classes/element_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,11 @@ public static function get_grade_item_info($gradeitemid, $gradeformat, $userid)
);
}

/**
* Helper function to return all the date formats.
*
* @return array the list of date formats
*/
public static function get_date_formats(): array {
// Hard-code date so users can see the difference between short dates with and without the leading zero.
// Eg. 06/07/18 vs 6/07/18.
Expand Down
2 changes: 1 addition & 1 deletion classes/report_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace mod_customcert;

use \customcertelement_expiry\element as expiry_element;
use customcertelement_expiry\element as expiry_element;

defined('MOODLE_INTERNAL') || die;

Expand Down
4 changes: 2 additions & 2 deletions classes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ public function delete_element($elementid) {
* Generate the PDF for the template.
*
* @param bool $preview true if it is a preview, false otherwise
* @param int $userid the id of the user whose certificate we want to view
* @param int|null $userid the id of the user whose certificate we want to view
* @param bool $return Do we want to return the contents of the PDF?
* @return string|void Can return the PDF in string format if specified.
*/
public function generate_pdf(bool $preview = false, int $userid = null, bool $return = false) {
public function generate_pdf(bool $preview = false, ?int $userid = null, bool $return = false) {
global $CFG, $DB, $USER;

if (empty($userid)) {
Expand Down
2 changes: 1 addition & 1 deletion element/expiry/classes/element.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace customcertelement_expiry;

use \mod_customcert\element_helper;
use mod_customcert\element_helper;

/**
* The customcert element expiry's core interaction API.
Expand Down
6 changes: 3 additions & 3 deletions tests/email_certificate_task_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@ public function test_email_certificates_students_havent_met_required_criteria():
],
],
'showc' => [
false
false,
],
]
)
],
),
]);

// Create template object.
Expand Down
2 changes: 1 addition & 1 deletion tests/generator/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class mod_customcert_generator extends testing_module_generator {
* @param array|null $options
* @return stdClass
*/
public function create_instance($record = null, array $options = null) {
public function create_instance($record = null, ?array $options = null) {
$record = (object)(array)$record;

$defaultsettings = [
Expand Down

0 comments on commit 3d819ee

Please sign in to comment.