From 4443519f5704b1c65ecdd07ca7806c0f4a66734d Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 4 Jan 2010 17:52:59 +0000 Subject: [PATCH] Petr's review: use object instead of stdClass --- mod/workshop/allocation/manual/allocator.php | 6 ++--- mod/workshop/allocation/manual/renderer.php | 12 ++++----- mod/workshop/allocation/random/allocator.php | 6 ++--- .../random/simpletest/testallocator.php | 12 ++++----- mod/workshop/assessment.php | 4 +-- mod/workshop/develtools.php | 2 +- .../grading/accumulative/strategy.php | 26 +++++++++---------- mod/workshop/grading/lib.php | 4 +-- mod/workshop/grading/noerrors/strategy.php | 6 ++--- mod/workshop/lib.php | 12 ++++----- mod/workshop/locallib.php | 20 +++++++------- mod/workshop/renderer.php | 16 ++++++------ 12 files changed, 63 insertions(+), 63 deletions(-) diff --git a/mod/workshop/allocation/manual/allocator.php b/mod/workshop/allocation/manual/allocator.php index 871ccafadf..36949097c5 100644 --- a/mod/workshop/allocation/manual/allocator.php +++ b/mod/workshop/allocation/manual/allocator.php @@ -47,7 +47,7 @@ class workshop_manual_allocator implements workshop_allocator { protected $workshop; /** - * @param stdClass $workshop Workshop record + * @param workshop $workshop Workshop API object */ public function __construct(workshop $workshop) { $this->workshop = $workshop; @@ -136,7 +136,7 @@ class workshop_manual_allocator implements workshop_allocator { $hlauthorid = -1; // highlight this author $hlreviewerid = -1; // highlight this reviewer - $msg = new stdClass; // message to render + $msg = new object(); // message to render $m = optional_param('m', '', PARAM_ALPHANUMEXT); // message object if ($m) { @@ -195,7 +195,7 @@ class workshop_manual_allocator implements workshop_allocator { foreach ($rs as $allocation) { $currentuserid = $allocation->authorid; if (!isset($peer[$currentuserid])) { - $peer[$currentuserid] = new stdClass(); + $peer[$currentuserid] = new object(); $peer[$currentuserid]->id = $allocation->authorid; $peer[$currentuserid]->firstname = $allocation->authorfirstname; $peer[$currentuserid]->lastname = $allocation->authorlastname; diff --git a/mod/workshop/allocation/manual/renderer.php b/mod/workshop/allocation/manual/renderer.php index 096af95295..a99636fa9d 100644 --- a/mod/workshop/allocation/manual/renderer.php +++ b/mod/workshop/allocation/manual/renderer.php @@ -95,10 +95,10 @@ class moodle_mod_workshop_allocation_manual_renderer extends moodle_renderer_bas /** * Returns information about the workshop participant * - * @param stdClass $user participant data + * @param object $user participant data * @return string HTML code */ - protected function participant(stdClass $user) { + protected function participant(object $user) { $o = $this->output->user_picture($user, $this->page->course->id); $o .= fullname($user); $o .= $this->output->container_start(array('submission')); @@ -120,12 +120,12 @@ class moodle_mod_workshop_allocation_manual_renderer extends moodle_renderer_bas /** * Returns information about the current reviewers of the given participant and a selector do add new one * - * @param stdClass $user participant data + * @param object $user participant data * @param workshop $workshop workshop record * @param array $peers objects with properties to display picture and fullname * @return string html code */ - protected function reviewers_of_participant(stdClass $user, workshop $workshop, &$peers) { + protected function reviewers_of_participant(object $user, workshop $workshop, &$peers) { $o = ''; if (is_null($user->submissionid)) { $o .= $this->output->output_tag('span', array('class' => 'info'), get_string('nothingtoreview', 'workshop')); @@ -166,12 +166,12 @@ class moodle_mod_workshop_allocation_manual_renderer extends moodle_renderer_bas /** * Returns information about the current reviewees of the given participant and a selector do add new one * - * @param stdClass $user participant data + * @param object $user participant data * @param workshop $workshop workshop record * @param array $peers objects with properties to display picture and fullname * @return string html code */ - protected function reviewees_of_participant(stdClass $user, workshop $workshop, &$peers) { + protected function reviewees_of_participant(object $user, workshop $workshop, &$peers) { $o = ''; if (is_null($user->submissionid)) { $o .= $this->output->container(get_string('withoutsubmission', 'workshop'), 'info'); diff --git a/mod/workshop/allocation/random/allocator.php b/mod/workshop/allocation/random/allocator.php index db8dada198..8a1bb015b9 100644 --- a/mod/workshop/allocation/random/allocator.php +++ b/mod/workshop/allocation/random/allocator.php @@ -117,7 +117,7 @@ class workshop_random_allocator implements workshop_allocator { $this->add_new_allocations($newallocations, $authors, $reviewers); foreach ($newallocations as $newallocation) { list($reviewerid, $authorid) = each($newallocation); - $a = new stdClass(); + $a = new object(); $a->reviewername = fullname($reviewers[0][$reviewerid]); $a->authorname = fullname($authors[0][$authorid]); $o[] = 'ok::indent::' . get_string('allocationaddeddetail', 'workshop', $a); @@ -129,7 +129,7 @@ class workshop_random_allocator implements workshop_allocator { // by reviewer $o[] = 'info::' . get_string('numofdeallocatedassessment', 'workshop', count($delassessments)); foreach ($delassessments as $delassessmentkey => $delassessmentid) { - $a = new stdClass(); + $a = new object(); $a->authorname = fullname((object)array( 'lastname' => $assessments[$delassessmentid]->authorlastname, 'firstname' => $assessments[$delassessmentid]->authorfirstname)); @@ -160,7 +160,7 @@ class workshop_random_allocator implements workshop_allocator { global $OUTPUT; $m = optional_param('m', null, PARAM_INT); // status message code - $msg = new stdClass(); + $msg = new object(); if ($m == WORKSHOP_ALLOCATION_RANDOM_MSG_SUCCESS) { $msg = (object)array('text' => get_string('randomallocationdone', 'workshop'), 'sty' => 'ok'); } diff --git a/mod/workshop/allocation/random/simpletest/testallocator.php b/mod/workshop/allocation/random/simpletest/testallocator.php index d3acd13964..b93c0a2427 100644 --- a/mod/workshop/allocation/random/simpletest/testallocator.php +++ b/mod/workshop/allocation/random/simpletest/testallocator.php @@ -86,8 +86,8 @@ class workshop_allocation_random_test extends UnitTestCase { public function test_self_allocation_equal_user_groups() { // fixture setup - $authors = array(0 => array_fill_keys(array(4, 6, 10), new stdClass())); - $reviewers = array(0 => array_fill_keys(array(4, 6, 10), new stdClass())); + $authors = array(0 => array_fill_keys(array(4, 6, 10), new object())); + $reviewers = array(0 => array_fill_keys(array(4, 6, 10), new object())); // exercise SUT $newallocations = $this->allocator->self_allocation($authors, $reviewers); // verify @@ -96,8 +96,8 @@ class workshop_allocation_random_test extends UnitTestCase { public function test_self_allocation_different_user_groups() { // fixture setup - $authors = array(0 => array_fill_keys(array(1, 4, 5, 10, 13), new stdClass())); - $reviewers = array(0 => array_fill_keys(array(4, 7, 10), new stdClass())); + $authors = array(0 => array_fill_keys(array(1, 4, 5, 10, 13), new object())); + $reviewers = array(0 => array_fill_keys(array(4, 7, 10), new object())); // exercise SUT $newallocations = $this->allocator->self_allocation($authors, $reviewers); // verify @@ -106,8 +106,8 @@ class workshop_allocation_random_test extends UnitTestCase { public function test_self_allocation_skip_existing() { // fixture setup - $authors = array(0 => array_fill_keys(array(3, 4, 10), new stdClass())); - $reviewers = array(0 => array_fill_keys(array(3, 4, 10), new stdClass())); + $authors = array(0 => array_fill_keys(array(3, 4, 10), new object())); + $reviewers = array(0 => array_fill_keys(array(3, 4, 10), new object())); $assessments = array(23 => (object)array('authorid' => 3, 'reviewerid' => 3)); // exercise SUT $newallocations = $this->allocator->self_allocation($authors, $reviewers, $assessments); diff --git a/mod/workshop/assessment.php b/mod/workshop/assessment.php index cc7072b3fe..6e292b5737 100644 --- a/mod/workshop/assessment.php +++ b/mod/workshop/assessment.php @@ -34,8 +34,8 @@ if ($preview = optional_param('preview', 0, PARAM_INT)) { $cm = get_coursemodule_from_id('workshop', $preview, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $workshop = $DB->get_record('workshop', array('id' => $cm->instance), '*', MUST_EXIST); - $submission = new stdClass(); - $assessment = new stdClass(); + $submission = new object(); + $assessment = new object(); } else { $mode = 'assessment'; diff --git a/mod/workshop/develtools.php b/mod/workshop/develtools.php index 010e69298d..57347f5169 100644 --- a/mod/workshop/develtools.php +++ b/mod/workshop/develtools.php @@ -62,7 +62,7 @@ case 'mksubmissions': $c = 0; // counter foreach ($authors as $authorid => $author) { $timenow = time() - rand(0, 60 * 60 * 24 * 7); // submitted sometimes during last week - $submission = new stdClass(); + $submission = new object(); $submission->workshopid = $workshop->id; $submission->example = 0; $submission->userid = $authorid; diff --git a/mod/workshop/grading/accumulative/strategy.php b/mod/workshop/grading/accumulative/strategy.php index 82d240edff..3b18e1a46f 100644 --- a/mod/workshop/grading/accumulative/strategy.php +++ b/mod/workshop/grading/accumulative/strategy.php @@ -124,7 +124,7 @@ class workshop_accumulative_strategy implements workshop_strategy { */ protected function prepare_form_fields(array $raw) { - $formdata = new stdClass(); + $formdata = new object(); $key = 0; foreach ($raw as $dimension) { $formdata->{'dimensionid__idx_' . $key} = $dimension->id; // master id, not the local one! @@ -149,7 +149,7 @@ class workshop_accumulative_strategy implements workshop_strategy { * @param object $data Raw data returned by the dimension editor form * @return void */ - public function save_edit_strategy_form(stdClass $data) { + public function save_edit_strategy_form(object $data) { global $DB, $PAGE; if (!isset($data->strategyname) || ($data->strategyname != $this->name())) { @@ -227,15 +227,15 @@ class workshop_accumulative_strategy implements workshop_strategy { * @param object $raw Raw data returned by mform * @return array Array of objects to be inserted/updated in DB */ - protected function prepare_database_fields(stdClass $raw) { + protected function prepare_database_fields(object $raw) { global $PAGE; - $cook = new stdClass(); // to be returned + $cook = new object(); // to be returned $cook->forms = array(); // to be stored in {workshop_forms} $cook->forms_accumulative = array(); // to be stored in {workshop_forms_accumulative} for ($i = 0; $i < $raw->norepeats; $i++) { - $cook->forms_accumulative[$i] = new stdClass(); + $cook->forms_accumulative[$i] = new object(); $fieldname = 'description__idx_'.$i.'_editor'; $cook->forms_accumulative[$i]->description_editor = isset($raw->$fieldname) ? $raw->$fieldname : null; @@ -244,7 +244,7 @@ class workshop_accumulative_strategy implements workshop_strategy { $fieldname = 'weight__idx_'.$i; $cook->forms_accumulative[$i]->weight = isset($raw->$fieldname) ? $raw->$fieldname : null; - $cook->forms[$i] = new stdClass(); + $cook->forms[$i] = new object(); $cook->forms[$i]->id = isset($raw->{'dimensionid__idx_'.$i}) ? $raw->{'dimensionid__idx_'.$i} : null; $cook->forms[$i]->workshopid = $this->workshop->id; $cook->forms[$i]->sort = $i + 1; @@ -259,7 +259,7 @@ class workshop_accumulative_strategy implements workshop_strategy { * @param moodle_url $actionurl URL of form handler, defaults to auto detect the current url * @param string $mode Mode to open the form in: preview/assessment */ - public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', stdClass $assessment=null) { + public function get_assessment_form(moodle_url $actionurl=null, $mode='preview', object $assessment=null) { global $CFG; // needed because the included files use it global $PAGE; global $DB; @@ -277,7 +277,7 @@ class workshop_accumulative_strategy implements workshop_strategy { if ('assessment' === $mode and !empty($assessment)) { // load the previously saved assessment data $grades = $this->reindex_grades_by_dimension($this->get_current_assessment_data($assessment)); - $current = new stdClass(); + $current = new object(); for ($i = 0; $i < $nodimensions; $i++) { $dimid = $fields->{'dimensionid__idx_'.$i}; if (isset($grades[$dimid])) { @@ -310,7 +310,7 @@ class workshop_accumulative_strategy implements workshop_strategy { * @param object $data Raw data as returned by the assessment form * @return float|null Percentual grade for submission as suggested by the peer */ - public function save_assessment(stdClass $assessment, stdClass $data) { + public function save_assessment(object $assessment, object $data) { global $DB; if (!isset($data->strategyname) || ($data->strategyname != $this->name())) { @@ -321,7 +321,7 @@ class workshop_accumulative_strategy implements workshop_strategy { throw coding_expection('You did not send me the number of assessment dimensions to process'); } for ($i = 0; $i < $data->nodims; $i++) { - $grade = new stdClass(); + $grade = new object(); $grade->id = $data->{'gradeid__idx_' . $i}; $grade->assessmentid = $assessment->id; $grade->dimensionid = $data->{'dimensionid__idx_' . $i}; @@ -345,7 +345,7 @@ class workshop_accumulative_strategy implements workshop_strategy { * @param object $assessment Assessment record * @return array of filtered records from the table workshop_grades */ - protected function get_current_assessment_data(stdClass $assessment) { + protected function get_current_assessment_data(object $assessment) { global $DB; // fetch all grades accociated with this assessment @@ -377,10 +377,10 @@ class workshop_accumulative_strategy implements workshop_strategy { /** * Aggregates the assessment form data and sets the grade for the submission given by the peer * - * @param stdClass $assessment Assessment record + * @param object $assessment Assessment record * @return float|null Percentual grade for submission as suggested by the peer */ - protected function update_peer_grade(stdClass $assessment) { + protected function update_peer_grade(object $assessment) { $grades = $this->get_current_assessment_data($assessment); $suggested = $this->calculate_peer_grade($grades); if (!is_null($suggested)) { diff --git a/mod/workshop/grading/lib.php b/mod/workshop/grading/lib.php index 97b9da04f0..6a6105581c 100644 --- a/mod/workshop/grading/lib.php +++ b/mod/workshop/grading/lib.php @@ -60,7 +60,7 @@ interface workshop_strategy { * @param object $data Raw data as returned by the form editor * @return void */ - public function save_edit_strategy_form(stdClass $data); + public function save_edit_strategy_form(object $data); /** * Factory method returning an instance of an assessment form @@ -79,5 +79,5 @@ interface workshop_strategy { * @param object $data Raw data as returned by the assessment form * @return float|float Percentual grade for submission as suggested by the peer or null if impossible to count */ - public function save_assessment(stdClass $assessment, stdClass $data); + public function save_assessment(object $assessment, object $data); } diff --git a/mod/workshop/grading/noerrors/strategy.php b/mod/workshop/grading/noerrors/strategy.php index 292ed4b027..ccf0736a6c 100644 --- a/mod/workshop/grading/noerrors/strategy.php +++ b/mod/workshop/grading/noerrors/strategy.php @@ -85,7 +85,7 @@ class workshop_noerrors_strategy extends workshop_base_strategy { * @param object $data Raw data returned by the dimension editor form * @return void */ - public function save_form(stdClass $data) { + public function save_form(object $data) { global $DB; if (!isset($data->strategyname) || ($data->strategyname != $this->name())) { @@ -169,12 +169,12 @@ class workshop_noerrors_strategy extends workshop_base_strategy { * @param object $raw Raw data returned by mform * @return array Array of objects to be inserted/updated in DB */ - protected function _cook_form_data(stdClass $raw) { + protected function _cook_form_data(object $raw) { $cook = array(); for ($k = 0; $k < $raw->numofdimensions; $k++) { - $cook[$k] = new stdClass(); + $cook[$k] = new object(); $cook[$k]->id = isset($raw->dimensionid[$k]) ? $raw->dimensionid[$k] : null; $cook[$k]->workshopid = $this->workshop->id; $cook[$k]->sort = $k + 1; diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index 6643c676a1..7e98cea2a7 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -121,7 +121,7 @@ function workshop_delete_instance($id) { * @todo Finish documenting this function */ function workshop_user_outline($course, $user, $mod, $workshop) { - $return = new stdClass; + $return = new object(); $return->time = 0; $return->info = ''; return $return; @@ -553,23 +553,23 @@ function workshop_get_example_modes() { function workshop_get_comparison_levels() { $levels = array(); - $levels[WORKSHOP_COMPARISON_VERYHIGH] = new stdClass; + $levels[WORKSHOP_COMPARISON_VERYHIGH] = new object(); $levels[WORKSHOP_COMPARISON_VERYHIGH]->name = get_string('comparisonveryhigh', 'workshop'); $levels[WORKSHOP_COMPARISON_VERYHIGH]->value = 5.00; - $levels[WORKSHOP_COMPARISON_HIGH] = new stdClass; + $levels[WORKSHOP_COMPARISON_HIGH] = new object(); $levels[WORKSHOP_COMPARISON_HIGH]->name = get_string('comparisonhigh', 'workshop'); $levels[WORKSHOP_COMPARISON_HIGH]->value = 3.00; - $levels[WORKSHOP_COMPARISON_NORMAL] = new stdClass; + $levels[WORKSHOP_COMPARISON_NORMAL] = new object(); $levels[WORKSHOP_COMPARISON_NORMAL]->name = get_string('comparisonnormal', 'workshop'); $levels[WORKSHOP_COMPARISON_NORMAL]->value = 2.50; - $levels[WORKSHOP_COMPARISON_LOW] = new stdClass; + $levels[WORKSHOP_COMPARISON_LOW] = new object(); $levels[WORKSHOP_COMPARISON_LOW]->name = get_string('comparisonlow', 'workshop'); $levels[WORKSHOP_COMPARISON_LOW]->value = 1.67; - $levels[WORKSHOP_COMPARISON_VERYLOW] = new stdClass; + $levels[WORKSHOP_COMPARISON_VERYLOW] = new object(); $levels[WORKSHOP_COMPARISON_VERYLOW]->name = get_string('comparisonverylow', 'workshop'); $levels[WORKSHOP_COMPARISON_VERYLOW]->value = 1.00; diff --git a/mod/workshop/locallib.php b/mod/workshop/locallib.php index f9275a53cf..b3eefd36dd 100644 --- a/mod/workshop/locallib.php +++ b/mod/workshop/locallib.php @@ -62,7 +62,7 @@ class workshop { * @param object $cm Course module record as returned by {@link get_coursemodule_from_id()} * @param object $course Course record from {course} table */ - public function __construct(stdClass $instance, stdClass $cm, stdClass $course) { + public function __construct(object $instance, object $cm, object $course) { foreach ($instance as $key => $val) { if (is_object($val) || (is_array($val))) { // this should not happen if the $instance is really just the record returned by $DB @@ -81,7 +81,7 @@ class workshop { * The returned objects contain id, lastname and firstname properties and are ordered by lastname,firstname * * @param bool $musthavesubmission If true, return only users who have already submitted. All possible authors otherwise. - * @return array array[userid] => stdClass{->id ->lastname ->firstname} + * @return array array[userid] => object{->id ->lastname ->firstname} */ public function get_peer_authors($musthavesubmission=true) { global $DB; @@ -114,7 +114,7 @@ class workshop { * * @param bool $musthavesubmission If true, return only users who have already submitted. All possible users otherwise. * @see get_super_reviewers() - * @return array array[userid] => stdClass{->id ->lastname ->firstname} + * @return array array[userid] => object{->id ->lastname ->firstname} */ public function get_peer_reviewers($musthavesubmission=false) { global $DB; @@ -147,7 +147,7 @@ class workshop { * * @param bool $musthavesubmission If true, return only users who have already submitted. All possible users otherwise. * @see get_peer_reviewers() - * @return array array[userid] => stdClass{->id ->lastname ->firstname} + * @return array array[userid] => object{->id ->lastname ->firstname} */ public function get_super_reviewers() { global $DB; @@ -166,8 +166,8 @@ class workshop { * is set, returns only groups withing the course module grouping. Always returns group [0] with * all the given users. * - * @param array $users array[userid] => stdClass{->id ->lastname ->firstname} - * @return array array[groupid][userid] => stdClass{->id ->lastname ->firstname} + * @param array $users array[userid] => object{->id ->lastname ->firstname} + * @return array array[groupid][userid] => object{->id ->lastname ->firstname} */ public function get_grouped($users) { global $DB; @@ -260,7 +260,7 @@ class workshop { if (is_array($id)) { $submissions = array(); foreach ($rs as $submission) { - $submissions[$submission->id] = new stdClass(); + $submissions[$submission->id] = new object(); foreach ($submission as $property => $value) { // we do not want text fields here to prevent possible memory issues if (in_array($property, array('id', 'workshopid', 'example', 'userid', 'authorlastname', 'authorfirstname', @@ -344,7 +344,7 @@ class workshop { foreach ($rs as $assessment) { // copy selected properties into the array to be returned. This is here mainly in order not // to include text comments. - $assessments[$assessment->id] = new stdClass; + $assessments[$assessment->id] = new object(); foreach ($assessment as $property => $value) { if (in_array($property, array('id', 'submissionid', 'userid', 'timecreated', 'timemodified', 'timeagreed', 'grade', 'gradinggrade', 'gradinggradeover', 'gradinggradeoverby', @@ -448,7 +448,7 @@ class workshop { * @param bool $bulk repeated inserts into DB expected * @return int ID of the new assessment or an error code */ - public function add_allocation(stdClass $submission, $reviewerid, $bulk=false) { + public function add_allocation(object $submission, $reviewerid, $bulk=false) { global $DB; if ($DB->record_exists('workshop_assessments', array('submissionid' => $submission->id, 'userid' => $reviewerid))) { @@ -456,7 +456,7 @@ class workshop { } $now = time(); - $assessment = new stdClass(); + $assessment = new object(); $assessment->submissionid = $submission->id; $assessment->userid = $reviewerid; $assessment->timecreated = $now; diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index 6ee7ac3ea6..64bdc3196b 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -59,7 +59,7 @@ class moodle_mod_workshop_renderer extends moodle_renderer_base { * @param string $message to display * @return string html */ - public function status_message(stdClass $message) { + public function status_message(object $message) { if (empty($message->text)) { return ''; } @@ -86,7 +86,7 @@ class moodle_mod_workshop_renderer extends moodle_renderer_base { * @return string html to be echoed */ public function allocation_init_result($result='') { - $msg = new stdClass(); + $msg = new object(); if ($result === 'WORKSHOP_ALLOCATION_RANDOM_ERROR') { $msg = (object)array('text' => get_string('randomallocationerror', 'workshop'), 'sty' => 'error'); } else { @@ -116,12 +116,12 @@ class moodle_mod_workshop_renderer extends moodle_renderer_base { * * By default, this looks similar to a forum post. * - * @param stdClass $submission The submission record + * @param object $submission The submission record * @param bool $showauthorname Should the author name be displayed - * @param stdClass $author If author's name should be displayed, this object contains the author data + * @param object $author If author's name should be displayed, this object contains the author data * @return string html to be echoed */ - public function submission_full(stdClass $submission, $showauthorname=false, stdClass $author=null) { + public function submission_full(object $submission, $showauthorname=false, object $author=null) { global $CFG; $o = ''; // output code @@ -142,7 +142,7 @@ class moodle_mod_workshop_renderer extends moodle_renderer_base { $userpic = $this->output->user_picture($userpic); $userurl = new moodle_url($CFG->wwwroot . '/user/view.php', array('id' => $author->id, 'course' => $this->page->course->id)); - $a = new stdClass(); + $a = new object(); $a->name = fullname($author); $a->url = $userurl->out(); $byfullname = get_string('byfullname', 'workshop', $a); @@ -176,11 +176,11 @@ class moodle_mod_workshop_renderer extends moodle_renderer_base { * If format==html, then format a html string. If format==text, then format a text-only string. * Otherwise, returns html for non-images and html to display the image inline. * - * @param stdClass $submission Submission record + * @param object $submission Submission record * @param string format The format of the returned string * @return string HTML code to be echoed */ - public function submission_attachments(stdClass $submission, $format=null) { + public function submission_attachments(object $submission, $format=null) { global $CFG; require_once($CFG->libdir.'/filelib.php'); -- 2.39.5