From 316600073e5af28b914578c507ae5e5ae1b6128c Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 8 Feb 2024 19:24:39 +0000 Subject: [PATCH] Use phpcbf to add trailing commas to multiple arrays --- classes/edit_form.php | 2 +- classes/element.php | 2 +- classes/element_helper.php | 4 +- classes/external.php | 8 +-- classes/manage_templates_table.php | 8 +-- classes/my_certificates_table.php | 4 +- classes/output/mobile.php | 4 +- classes/privacy/provider.php | 2 +- classes/report_table.php | 4 +- composer.json | 9 ++- db/access.php | 60 ++++++++++---------- db/mobile.php | 12 ++-- db/services.php | 6 +- db/tasks.php | 4 +- edit.php | 4 +- element/bgimage/db/upgrade.php | 2 +- element/coursefield/classes/element.php | 2 +- element/coursename/classes/element.php | 2 +- element/date/classes/element.php | 6 +- element/daterange/tests/element_test.php | 2 +- element/digitalsignature/classes/element.php | 8 +-- element/grade/classes/element.php | 2 +- element/gradeitemname/classes/element.php | 2 +- element/image/classes/element.php | 8 +-- element/image/db/upgrade.php | 2 +- element/qrcode/classes/element.php | 4 +- element/userfield/classes/element.php | 2 +- element/userpicture/classes/element.php | 2 +- index.php | 2 +- lib.php | 4 +- manage_templates.php | 2 +- mod_form.php | 4 +- tests/element_helper_test.php | 4 +- tests/generator/lib.php | 2 +- tests/lib_test.php | 2 +- view.php | 2 +- 36 files changed, 103 insertions(+), 96 deletions(-) diff --git a/classes/edit_form.php b/classes/edit_form.php index bbf110ad..bb6af38c 100644 --- a/classes/edit_form.php +++ b/classes/edit_form.php @@ -87,7 +87,7 @@ public function definition() { 'tid' => $this->tid, 'aid' => 1, 'action' => 'addpage', - 'sesskey' => sesskey() + 'sesskey' => sesskey(), ] ); $icon = $OUTPUT->pix_icon('t/switch_plus', get_string('addcertpage', 'customcert')); diff --git a/classes/element.php b/classes/element.php index d61c4ff8..61c2fad3 100644 --- a/classes/element.php +++ b/classes/element.php @@ -311,7 +311,7 @@ public function definition_after_data($mform) { 'posy' => $this->posy, 'width' => $this->width, 'refpoint' => $this->refpoint, - 'alignment' => $this->get_alignment() + 'alignment' => $this->get_alignment(), ]; foreach ($properties as $property => $value) { if (!is_null($value) && $mform->elementExists($property)) { diff --git a/classes/element_helper.php b/classes/element_helper.php index f5d4dcc9..8f5d4dda 100644 --- a/classes/element_helper.php +++ b/classes/element_helper.php @@ -410,7 +410,7 @@ public static function validate_colour($colour) { 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', - 'whitesmoke', 'yellow', 'yellowgreen' + 'whitesmoke', 'yellow', 'yellowgreen', ]; if (preg_match('/^#?([[:xdigit:]]{3}){1,2}$/', $colour)) { @@ -626,7 +626,7 @@ public static function get_mod_grade_info($cmid, $gradeformat, $userid) { 'itemmodule' => $module->name, 'iteminstance' => $cm->instance, 'courseid' => $cm->course, - 'itemnumber' => 0 + 'itemnumber' => 0, ]; $gradeitem = \grade_item::fetch($params); diff --git a/classes/external.php b/classes/external.php index c11b1b33..b9f20f28 100644 --- a/classes/external.php +++ b/classes/external.php @@ -52,7 +52,7 @@ public static function save_element_parameters() { 'value' => new \external_value(PARAM_RAW, 'The value of the field'), ] ) - ) + ), ] ); } @@ -71,7 +71,7 @@ public static function save_element($templateid, $elementid, $values) { $params = [ 'templateid' => $templateid, 'elementid' => $elementid, - 'values' => $values + 'values' => $values, ]; self::validate_parameters(self::save_element_parameters(), $params); @@ -142,7 +142,7 @@ public static function get_element_html($templateid, $elementid) { $params = [ 'templateid' => $templateid, - 'elementid' => $elementid + 'elementid' => $elementid, ]; self::validate_parameters(self::get_element_html_parameters(), $params); @@ -202,7 +202,7 @@ public static function delete_issue($certificateid, $issueid) { $params = [ 'certificateid' => $certificateid, - 'issueid' => $issueid + 'issueid' => $issueid, ]; self::validate_parameters(self::delete_issue_parameters(), $params); diff --git a/classes/manage_templates_table.php b/classes/manage_templates_table.php index 0a011d6f..8ea02e09 100644 --- a/classes/manage_templates_table.php +++ b/classes/manage_templates_table.php @@ -54,12 +54,12 @@ public function __construct($context) { $columns = [ 'name', - 'actions' + 'actions', ]; $headers = [ get_string('name'), - '' + '', ]; $this->define_columns($columns); @@ -98,7 +98,7 @@ public function col_actions($template) { [ 'tid' => $template->id, 'action' => 'duplicate', - 'sesskey' => sesskey() + 'sesskey' => sesskey(), ] ); $duplicateicon = $OUTPUT->action_icon($duplicatelink, new \pix_icon('t/copy', get_string('duplicate')), null, @@ -109,7 +109,7 @@ public function col_actions($template) { [ 'tid' => $template->id, 'action' => 'delete', - 'sesskey' => sesskey() + 'sesskey' => sesskey(), ] ); $deleteicon = $OUTPUT->action_icon($deletelink, new \pix_icon('t/delete', get_string('delete')), null, diff --git a/classes/my_certificates_table.php b/classes/my_certificates_table.php index a9090cc1..c9a3426f 100644 --- a/classes/my_certificates_table.php +++ b/classes/my_certificates_table.php @@ -57,13 +57,13 @@ public function __construct($userid, $download = null) { 'name', 'coursename', 'timecreated', - 'code' + 'code', ]; $headers = [ get_string('name'), get_string('course'), get_string('receiveddate', 'customcert'), - get_string('code', 'customcert') + get_string('code', 'customcert'), ]; // Check if we were passed a filename, which means we want to download it. diff --git a/classes/output/mobile.php b/classes/output/mobile.php index 9ebbec69..2ede1027 100644 --- a/classes/output/mobile.php +++ b/classes/output/mobile.php @@ -114,7 +114,7 @@ public static function mobile_view_activity($args) { 'hasrecipients' => !empty($recipients), 'recipients' => array_values($recipients), 'numrecipients' => count($recipients), - 'currenttimestamp' => time() + 'currenttimestamp' => time(), ]; return [ @@ -127,7 +127,7 @@ public static function mobile_view_activity($args) { 'javascript' => '', 'otherdata' => [ 'group' => $groupid, - ] + ], ]; } diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 6ed44cf0..6860ed9d 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -161,7 +161,7 @@ public static function export_user_data(approved_contextlist $contextlist) { $carry[] = [ 'code' => $record->code, 'emailed' => transform::yesno($record->emailed), - 'timecreated' => transform::datetime($record->timecreated) + 'timecreated' => transform::datetime($record->timecreated), ]; return $carry; }, function($customcertid, $data) use ($user, $customcertidstocmids) { diff --git a/classes/report_table.php b/classes/report_table.php index 40cc4ab2..be8f2986 100644 --- a/classes/report_table.php +++ b/classes/report_table.php @@ -161,7 +161,7 @@ public function col_download($user) { $link = new \moodle_url('/mod/customcert/view.php', [ 'id' => $this->cm->id, - 'downloadissue' => $user->id + 'downloadissue' => $user->id, ] ); @@ -182,7 +182,7 @@ public function col_actions($user) { [ 'id' => $this->cm->id, 'deleteissue' => $user->issueid, - 'sesskey' => sesskey() + 'sesskey' => sesskey(), ] ); diff --git a/composer.json b/composer.json index f0722563..d8462ef5 100644 --- a/composer.json +++ b/composer.json @@ -2,9 +2,16 @@ "name": "mdjnelson/moodle-mod_customcert", "type": "moodle-mod", "require": { - "composer/installers": "~1.0" + "composer/installers": "~1.0", + "slevomat/coding-standard": "~8.0" }, "extra": { "installer-name": "customcert" + }, + "config": { + "allow-plugins": { + "composer/installers": true, + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/db/access.php b/db/access.php index f3f71555..51966b02 100644 --- a/db/access.php +++ b/db/access.php @@ -32,9 +32,9 @@ 'contextlevel' => CONTEXT_COURSE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW + 'manager' => CAP_ALLOW, ], - 'clonepermissionsfrom' => 'moodle/course:manageactivities' + 'clonepermissionsfrom' => 'moodle/course:manageactivities', ], 'mod/customcert:view' => [ @@ -45,8 +45,8 @@ 'student' => CAP_ALLOW, 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW - ] + 'manager' => CAP_ALLOW, + ], ], 'mod/customcert:manage' => [ @@ -55,16 +55,16 @@ 'contextlevel' => CONTEXT_MODULE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW - ] + 'manager' => CAP_ALLOW, + ], ], 'mod/customcert:receiveissue' => [ 'captype' => 'read', 'contextlevel' => CONTEXT_MODULE, 'archetypes' => [ - 'student' => CAP_ALLOW - ] + 'student' => CAP_ALLOW, + ], ], 'mod/customcert:viewreport' => [ @@ -74,16 +74,16 @@ 'archetypes' => [ 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW - ] + 'manager' => CAP_ALLOW, + ], ], 'mod/customcert:viewallcertificates' => [ 'captype' => 'read', 'contextlevel' => CONTEXT_SYSTEM, 'archetypes' => [ - 'manager' => CAP_ALLOW - ] + 'manager' => CAP_ALLOW, + ], ], 'mod/customcert:verifycertificate' => [ @@ -92,16 +92,16 @@ 'archetypes' => [ 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW - ] + 'manager' => CAP_ALLOW, + ], ], 'mod/customcert:verifyallcertificates' => [ 'captype' => 'read', 'contextlevel' => CONTEXT_SYSTEM, 'archetypes' => [ - 'manager' => CAP_ALLOW - ] + 'manager' => CAP_ALLOW, + ], ], 'mod/customcert:manageemailstudents' => [ @@ -109,9 +109,9 @@ 'contextlevel' => CONTEXT_COURSE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW + 'manager' => CAP_ALLOW, ], - 'clonepermissionsfrom' => 'moodle/course:manageactivities' + 'clonepermissionsfrom' => 'moodle/course:manageactivities', ], 'mod/customcert:manageemailteachers' => [ @@ -119,9 +119,9 @@ 'contextlevel' => CONTEXT_COURSE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW + 'manager' => CAP_ALLOW, ], - 'clonepermissionsfrom' => 'moodle/course:manageactivities' + 'clonepermissionsfrom' => 'moodle/course:manageactivities', ], 'mod/customcert:manageemailothers' => [ @@ -129,9 +129,9 @@ 'contextlevel' => CONTEXT_COURSE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW + 'manager' => CAP_ALLOW, ], - 'clonepermissionsfrom' => 'moodle/course:manageactivities' + 'clonepermissionsfrom' => 'moodle/course:manageactivities', ], 'mod/customcert:manageverifyany' => [ @@ -139,9 +139,9 @@ 'contextlevel' => CONTEXT_COURSE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW + 'manager' => CAP_ALLOW, ], - 'clonepermissionsfrom' => 'moodle/course:manageactivities' + 'clonepermissionsfrom' => 'moodle/course:manageactivities', ], 'mod/customcert:managerequiredtime' => [ @@ -149,9 +149,9 @@ 'contextlevel' => CONTEXT_COURSE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW + 'manager' => CAP_ALLOW, ], - 'clonepermissionsfrom' => 'moodle/course:manageactivities' + 'clonepermissionsfrom' => 'moodle/course:manageactivities', ], 'mod/customcert:manageprotection' => [ @@ -159,9 +159,9 @@ 'contextlevel' => CONTEXT_COURSE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW + 'manager' => CAP_ALLOW, ], - 'clonepermissionsfrom' => 'moodle/course:manageactivities' + 'clonepermissionsfrom' => 'moodle/course:manageactivities', ], 'mod/customcert:managelanguages' => [ @@ -169,8 +169,8 @@ 'contextlevel' => CONTEXT_COURSE, 'archetypes' => [ 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW + 'manager' => CAP_ALLOW, ], - 'clonepermissionsfrom' => 'moodle/course:manageactivities' + 'clonepermissionsfrom' => 'moodle/course:manageactivities', ], ]; diff --git a/db/mobile.php b/db/mobile.php index 3348dc9e..2982fbf7 100644 --- a/db/mobile.php +++ b/db/mobile.php @@ -36,9 +36,9 @@ 'method' => 'mobile_view_activity', // Main function in \mod_customcert\output\mobile. 'styles' => [ 'url' => '/mod/customcert/mobile/styles.css', - 'version' => 1 - ] - ] + 'version' => 1, + ], + ], ], 'lang' => [ // Language strings that are used in all the handlers. ['deleteissueconfirm', 'customcert'], @@ -49,7 +49,7 @@ ['pluginname', 'customcert'], ['receiveddate', 'customcert'], ['requiredtimenotmet', 'customcert'], - ['selectagroup', 'moodle'] - ] - ] + ['selectagroup', 'moodle'], + ], + ], ]; diff --git a/db/services.php b/db/services.php index 8a481a58..776bf9d1 100644 --- a/db/services.php +++ b/db/services.php @@ -32,7 +32,7 @@ 'description' => 'Delete an issue for a certificate', 'type' => 'write', 'ajax' => true, - 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE] + 'services' => [MOODLE_OFFICIAL_MOBILE_SERVICE], ], 'mod_customcert_save_element' => [ 'classname' => 'mod_customcert\external', @@ -40,7 +40,7 @@ 'classpath' => '', 'description' => 'Saves data for an element', 'type' => 'write', - 'ajax' => true + 'ajax' => true, ], 'mod_customcert_get_element_html' => [ 'classname' => 'mod_customcert\external', @@ -48,6 +48,6 @@ 'classpath' => '', 'description' => 'Returns the HTML to display for an element', 'type' => 'read', - 'ajax' => true + 'ajax' => true, ], ]; diff --git a/db/tasks.php b/db/tasks.php index fa58805d..fd2ddb07 100644 --- a/db/tasks.php +++ b/db/tasks.php @@ -33,6 +33,6 @@ 'hour' => '*', 'day' => '*', 'month' => '*', - 'dayofweek' => '*' - ] + 'dayofweek' => '*', + ], ]; diff --git a/edit.php b/edit.php index bd0218ed..d81416a5 100644 --- a/edit.php +++ b/edit.php @@ -119,7 +119,7 @@ 'action' => 'deletepage', 'aid' => $actionid, 'confirm' => 1, - 'sesskey' => sesskey() + 'sesskey' => sesskey(), ] ); } @@ -140,7 +140,7 @@ 'action' => 'deleteelement', 'aid' => $actionid, 'confirm' => 1, - 'sesskey' => sesskey() + 'sesskey' => sesskey(), ] ); } diff --git a/element/bgimage/db/upgrade.php b/element/bgimage/db/upgrade.php index e5712a3f..44d5bef0 100644 --- a/element/bgimage/db/upgrade.php +++ b/element/bgimage/db/upgrade.php @@ -48,7 +48,7 @@ function xmldb_customcertelement_bgimage_upgrade($oldversion) { 'filepath' => $file->get_filepath(), 'filename' => $file->get_filename(), 'width' => (int) $elementinfo->width, - 'height' => (int) $elementinfo->height + 'height' => (int) $elementinfo->height, ]; $arrtostore = json_encode($arrtostore); $DB->set_field('customcert_elements', 'data', $arrtostore, ['id' => $image->id]); diff --git a/element/coursefield/classes/element.php b/element/coursefield/classes/element.php index 53017db0..08ae4aaa 100644 --- a/element/coursefield/classes/element.php +++ b/element/coursefield/classes/element.php @@ -44,7 +44,7 @@ public function render_form_elements($mform) { $coursefields = [ 'fullname' => get_string('fullnamecourse'), 'shortname' => get_string('shortnamecourse'), - 'idnumber' => get_string('idnumbercourse') + 'idnumber' => get_string('idnumbercourse'), ]; // Get the course custom fields. $arrcustomfields = []; diff --git a/element/coursename/classes/element.php b/element/coursename/classes/element.php index 5f50ff64..d10ca184 100644 --- a/element/coursename/classes/element.php +++ b/element/coursename/classes/element.php @@ -134,7 +134,7 @@ protected function get_course_name_detail(): string { public static function get_course_name_display_options(): array { return [ self::COURSE_FULL_NAME => get_string('coursefullname', 'customcertelement_coursename'), - self::COURSE_SHORT_NAME => get_string('courseshortname', 'customcertelement_coursename') + self::COURSE_SHORT_NAME => get_string('courseshortname', 'customcertelement_coursename'), ]; } } diff --git a/element/date/classes/element.php b/element/date/classes/element.php index d241f030..e28d1780 100644 --- a/element/date/classes/element.php +++ b/element/date/classes/element.php @@ -150,7 +150,7 @@ public function save_unique_data($data) { // Array of data we will be storing in the database. $arrtostore = [ 'dateitem' => $data->dateitem, - 'dateformat' => $data->dateformat + 'dateformat' => $data->dateformat, ]; // Encode these variables before saving into the DB. @@ -347,7 +347,7 @@ public static function get_date_formats() { $dateformats = [ 1 => userdate($date, '%B %d, %Y'), - 2 => userdate($date, '%B %d' . $suffix . ', %Y') + 2 => userdate($date, '%B %d' . $suffix . ', %Y'), ]; $strdateformats = [ @@ -365,7 +365,7 @@ public static function get_date_formats() { 'strftimemonthyear', 'strftimerecent', 'strftimerecentfull', - 'strftimetime' + 'strftimetime', ]; foreach ($strdateformats as $strdateformat) { diff --git a/element/daterange/tests/element_test.php b/element/daterange/tests/element_test.php index 831499e1..b21072fc 100644 --- a/element/daterange/tests/element_test.php +++ b/element/daterange/tests/element_test.php @@ -62,7 +62,7 @@ protected function build_element_data(stdClass $data) { 'posx' => 0, 'posy' => 0, 'width' => 100, - 'refpoint' => 1 + 'refpoint' => 1, ]; } diff --git a/element/digitalsignature/classes/element.php b/element/digitalsignature/classes/element.php index 07a4ce4a..0c4c5ab7 100644 --- a/element/digitalsignature/classes/element.php +++ b/element/digitalsignature/classes/element.php @@ -49,7 +49,7 @@ public function __construct($element) { $this->signaturefilemanageroptions = [ 'maxbytes' => $COURSE->maxbytes, 'subdirs' => 1, - 'accepted_types' => ['.crt'] + 'accepted_types' => ['.crt'], ]; parent::__construct($element); @@ -145,7 +145,7 @@ public function save_unique_data($data) { 'signaturereason' => $data->signaturereason, 'signaturecontactinfo' => $data->signaturecontactinfo, 'width' => !empty($data->width) ? (int) $data->width : 0, - 'height' => !empty($data->height) ? (int) $data->height : 0 + 'height' => !empty($data->height) ? (int) $data->height : 0, ]; // Array of data we will be storing in the database. @@ -170,7 +170,7 @@ public function save_unique_data($data) { 'signaturefilearea' => $signaturefile->get_filearea(), 'signatureitemid' => $signaturefile->get_itemid(), 'signaturefilepath' => $signaturefile->get_filepath(), - 'signaturefilename' => $signaturefile->get_filename() + 'signaturefilename' => $signaturefile->get_filename(), ]; } } @@ -222,7 +222,7 @@ public function render($pdf, $preview, $user) { 'Name' => $imageinfo->signaturename, 'Location' => $imageinfo->signaturelocation, 'Reason' => $imageinfo->signaturereason, - 'ContactInfo' => $imageinfo->signaturecontactinfo + 'ContactInfo' => $imageinfo->signaturecontactinfo, ]; $pdf->setSignature('file://' . $location, '', $imageinfo->signaturepassword, '', 2, $info); $pdf->setSignatureAppearance($this->get_posx(), $this->get_posy(), $imageinfo->width, $imageinfo->height); diff --git a/element/grade/classes/element.php b/element/grade/classes/element.php index 7b4e6cbf..1fa4d56e 100644 --- a/element/grade/classes/element.php +++ b/element/grade/classes/element.php @@ -75,7 +75,7 @@ public function save_unique_data($data) { // Array of data we will be storing in the database. $arrtostore = [ 'gradeitem' => $data->gradeitem, - 'gradeformat' => $data->gradeformat + 'gradeformat' => $data->gradeformat, ]; // Encode these variables before saving into the DB. diff --git a/element/gradeitemname/classes/element.php b/element/gradeitemname/classes/element.php index 837adaf5..2ce8a251 100644 --- a/element/gradeitemname/classes/element.php +++ b/element/gradeitemname/classes/element.php @@ -138,7 +138,7 @@ protected function get_grade_item_name() : string { 'itemmodule' => $module->name, 'iteminstance' => $cm->instance, 'courseid' => $cm->course, - 'itemnumber' => 0 + 'itemnumber' => 0, ]; $gradeitem = \grade_item::fetch($params); diff --git a/element/image/classes/element.php b/element/image/classes/element.php index f1ab3e26..9e613485 100644 --- a/element/image/classes/element.php +++ b/element/image/classes/element.php @@ -49,7 +49,7 @@ public function __construct($element) { $this->filemanageroptions = [ 'maxbytes' => $COURSE->maxbytes, 'subdirs' => 1, - 'accepted_types' => 'image' + 'accepted_types' => 'image', ]; parent::__construct($element); @@ -78,7 +78,7 @@ public function render_form_elements($mform) { '0.7' => 0.7, '0.8' => 0.8, '0.9' => 0.9, - '1' => 1 + '1' => 1, ]; $mform->addElement('select', 'alphachannel', get_string('alphachannel', 'customcertelement_image'), $alphachannelvalues); $mform->setType('alphachannel', PARAM_FLOAT); @@ -151,7 +151,7 @@ public function save_form_elements($data) { public function save_unique_data($data) { $arrtostore = [ 'width' => !empty($data->width) ? (int) $data->width : 0, - 'height' => !empty($data->height) ? (int) $data->height : 0 + 'height' => !empty($data->height) ? (int) $data->height : 0, ]; if (isset($data->alphachannel)) { @@ -430,7 +430,7 @@ public function copy_element($data) { // We want to update the context of the file if it doesn't exist in the course context. $fieldupdates = [ - 'contextid' => $coursecontext->id + 'contextid' => $coursecontext->id, ]; $coursefile = $fs->create_file_from_storedfile($fieldupdates, $systemfile); } diff --git a/element/image/db/upgrade.php b/element/image/db/upgrade.php index ba791ff4..7e65125d 100644 --- a/element/image/db/upgrade.php +++ b/element/image/db/upgrade.php @@ -48,7 +48,7 @@ function xmldb_customcertelement_image_upgrade($oldversion) { 'filepath' => $file->get_filepath(), 'filename' => $file->get_filename(), 'width' => (int) $elementinfo->width, - 'height' => (int) $elementinfo->height + 'height' => (int) $elementinfo->height, ]; $arrtostore = json_encode($arrtostore); $DB->set_field('customcert_elements', 'data', $arrtostore, ['id' => $image->id]); diff --git a/element/qrcode/classes/element.php b/element/qrcode/classes/element.php index 0171b46b..4cd88977 100644 --- a/element/qrcode/classes/element.php +++ b/element/qrcode/classes/element.php @@ -91,7 +91,7 @@ public function validate_form_elements($data, $files) { public function save_unique_data($data) { $arrtostore = [ 'width' => !empty($data->width) ? (int)$data->width : 0, - 'height' => !empty($data->height) ? (int)$data->height : 0 + 'height' => !empty($data->height) ? (int)$data->height : 0, ]; return json_encode($arrtostore); @@ -159,7 +159,7 @@ public function render($pdf, $preview, $user) { $urlparams = [ 'code' => $code, - 'qrcode' => 1 + 'qrcode' => 1, ]; // We only add the 'contextid' to the link if the site setting for verifying all certificates is off, diff --git a/element/userfield/classes/element.php b/element/userfield/classes/element.php index c92384ac..50885f2c 100644 --- a/element/userfield/classes/element.php +++ b/element/userfield/classes/element.php @@ -55,7 +55,7 @@ public function render_form_elements($mform) { 'department' => fields::get_display_name('department'), 'phone1' => fields::get_display_name('phone1'), 'phone2' => fields::get_display_name('phone2'), - 'address' => fields::get_display_name('address') + 'address' => fields::get_display_name('address'), ]; // Get the user custom fields. $arrcustomfields = \availability_profile\condition::get_custom_profile_fields(); diff --git a/element/userpicture/classes/element.php b/element/userpicture/classes/element.php index 58aab610..86bcc544 100644 --- a/element/userpicture/classes/element.php +++ b/element/userpicture/classes/element.php @@ -84,7 +84,7 @@ public function save_unique_data($data) { // Array of data we will be storing in the database. $arrtostore = [ 'width' => (int) $data->width, - 'height' => (int) $data->height + 'height' => (int) $data->height, ]; return json_encode($arrtostore); diff --git a/index.php b/index.php index 65a41685..2dd43e10 100644 --- a/index.php +++ b/index.php @@ -42,7 +42,7 @@ // Add the page view to the Moodle log. $event = \mod_customcert\event\course_module_instance_list_viewed::create([ - 'context' => context_course::instance($course->id) + 'context' => context_course::instance($course->id), ]); $event->add_record_snapshot('course', $course); $event->trigger(); diff --git a/lib.php b/lib.php index 819aec3f..7cf8132c 100644 --- a/lib.php +++ b/lib.php @@ -372,7 +372,7 @@ function mod_customcert_myprofile_navigation(core_user\output\myprofile\tree $tr } $params = [ - 'userid' => $user->id + 'userid' => $user->id, ]; if ($course) { $params['course'] = $course->id; @@ -427,7 +427,7 @@ function mod_customcert_inplace_editable($itemtype, $itemid, $newvalue) { */ function mod_customcert_get_fontawesome_icon_map() { return [ - 'mod_customcert:download' => 'fa-download' + 'mod_customcert:download' => 'fa-download', ]; } diff --git a/manage_templates.php b/manage_templates.php index bb94ff12..251d1ab2 100644 --- a/manage_templates.php +++ b/manage_templates.php @@ -68,7 +68,7 @@ 'tid' => $tid, 'action' => $action, 'confirm' => 1, - 'sesskey' => sesskey() + 'sesskey' => sesskey(), ] ); diff --git a/mod_form.php b/mod_form.php index 917deec2..fb284a14 100644 --- a/mod_form.php +++ b/mod_form.php @@ -61,7 +61,7 @@ public function definition() { $deliveryoptions = [ certificate::DELIVERY_OPTION_INLINE => get_string('deliveryoptioninline', 'customcert'), - certificate::DELIVERY_OPTION_DOWNLOAD => get_string('deliveryoptiondownload', 'customcert') + certificate::DELIVERY_OPTION_DOWNLOAD => get_string('deliveryoptiondownload', 'customcert'), ]; $mform->addElement('select', 'deliveryoption', get_string('deliveryoptions', 'customcert'), $deliveryoptions); $mform->setDefault('deliveryoption', certificate::DELIVERY_OPTION_INLINE); @@ -214,7 +214,7 @@ protected function get_options_elements_with_required_caps() { 'requiredtime' => 'mod/customcert:managerequiredtime', 'protection_print' => 'mod/customcert:manageprotection', 'protection_modify' => 'mod/customcert:manageprotection', - 'protection_copy' => 'mod/customcert:manageprotection' + 'protection_copy' => 'mod/customcert:manageprotection', ]; } diff --git a/tests/element_helper_test.php b/tests/element_helper_test.php index 940bd635..5012e35d 100644 --- a/tests/element_helper_test.php +++ b/tests/element_helper_test.php @@ -199,7 +199,7 @@ public function test_get_grade_items() { $go = $this->getDataGenerator()->create_grade_item( [ 'courseid' => $course->id, - 'outcomeid' => $outcome->id + 'outcomeid' => $outcome->id, ] ); @@ -243,7 +243,7 @@ public function test_get_mod_grade_info() { 'itemtype' => 'mod', 'itemmodule' => 'assign', 'iteminstance' => $assign->id, - 'courseid' => $course->id + 'courseid' => $course->id, ] ); $datagrade = 50; diff --git a/tests/generator/lib.php b/tests/generator/lib.php index 22d69718..931d4a44 100644 --- a/tests/generator/lib.php +++ b/tests/generator/lib.php @@ -48,7 +48,7 @@ public function create_instance($record = null, array $options = null) { 'emailstudents' => 0, 'emailteachers' => 0, 'emailothers' => '', - 'protection' => '' + 'protection' => '', ]; foreach ($defaultsettings as $name => $value) { diff --git a/tests/lib_test.php b/tests/lib_test.php index 475ed47e..c200ddeb 100644 --- a/tests/lib_test.php +++ b/tests/lib_test.php @@ -100,7 +100,7 @@ private function install_languagues(): bool { 'cz' => 'cs', 'dk' => 'da', 'no' => 'nb', - 'se' => 'sv' + 'se' => 'sv', ]; get_string_manager()->reset_caches(); diff --git a/view.php b/view.php index f8f149d7..be80b426 100644 --- a/view.php +++ b/view.php @@ -71,7 +71,7 @@ 'id' => $id, 'deleteissue' => $deleteissue, 'confirm' => 1, - 'sesskey' => sesskey() + 'sesskey' => sesskey(), ] );