Skip to content

Commit

Permalink
Fix code standards
Browse files Browse the repository at this point in the history
  • Loading branch information
aydevworks committed Feb 21, 2024
1 parent 8b0f843 commit 9edcf05
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion apiclients/easikit/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
*
* @return string
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:metadata';
}
}
2 changes: 1 addition & 1 deletion apiclients/stutalkdirect/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
*
* @return string
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:metadata';
}
}
4 changes: 2 additions & 2 deletions classes/assessment/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function get_all_participants(): array {
*
* @return int|null
*/
public function get_start_date() : ?int {
public function get_start_date(): ?int {
return $this->moduleinstance->allowsubmissionsfromdate;
}

Expand All @@ -49,7 +49,7 @@ public function get_start_date() : ?int {
*
* @return int|null
*/
public function get_end_date() : ?int {
public function get_end_date(): ?int {
return $this->moduleinstance->duedate;
}
}
4 changes: 2 additions & 2 deletions classes/assessment/quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function get_all_participants(): array {
*
* @return int|null
*/
public function get_start_date() : ?int {
public function get_start_date(): ?int {
return $this->moduleinstance->timeopen;
}

Expand All @@ -49,7 +49,7 @@ public function get_start_date() : ?int {
*
* @return int|null
*/
public function get_end_date() : ?int {
public function get_end_date(): ?int {
return $this->moduleinstance->timeclose;
}
}
4 changes: 2 additions & 2 deletions classes/assessment/turnitintooltwo.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function get_all_participants(): array {
*
* @return int|null
*/
public function get_start_date() : ?int {
public function get_start_date(): ?int {
if ($this->partid) {
// Return the start date of this part.
return $this->turnitinparts[$this->partid]->dtstart;
Expand All @@ -80,7 +80,7 @@ public function get_start_date() : ?int {
*
* @return int|null
*/
public function get_end_date() : ?int {
public function get_end_date(): ?int {
if ($this->partid) {
// Return the end date of the part currently pointing to.
return $this->turnitinparts[$this->partid]->dtdue;
Expand Down
4 changes: 2 additions & 2 deletions classes/logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class logger {
* @return bool|int
* @throws \dml_exception
*/
public static function log (string $message, string $requesturl = null, string $data = null, string $response = null) {
public static function log(string $message, string $requesturl = null, string $data = null, string $response = null) {
global $DB, $USER;

// Create the insert object.
Expand All @@ -61,7 +61,7 @@ public static function log (string $message, string $requesturl = null, string $
* @return bool|int
* @throws \dml_exception
*/
public static function log_request_error (string $message, irequest $request, string $response = null) {
public static function log_request_error(string $message, irequest $request, string $response = null) {
global $DB, $USER;

// Create the insert object.
Expand Down
8 changes: 4 additions & 4 deletions classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ public function push_submission_log_to_sits(\stdClass $assessmentmapping, int $u
* @throws \dml_exception
* @throws \moodle_exception
*/
public function get_required_data_for_pushing (\stdClass $assessmentmapping, int $userid): \stdClass {
public function get_required_data_for_pushing(\stdClass $assessmentmapping, int $userid): \stdClass {
global $USER;

// Get SPR_CODE from SITS.
Expand Down Expand Up @@ -830,7 +830,7 @@ public function get_required_data_for_pushing (\stdClass $assessmentmapping, int
* @return array
* @throws \dml_exception
*/
public function get_transfer_logs (int $assessmentmappingid, int $userid, string $type = null): array {
public function get_transfer_logs(int $assessmentmappingid, int $userid, string $type = null): array {
global $DB;

// Initialize params.
Expand Down Expand Up @@ -1409,8 +1409,8 @@ public function get_data_for_page_update(int $courseid, int $couresmoduleid = 0)
* @throws \dml_exception
*/
private function save_transfer_log(
string $type, int $assessmentmappingid, int $userid, mixed $request, array $response, ?int $taskid, int $errorlogid = null)
: void {
string $type, int $assessmentmappingid, int $userid, mixed $request, array $response, ?int $taskid, int $errorlogid = null
): void {
global $USER, $DB;
$insert = new \stdClass();
$insert->type = $type;
Expand Down
6 changes: 3 additions & 3 deletions classes/output/pushrecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function __construct(\stdClass $student, int $coursemoduleid, \stdClass $
* @return void
* @throws \moodle_exception
*/
protected function set_grade (int $coursemoduleid, int $studentid): void {
protected function set_grade(int $coursemoduleid, int $studentid): void {
$grade = $this->manager->get_student_grade($coursemoduleid, $studentid);
if (isset($grade)) {
$this->marks = $grade;
Expand All @@ -149,7 +149,7 @@ protected function set_grade (int $coursemoduleid, int $studentid): void {
* @param \stdClass $student
* @return void
*/
protected function set_student_info (\stdClass $student): void {
protected function set_student_info(\stdClass $student): void {
$this->userid = $student->id;
$this->idnumber = $student->idnumber;
$this->firstname = $student->firstname;
Expand All @@ -165,7 +165,7 @@ protected function set_student_info (\stdClass $student): void {
* @throws \dml_exception
* @throws \moodle_exception
*/
protected function set_submission (int $coursemoduleid, int $studentid): void {
protected function set_submission(int $coursemoduleid, int $studentid): void {

// Get submission.
$submission = submissionfactory::get_submission($coursemoduleid, $studentid);
Expand Down
10 changes: 5 additions & 5 deletions classes/output/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(moodle_page $page, $target) {
* @return string Rendered HTML
* @throws \moodle_exception
*/
public function render_button(string $id, string $name, string $disabled = '', string $class = '') : string {
public function render_button(string $id, string $name, string $disabled = '', string $class = ''): string {
return $this->output->render_from_template(
'local_sitsgradepush/button',
['id' => $id, 'name' => $name, 'disabled' => $disabled, 'class' => $class]
Expand All @@ -78,7 +78,7 @@ public function render_button(string $id, string $name, string $disabled = '', s
* @return string
* @throws \moodle_exception
*/
public function render_link(string $id, string $name, string $url) : string {
public function render_link(string $id, string $name, string $url): string {
return $this->output->render_from_template('local_sitsgradepush/link', ['id' => $id, 'name' => $name, 'url' => $url]);
}

Expand All @@ -90,7 +90,7 @@ public function render_link(string $id, string $name, string $url) : string {
* @return string Rendered HTML
* @throws \moodle_exception
*/
public function render_marks_transfer_history_page(array $assessmentdata, int $courseid) : string {
public function render_marks_transfer_history_page(array $assessmentdata, int $courseid): string {
// Check if the user has the capability to see the submission log column.
$showsublogcolumn = has_capability('local/sitsgradepush:showsubmissionlogcolumn', \context_course::instance($courseid));

Expand Down Expand Up @@ -155,7 +155,7 @@ public function render_marks_transfer_history_page(array $assessmentdata, int $c
* @throws \dml_exception
* @throws \moodle_exception
*/
public function render_dashboard(array $moduledeliveries, int $courseid) : string {
public function render_dashboard(array $moduledeliveries, int $courseid): string {
// Set default value for the select module delivery dropdown list.
$options[] = (object) ['value' => 'none', 'name' => 'NONE'];

Expand Down Expand Up @@ -305,7 +305,7 @@ public function render_existing_activity_page(array $param): bool|string {
* @param int|null $errortype
* @return string
*/
private function get_label_html(int $errortype = null) : string {
private function get_label_html(int $errortype = null): string {
// This is for old data that does not have the error type.
if (is_null($errortype)) {
return '<span class="badge badge-danger">'.errormanager::get_error_label(errormanager::ERROR_UNKNOWN).'</span> ';
Expand Down
4 changes: 2 additions & 2 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class provider implements
*
* @return string
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:metadata';
}

Expand All @@ -46,7 +46,7 @@ public static function get_reason() : string {
* @param collection $collection The initialised collection to add items to.
* @return collection A listing of user data stored through this system.
*/
public static function get_metadata(collection $collection) : collection {
public static function get_metadata(collection $collection): collection {
$collection->add_database_table('local_sitsgradepush_tfr_log', [
'type' => 'privacy:metadata:local_sitsgradepush_tfr_log:type',
'userid' => 'privacy:metadata:local_sitsgradepush_tfr_log:userid',
Expand Down
2 changes: 1 addition & 1 deletion classes/task/pushtask.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class pushtask extends scheduled_task {
* @return string
* @throws \coding_exception
*/
public function get_name() : string {
public function get_name(): string {
return get_string('task:pushtask:name', 'local_sitsgradepush');
}

Expand Down
2 changes: 1 addition & 1 deletion classes/taskmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public static function get_pending_task_in_queue(int $assessmentmappingid): bool
* @throws \dml_exception
* @throws \moodle_exception
*/
public static function send_email_notification(int $taskid) : void {
public static function send_email_notification(int $taskid): void {
global $DB, $PAGE, $OUTPUT;

// Get the content of the task.
Expand Down

0 comments on commit 9edcf05

Please sign in to comment.