Skip to content

Commit

Permalink
Use phpcbf to add trailing commas to multiple arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Feb 8, 2024
1 parent 94290e8 commit 0212fa3
Show file tree
Hide file tree
Showing 36 changed files with 103 additions and 96 deletions.
2 changes: 1 addition & 1 deletion classes/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion classes/element.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions classes/element_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function save_element_parameters() {
'value' => new \external_value(PARAM_RAW, 'The value of the field'),
]
)
)
),
]
);
}
Expand All @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions classes/manage_templates_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public function __construct($context) {

$columns = [
'name',
'actions'
'actions',
];

$headers = [
get_string('name'),
''
'',
];

$this->define_columns($columns);
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions classes/my_certificates_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions classes/output/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand All @@ -127,7 +127,7 @@ public static function mobile_view_activity($args) {
'javascript' => '',
'otherdata' => [
'group' => $groupid,
]
],
];
}

Expand Down
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions classes/report_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
);

Expand All @@ -182,7 +182,7 @@ public function col_actions($user) {
[
'id' => $this->cm->id,
'deleteissue' => $user->issueid,
'sesskey' => sesskey()
'sesskey' => sesskey(),
]
);

Expand Down
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
60 changes: 30 additions & 30 deletions db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand All @@ -45,8 +45,8 @@
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
]
'manager' => CAP_ALLOW,
],
],

'mod/customcert:manage' => [
Expand All @@ -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' => [
Expand All @@ -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' => [
Expand All @@ -92,85 +92,85 @@
'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' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
'manager' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/course:manageactivities'
'clonepermissionsfrom' => 'moodle/course:manageactivities',
],

'mod/customcert:manageemailteachers' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
'manager' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/course:manageactivities'
'clonepermissionsfrom' => 'moodle/course:manageactivities',
],

'mod/customcert:manageemailothers' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
'manager' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/course:manageactivities'
'clonepermissionsfrom' => 'moodle/course:manageactivities',
],

'mod/customcert:manageverifyany' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
'manager' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/course:manageactivities'
'clonepermissionsfrom' => 'moodle/course:manageactivities',
],

'mod/customcert:managerequiredtime' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
'manager' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/course:manageactivities'
'clonepermissionsfrom' => 'moodle/course:manageactivities',
],

'mod/customcert:manageprotection' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
'manager' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/course:manageactivities'
'clonepermissionsfrom' => 'moodle/course:manageactivities',
],

'mod/customcert:managelanguages' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
'manager' => CAP_ALLOW,
],
'clonepermissionsfrom' => 'moodle/course:manageactivities'
'clonepermissionsfrom' => 'moodle/course:manageactivities',
],
];
12 changes: 6 additions & 6 deletions db/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -49,7 +49,7 @@
['pluginname', 'customcert'],
['receiveddate', 'customcert'],
['requiredtimenotmet', 'customcert'],
['selectagroup', 'moodle']
]
]
['selectagroup', 'moodle'],
],
],
];
Loading

0 comments on commit 0212fa3

Please sign in to comment.