From 0eada7a5f91208b45cdeb4ad549a63773d64096f Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Mon, 15 Feb 2021 15:17:38 +0100 Subject: [PATCH] MDL-70893 various: optional function arguments must be in the end --- calendar/lib.php | 2 +- calendar/renderer.php | 2 +- course/lib.php | 2 +- grade/edit/tree/lib.php | 2 +- lib/deprecatedlib.php | 2 +- lib/phpunit/classes/util.php | 2 +- lib/rsslib.php | 2 +- message/externallib.php | 2 +- mnet/peer.php | 2 +- mod/assign/externallib.php | 2 +- mod/assign/feedback/editpdf/classes/pdf.php | 2 +- mod/data/tests/search_test.php | 2 +- mod/forum/externallib.php | 2 +- mod/forum/lib.php | 2 +- mod/glossary/lib.php | 2 +- mod/scorm/datamodels/scormlib.php | 2 +- privacy/classes/tests/request/content_writer.php | 2 +- question/classes/bank/search/category_condition.php | 2 +- report/insights/classes/output/insight.php | 2 +- repository/flickr_public/lib.php | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/calendar/lib.php b/calendar/lib.php index 3bf8caf9cae55..4990e9b15e63a 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -2833,7 +2833,7 @@ function calendar_add_subscription($sub) { * @throws dml_exception A DML specific exception is thrown for invalid subscriptionids. * @return int Code: CALENDAR_IMPORT_EVENT_UPDATED = updated, CALENDAR_IMPORT_EVENT_INSERTED = inserted, 0 = error */ -function calendar_add_icalendar_event($event, $unused = null, $subscriptionid, $timezone='UTC') { +function calendar_add_icalendar_event($event, $unused, $subscriptionid, $timezone='UTC') { global $DB; // Probably an unsupported X-MICROSOFT-CDO-BUSYSTATUS event. diff --git a/calendar/renderer.php b/calendar/renderer.php index dcb3afcebbcc8..a590cdfaf7b1b 100644 --- a/calendar/renderer.php +++ b/calendar/renderer.php @@ -316,7 +316,7 @@ public function course_filter_selector(moodle_url $returnurl, $label = null, $co * @param string $importresults * @return string */ - public function subscription_details($unused = null, $subscriptions, $importresults = '') { + public function subscription_details($unused, $subscriptions, $importresults = '') { $table = new html_table(); $table->head = array( get_string('colcalendar', 'calendar'), diff --git a/course/lib.php b/course/lib.php index 220fbdf2d9f61..4b89cddd0c8e6 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3066,7 +3066,7 @@ public function delete() { * @param string $message * @param int|null $courseid */ - protected function notify($touser, $fromuser, $name='courserequested', $subject, $message, $courseid = null) { + protected function notify($touser, $fromuser, $name, $subject, $message, $courseid = null) { $eventdata = new \core\message\message(); $eventdata->courseid = empty($courseid) ? SITEID : $courseid; $eventdata->component = 'moodle'; diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php index f34b69a17102d..0291183b1b078 100644 --- a/grade/edit/tree/lib.php +++ b/grade/edit/tree/lib.php @@ -57,7 +57,7 @@ class grade_edit_tree { /** * Constructor */ - public function __construct($gtree, $moving=false, $gpr) { + public function __construct($gtree, $moving, $gpr) { global $USER, $OUTPUT, $COURSE; $systemdefault = get_config('moodle', 'grade_report_showcalculations'); diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index b02ddc0acf689..c9e76180d9b5e 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -3281,7 +3281,7 @@ function user_get_total_participants($courseid, $groupid = 0, $accesssince = 0, * @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set). * @return moodle_recordset */ -function user_get_participants($courseid, $groupid = 0, $accesssince, $roleid, $enrolid = 0, $statusid, $search, +function user_get_participants($courseid, $groupid, $accesssince, $roleid, $enrolid, $statusid, $search, $additionalwhere = '', $additionalparams = array(), $sort = '', $limitfrom = 0, $limitnum = 0) { global $DB; diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index 94ec4414dbe9b..c87cfe309ca0d 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -916,7 +916,7 @@ public static function run_all_adhoc_tasks() { * or the name of the static class when calling a static method. * @return mixed the respective return value of the method. */ - public static function call_internal_method($object, $methodname, array $params = array(), $classname) { + public static function call_internal_method($object, $methodname, array $params, $classname) { $reflection = new \ReflectionClass($classname); $method = $reflection->getMethod($methodname); $method->setAccessible(true); diff --git a/lib/rsslib.php b/lib/rsslib.php index b74d3c10c1332..7141fd719963d 100644 --- a/lib/rsslib.php +++ b/lib/rsslib.php @@ -488,7 +488,7 @@ function rss_end_tag($tag,$level=0,$endline=true) { * @param array $attributes the attributes of the xml tag * @return string the whole xml element */ -function rss_full_tag($tag,$level=0,$endline=true,$content,$attributes=null) { +function rss_full_tag($tag, $level, $endline, $content, $attributes = null) { $st = rss_start_tag($tag,$level,$endline,$attributes); $co=""; $co = preg_replace("/\r\n|\r/", "\n", htmlspecialchars($content)); diff --git a/message/externallib.php b/message/externallib.php index 90bf611ae6083..dc8b4fe3a5324 100644 --- a/message/externallib.php +++ b/message/externallib.php @@ -2920,7 +2920,7 @@ public static function get_message_processor_parameters() { * @throws moodle_exception * @since 3.2 */ - public static function get_message_processor($userid = 0, $name) { + public static function get_message_processor($userid, $name) { global $USER, $PAGE, $CFG; // Check if messaging is enabled. diff --git a/mnet/peer.php b/mnet/peer.php index 27761707932c9..1edb9c9f169fd 100644 --- a/mnet/peer.php +++ b/mnet/peer.php @@ -49,7 +49,7 @@ class mnet_peer { * @param int $application - table id - what kind of peer are we talking to * @return bool - indication of success or failure */ - function bootstrap($wwwroot, $pubkey = null, $application) { + function bootstrap($wwwroot, $pubkey, $application) { global $DB; if (substr($wwwroot, -1, 1) == '/') { diff --git a/mod/assign/externallib.php b/mod/assign/externallib.php index 49320c76680cc..51886299d59f9 100644 --- a/mod/assign/externallib.php +++ b/mod/assign/externallib.php @@ -2080,7 +2080,7 @@ public static function save_grades_parameters() { * @return null * @since Moodle 2.7 */ - public static function save_grades($assignmentid, $applytoall = false, $grades) { + public static function save_grades($assignmentid, $applytoall, $grades) { global $CFG, $USER; $params = self::validate_parameters(self::save_grades_parameters(), diff --git a/mod/assign/feedback/editpdf/classes/pdf.php b/mod/assign/feedback/editpdf/classes/pdf.php index c3b6921088cc5..dd37657a0c178 100644 --- a/mod/assign/feedback/editpdf/classes/pdf.php +++ b/mod/assign/feedback/editpdf/classes/pdf.php @@ -395,7 +395,7 @@ public function add_comment($text, $x, $y, $width, $colour = 'yellow') { * @param string $imagefolder - Folder containing stamp images. * @return bool true if successful (always) */ - public function add_annotation($sx, $sy, $ex, $ey, $colour = 'yellow', $type = 'line', $path, $imagefolder) { + public function add_annotation($sx, $sy, $ex, $ey, $colour, $type, $path, $imagefolder) { global $CFG; if (!$this->filename) { return false; diff --git a/mod/data/tests/search_test.php b/mod/data/tests/search_test.php index e88e58214a2fb..94bd40d92dd3a 100644 --- a/mod/data/tests/search_test.php +++ b/mod/data/tests/search_test.php @@ -1016,7 +1016,7 @@ public function test_attach_files() { * @param mod_data $data * @return void */ - protected function create_default_data_fields($fieldtypes = array(), $data) { + protected function create_default_data_fields($fieldtypes, $data) { $count = 1; // Creating test Fields with default parameter values. diff --git a/mod/forum/externallib.php b/mod/forum/externallib.php index 1a6e1a319e252..a714b75e5e324 100644 --- a/mod/forum/externallib.php +++ b/mod/forum/externallib.php @@ -2179,7 +2179,7 @@ public static function delete_post_returns() { * @param string $sortdirection * @return array */ - public static function get_discussion_posts_by_userid(int $userid = 0, int $cmid, ?string $sortby, ?string $sortdirection) { + public static function get_discussion_posts_by_userid(int $userid, int $cmid, ?string $sortby, ?string $sortdirection) { global $USER, $DB; // Validate the parameter. $params = self::validate_parameters(self::get_discussion_posts_by_userid_parameters(), [ diff --git a/mod/forum/lib.php b/mod/forum/lib.php index e9089555fd1a9..73f10ff41d4c2 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1159,7 +1159,7 @@ function forum_get_readable_forums($userid, $courseid=0) { * @param string $extrasql * @return array|bool Array of posts found or false */ -function forum_search_posts($searchterms, $courseid=0, $limitfrom=0, $limitnum=50, +function forum_search_posts($searchterms, $courseid, $limitfrom, $limitnum, &$totalcount, $extrasql='') { global $CFG, $DB, $USER; require_once($CFG->libdir.'/searchlib.php'); diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 58f5c36551957..7e0ee0e0c1456 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -2467,7 +2467,7 @@ function glossary_end_tag($tag,$level=0,$endline=true) { * @param string $content * @return string */ -function glossary_full_tag($tag,$level=0,$endline=true,$content) { +function glossary_full_tag($tag, $level, $endline, $content) { global $CFG; $st = glossary_start_tag($tag,$level,$endline); diff --git a/mod/scorm/datamodels/scormlib.php b/mod/scorm/datamodels/scormlib.php index 17c44f1823d23..a9eee65099c50 100644 --- a/mod/scorm/datamodels/scormlib.php +++ b/mod/scorm/datamodels/scormlib.php @@ -812,7 +812,7 @@ function scorm_get_available_children($sco) { } } -function scorm_get_available_descendent($descend = array(), $sco) { +function scorm_get_available_descendent($descend, $sco) { if ($sco == null) { return $descend; } else { diff --git a/privacy/classes/tests/request/content_writer.php b/privacy/classes/tests/request/content_writer.php index eda72c4b5a6d5..7b2b9b85847cb 100644 --- a/privacy/classes/tests/request/content_writer.php +++ b/privacy/classes/tests/request/content_writer.php @@ -277,7 +277,7 @@ public function get_all_metadata(array $subcontext = []) { * @param boolean $valueonly Whether to fetch only the value, rather than the value + description. * @return array The metadata as a series of keys to value + descrition objects. */ - public function get_metadata(array $subcontext = [], $key, $valueonly = true) { + public function get_metadata(array $subcontext, $key, $valueonly = true) { $keys = $this->get_all_metadata($subcontext); if (isset($keys[$key])) { diff --git a/question/classes/bank/search/category_condition.php b/question/classes/bank/search/category_condition.php index c2a4008885446..2ecae3bffed00 100644 --- a/question/classes/bank/search/category_condition.php +++ b/question/classes/bank/search/category_condition.php @@ -66,7 +66,7 @@ class category_condition extends condition { * @param \stdClass $course Course record * @param integer $maxinfolength The maximum displayed length of the category info. */ - public function __construct($cat = null, $recurse = false, $contexts, $baseurl, $course, $maxinfolength = null) { + public function __construct($cat, $recurse, $contexts, $baseurl, $course, $maxinfolength = null) { $this->cat = $cat; $this->recurse = $recurse; $this->contexts = $contexts; diff --git a/report/insights/classes/output/insight.php b/report/insights/classes/output/insight.php index 4d5d045cf8e10..900a81e60e00e 100644 --- a/report/insights/classes/output/insight.php +++ b/report/insights/classes/output/insight.php @@ -64,7 +64,7 @@ class insight implements \renderable, \templatable { * @param \context $context * @return void */ - public function __construct(\core_analytics\prediction $prediction, \core_analytics\model $model, $includedetailsaction = false, + public function __construct(\core_analytics\prediction $prediction, \core_analytics\model $model, $includedetailsaction, \context $context) { $this->prediction = $prediction; diff --git a/repository/flickr_public/lib.php b/repository/flickr_public/lib.php index ad12ee28d9e82..adb2c2681ce51 100644 --- a/repository/flickr_public/lib.php +++ b/repository/flickr_public/lib.php @@ -341,7 +341,7 @@ public function get_listing($path = '', $page = 1) { * @param int $page * @return array */ - private function build_list($photos, $page = 1, &$ret) { + private function build_list($photos, $page, &$ret) { global $OUTPUT; if (!empty($this->nsid)) {