diff --git a/admin/classes/privacy/provider.php b/admin/classes/privacy/provider.php index 118308d59cf..a2a277db097 100644 --- a/admin/classes/privacy/provider.php +++ b/admin/classes/privacy/provider.php @@ -35,7 +35,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'; } } diff --git a/admin/presets/classes/privacy/provider.php b/admin/presets/classes/privacy/provider.php index 81b955d972f..11a719f649e 100644 --- a/admin/presets/classes/privacy/provider.php +++ b/admin/presets/classes/privacy/provider.php @@ -41,7 +41,7 @@ class provider implements * @param collection $collection A list of information about this component * @return collection The collection object filled out with information about this component. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { // These tables are really data about site configuration and not user data. // The adminpresets includes information about which user performed a configuration change using the admin_presets @@ -74,7 +74,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/admin/renderer.php b/admin/renderer.php index 7e7ef8d30bc..184a7ba759a 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -617,7 +617,7 @@ class core_admin_renderer extends plugin_renderer_base { * @param bool $croninfrequent * @return string HTML to output. */ - public function cron_infrequent_warning(bool $croninfrequent) : string { + public function cron_infrequent_warning(bool $croninfrequent): string { global $CFG; if (!$croninfrequent) { diff --git a/admin/roles/classes/privacy/provider.php b/admin/roles/classes/privacy/provider.php index d711db66254..5cc750cbbb9 100644 --- a/admin/roles/classes/privacy/provider.php +++ b/admin/roles/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @param collection $collection An object for storing metadata. * @return collection The metadata. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $rolecapabilities = [ 'roleid' => 'privacy:metadata:role_capabilities:roleid', 'capability' => 'privacy:metadata:role_capabilities:capability', @@ -100,7 +100,7 @@ class provider implements * @param int $userid The user ID. * @return contextlist The list of context IDs. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { global $DB; $contextlist = new contextlist(); diff --git a/admin/tool/admin_presets/classes/privacy/provider.php b/admin/tool/admin_presets/classes/privacy/provider.php index d276964067c..370b2c22ae5 100644 --- a/admin/tool/admin_presets/classes/privacy/provider.php +++ b/admin/tool/admin_presets/classes/privacy/provider.php @@ -31,7 +31,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'; } } diff --git a/admin/tool/analytics/classes/output/form/import_model.php b/admin/tool/analytics/classes/output/form/import_model.php index 71302464e8b..c067ccb761b 100644 --- a/admin/tool/analytics/classes/output/form/import_model.php +++ b/admin/tool/analytics/classes/output/form/import_model.php @@ -42,7 +42,7 @@ class import_model extends \moodleform { * * @return null */ - public function definition () { + public function definition() { $mform = $this->_form; $mform->addElement('header', 'settingsheader', get_string('importmodel', 'tool_analytics')); diff --git a/admin/tool/analytics/classes/privacy/provider.php b/admin/tool/analytics/classes/privacy/provider.php index 904b627938c..d4047725cb6 100644 --- a/admin/tool/analytics/classes/privacy/provider.php +++ b/admin/tool/analytics/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/availabilityconditions/classes/privacy/provider.php b/admin/tool/availabilityconditions/classes/privacy/provider.php index e0094cd8173..72da566d683 100644 --- a/admin/tool/availabilityconditions/classes/privacy/provider.php +++ b/admin/tool/availabilityconditions/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/behat/classes/privacy/provider.php b/admin/tool/behat/classes/privacy/provider.php index 608773acb7f..8f14d06c13d 100644 --- a/admin/tool/behat/classes/privacy/provider.php +++ b/admin/tool/behat/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/brickfield/classes/output/renderer.php b/admin/tool/brickfield/classes/output/renderer.php index b6b483d2d59..979ae92c8b2 100644 --- a/admin/tool/brickfield/classes/output/renderer.php +++ b/admin/tool/brickfield/classes/output/renderer.php @@ -157,7 +157,7 @@ class renderer extends plugin_renderer_base { * @throws \coding_exception * @throws \moodle_exception */ - public function analysisbutton(int $courseid) : string { + public function analysisbutton(int $courseid): string { $link = new moodle_url(accessibility::get_plugin_url(), [ 'action' => 'requestanalysis', 'courseid' => $courseid diff --git a/admin/tool/brickfield/classes/privacy/provider.php b/admin/tool/brickfield/classes/privacy/provider.php index 1a4f65dbae8..9a7e5e996ed 100644 --- a/admin/tool/brickfield/classes/privacy/provider.php +++ b/admin/tool/brickfield/classes/privacy/provider.php @@ -30,7 +30,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'; } } diff --git a/admin/tool/capability/classes/privacy/provider.php b/admin/tool/capability/classes/privacy/provider.php index a5557fac554..ed3c0681c16 100644 --- a/admin/tool/capability/classes/privacy/provider.php +++ b/admin/tool/capability/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/cohortroles/classes/privacy/provider.php b/admin/tool/cohortroles/classes/privacy/provider.php index 3cd324ef7a9..9896a620610 100644 --- a/admin/tool/cohortroles/classes/privacy/provider.php +++ b/admin/tool/cohortroles/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @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 { // The tool_cohortroles plugin utilises the mdl_tool_cohortroles table. $collection->add_database_table( 'tool_cohortroles', @@ -77,7 +77,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // When we process user deletions and expiries, we always delete from the user context. diff --git a/admin/tool/componentlibrary/classes/privacy/provider.php b/admin/tool/componentlibrary/classes/privacy/provider.php index b31a0744648..d1300d3947d 100644 --- a/admin/tool/componentlibrary/classes/privacy/provider.php +++ b/admin/tool/componentlibrary/classes/privacy/provider.php @@ -30,7 +30,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'; } } diff --git a/admin/tool/customlang/classes/privacy/provider.php b/admin/tool/customlang/classes/privacy/provider.php index c847481b368..de682397c00 100644 --- a/admin/tool/customlang/classes/privacy/provider.php +++ b/admin/tool/customlang/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/customlang/tests/local/mlang/langstring_test.php b/admin/tool/customlang/tests/local/mlang/langstring_test.php index f57fd1f6b6d..f3fca1072ce 100644 --- a/admin/tool/customlang/tests/local/mlang/langstring_test.php +++ b/admin/tool/customlang/tests/local/mlang/langstring_test.php @@ -60,7 +60,7 @@ class langstring_test extends advanced_testcase { * * @return array */ - public function fix_syntax_data() : array { + public function fix_syntax_data(): array { return [ // Syntax sanity v1 strings. [ diff --git a/admin/tool/customlang/tests/local/mlang/phpparser_test.php b/admin/tool/customlang/tests/local/mlang/phpparser_test.php index 81850b611fe..aca53c1b3af 100644 --- a/admin/tool/customlang/tests/local/mlang/phpparser_test.php +++ b/admin/tool/customlang/tests/local/mlang/phpparser_test.php @@ -79,7 +79,7 @@ class phpparser_test extends advanced_testcase { * * @return array */ - public function parse_provider() : array { + public function parse_provider(): array { return [ 'Invalid PHP code' => [ 'No PHP code', [], false diff --git a/admin/tool/dataprivacy/classes/api.php b/admin/tool/dataprivacy/classes/api.php index f92fc15add6..bfa1b96ddc7 100644 --- a/admin/tool/dataprivacy/classes/api.php +++ b/admin/tool/dataprivacy/classes/api.php @@ -168,7 +168,7 @@ class api { * * @return array An array of the DPO role shortnames */ - public static function get_dpo_role_names() : array { + public static function get_dpo_role_names(): array { global $DB; $dporoleids = self::get_assigned_privacy_officer_roles(); @@ -524,7 +524,7 @@ class api { * @param array $userids * @return array */ - public static function find_ongoing_request_types_for_users(array $userids) : array { + public static function find_ongoing_request_types_for_users(array $userids): array { global $DB; if (empty($userids)) { @@ -1201,7 +1201,7 @@ class api { * @return contextlist_collection The collection of approved_contextlist objects. */ public static function get_approved_contextlist_collection_for_collection(contextlist_collection $collection, - \stdClass $foruser, int $type) : contextlist_collection { + \stdClass $foruser, int $type): contextlist_collection { // Create the approved contextlist collection object. $approvedcollection = new contextlist_collection($collection->get_userid()); @@ -1326,7 +1326,7 @@ class api { * @param \DateInterval $interval * @return string */ - public static function format_retention_period(\DateInterval $interval) : string { + public static function format_retention_period(\DateInterval $interval): string { // It is one or another. if ($interval->y) { $formattedtime = get_string('numyears', 'moodle', $interval->format('%y')); diff --git a/admin/tool/dataprivacy/classes/data_request.php b/admin/tool/dataprivacy/classes/data_request.php index 9685e61abd7..816ef5c53e1 100644 --- a/admin/tool/dataprivacy/classes/data_request.php +++ b/admin/tool/dataprivacy/classes/data_request.php @@ -241,7 +241,7 @@ class data_request extends persistent { * * @return bool */ - public function is_resettable() : bool { + public function is_resettable(): bool { if (api::DATAREQUEST_TYPE_OTHERS == $this->get('type')) { // It is not possible to reset 'other' reqeusts. return false; @@ -260,7 +260,7 @@ class data_request extends persistent { * * @return bool */ - public function is_active() : bool { + public function is_active(): bool { $active = [ api::DATAREQUEST_STATUS_APPROVED => true, ]; @@ -275,7 +275,7 @@ class data_request extends persistent { * * @return self */ - public function resubmit_request() : data_request { + public function resubmit_request(): data_request { if ($this->is_active()) { $this->set('status', api::DATAREQUEST_STATUS_REJECTED)->save(); } diff --git a/admin/tool/dataprivacy/classes/expired_context.php b/admin/tool/dataprivacy/classes/expired_context.php index 26143b53fd3..36b8caf2228 100644 --- a/admin/tool/dataprivacy/classes/expired_context.php +++ b/admin/tool/dataprivacy/classes/expired_context.php @@ -182,7 +182,7 @@ class expired_context extends \core\persistent { * @param int[] $roleids * @return expired_context */ - protected function set_roleids_for(string $field, array $roleids) : expired_context { + protected function set_roleids_for(string $field, array $roleids): expired_context { $roledata = json_encode($roleids); $this->raw_set($field, $roledata); @@ -211,7 +211,7 @@ class expired_context extends \core\persistent { * @param int[] $roleids * @return expired_context */ - protected function set_unexpiredroles(array $roleids) : expired_context { + protected function set_unexpiredroles(array $roleids): expired_context { $this->set_roleids_for('unexpiredroles', $roleids); return $this; @@ -223,7 +223,7 @@ class expired_context extends \core\persistent { * @param int[] $roleids * @return expired_context */ - public function add_expiredroles(array $roleids) : expired_context { + public function add_expiredroles(array $roleids): expired_context { $existing = $this->get('expiredroles'); $newvalue = array_merge($existing, $roleids); @@ -238,7 +238,7 @@ class expired_context extends \core\persistent { * @param int[] $roleids * @return unexpired_context */ - public function add_unexpiredroles(array $roleids) : expired_context { + public function add_unexpiredroles(array $roleids): expired_context { $existing = $this->get('unexpiredroles'); $newvalue = array_merge($existing, $roleids); @@ -253,7 +253,7 @@ class expired_context extends \core\persistent { * @param int[] $roleids * @return expired_context */ - protected function set_expiredroles(array $roleids) : expired_context { + protected function set_expiredroles(array $roleids): expired_context { $this->set_roleids_for('expiredroles', $roleids); return $this; @@ -285,7 +285,7 @@ class expired_context extends \core\persistent { * @param boolean $save * @return expired_context */ - public static function create_from_expiry_info(\context $context, expiry_info $info, bool $save = true) : expired_context { + public static function create_from_expiry_info(\context $context, expiry_info $info, bool $save = true): expired_context { $record = (object) [ 'contextid' => $context->id, 'status' => self::STATUS_EXPIRED, @@ -309,7 +309,7 @@ class expired_context extends \core\persistent { * @param expiry_info $info * @return $this */ - public function update_from_expiry_info(expiry_info $info) : expired_context { + public function update_from_expiry_info(expiry_info $info): expired_context { $save = false; // Compare the expiredroles. @@ -353,7 +353,7 @@ class expired_context extends \core\persistent { * * @return bool */ - public function can_process_deletion() : bool { + public function can_process_deletion(): bool { return ($this->get('status') == self::STATUS_APPROVED); } @@ -362,7 +362,7 @@ class expired_context extends \core\persistent { * * @return bool */ - public function is_complete() : bool { + public function is_complete(): bool { return ($this->get('status') == self::STATUS_CLEANED); } @@ -372,7 +372,7 @@ class expired_context extends \core\persistent { * * @return bool */ - public function is_fully_expired() : bool { + public function is_fully_expired(): bool { return $this->get('defaultexpired') && empty($this->get('unexpiredroles')); } } diff --git a/admin/tool/dataprivacy/classes/expired_contexts_manager.php b/admin/tool/dataprivacy/classes/expired_contexts_manager.php index 7672da340a6..26d8931b104 100644 --- a/admin/tool/dataprivacy/classes/expired_contexts_manager.php +++ b/admin/tool/dataprivacy/classes/expired_contexts_manager.php @@ -68,7 +68,7 @@ class expired_contexts_manager { * * @return int[] The number of contexts flagged as expired for courses, and users. */ - public function flag_expired_contexts() : array { + public function flag_expired_contexts(): array { $this->trace->output('Checking requirements'); if (!$this->check_requirements()) { $this->trace->output('Requirements not met. Cannot process expired retentions.', 1); @@ -151,7 +151,7 @@ class expired_contexts_manager { * @param string $contextpath A contexpath to restrict results to * @return \stdClass[] */ - protected static function get_nested_expiry_info($contextpath = '') : array { + protected static function get_nested_expiry_info($contextpath = ''): array { $coursepaths = self::get_nested_expiry_info_for_courses($contextpath); $userpaths = self::get_nested_expiry_info_for_user($contextpath); @@ -164,7 +164,7 @@ class expired_contexts_manager { * @param string $contextpath A contexpath to restrict results to * @return \stdClass[] */ - protected static function get_nested_expiry_info_for_courses($contextpath = '') : array { + protected static function get_nested_expiry_info_for_courses($contextpath = ''): array { global $DB; $contextfields = \context_helper::get_preload_record_columns_sql('ctx'); @@ -217,7 +217,7 @@ class expired_contexts_manager { * @param string $contextpath A contexpath to restrict results to * @return \stdClass[] */ - protected static function get_nested_expiry_info_for_user($contextpath = '') : array { + protected static function get_nested_expiry_info_for_user($contextpath = ''): array { global $DB; $contextfields = \context_helper::get_preload_record_columns_sql('ctx'); @@ -262,7 +262,7 @@ class expired_contexts_manager { * @param array $params The params required by the SQL. * @return \stdClass[] */ - protected static function get_nested_expiry_info_from_sql(string $sql, array $params) : array { + protected static function get_nested_expiry_info_from_sql(string $sql, array $params): array { global $DB; $fulllist = $DB->get_recordset_sql($sql, $params); @@ -334,7 +334,7 @@ class expired_contexts_manager { * @param \context $context * @return bool */ - protected static function is_eligible_for_deletion(array &$pathstoskip, \context $context) : bool { + protected static function is_eligible_for_deletion(array &$pathstoskip, \context $context): bool { $shouldskip = false; // Check whether any of the child contexts are ineligble. $shouldskip = !empty(array_filter($pathstoskip, function($path) use ($context) { @@ -361,7 +361,7 @@ class expired_contexts_manager { * * @return int[] The number of deleted contexts. */ - public function process_approved_deletions() : array { + public function process_approved_deletions(): array { $this->trace->output('Checking requirements'); if (!$this->check_requirements()) { $this->trace->output('Requirements not met. Cannot process expired retentions.', 1); @@ -538,7 +538,7 @@ class expired_contexts_manager { * * @return bool */ - protected static function require_all_end_dates_for_user_deletion() : bool { + protected static function require_all_end_dates_for_user_deletion(): bool { $requireenddate = get_config('tool_dataprivacy', 'requireallenddatesforuserdeletion'); return !empty($requireenddate); @@ -563,7 +563,7 @@ class expired_contexts_manager { * @param int $comparisondate The date for comparison * @return bool */ - protected static function has_expired(string $period, int $comparisondate) : bool { + protected static function has_expired(string $period, int $comparisondate): bool { $dt = new \DateTime(); $dt->setTimestamp($comparisondate); $dt->add(new \DateInterval($period)); @@ -578,7 +578,7 @@ class expired_contexts_manager { * @param int $comparisondate The date for comparison * @return expiry_info */ - protected static function get_expiry_info(purpose $purpose, int $comparisondate = 0) : expiry_info { + protected static function get_expiry_info(purpose $purpose, int $comparisondate = 0): expiry_info { $overrides = $purpose->get_purpose_overrides(); $expiredroles = $unexpiredroles = []; if (empty($overrides)) { @@ -730,7 +730,7 @@ class expired_contexts_manager { * @param \context $context * @return \stdClass */ - protected function get_role_users_for_expired_context(expired_context $expiredctx, \context $context) : \stdClass { + protected function get_role_users_for_expired_context(expired_context $expiredctx, \context $context): \stdClass { $expiredroles = $expiredctx->get('expiredroles'); $expiredroleusers = []; if (!empty($expiredroles)) { @@ -782,7 +782,7 @@ class expired_contexts_manager { * @param \context $context * @return bool */ - public static function is_context_expired(\context $context) : bool { + public static function is_context_expired(\context $context): bool { $parents = $context->get_parent_contexts(true); foreach ($parents as $parent) { if ($parent instanceof \context_course) { @@ -805,7 +805,7 @@ class expired_contexts_manager { * @param \stdClass $course * @return bool */ - protected static function is_course_expired(\stdClass $course) : bool { + protected static function is_course_expired(\stdClass $course): bool { $context = \context_course::instance($course->id); return self::is_course_context_expired($context); @@ -818,7 +818,7 @@ class expired_contexts_manager { * @param \context $context * @return bool */ - protected static function is_course_context_expired(\context $context) : bool { + protected static function is_course_context_expired(\context $context): bool { $expiryrecords = self::get_nested_expiry_info_for_courses($context->path); return !empty($expiryrecords[$context->path]) && $expiryrecords[$context->path]->info->is_fully_expired(); @@ -839,7 +839,7 @@ class expired_contexts_manager { * @param \context_user $context * @return bool */ - protected static function are_user_context_dependencies_expired(\context_user $context) : bool { + protected static function are_user_context_dependencies_expired(\context_user $context): bool { // The context instanceid is the user's ID. if (isguestuser($context->instanceid) || is_siteadmin($context->instanceid)) { // This is an admin, or the guest and cannot expire. @@ -889,7 +889,7 @@ class expired_contexts_manager { * @param \stdClass $user * @return bool */ - public static function is_context_expired_or_unprotected_for_user(\context $context, \stdClass $user) : bool { + public static function is_context_expired_or_unprotected_for_user(\context $context, \stdClass $user): bool { // User/course contexts can't expire if no purpose is set in the system context. if (!data_registry::defaults_set()) { return false; @@ -972,7 +972,7 @@ class expired_contexts_manager { * * @return manager */ - protected function get_privacy_manager() : manager { + protected function get_privacy_manager(): manager { if (null === $this->manager) { $this->manager = new manager(); $this->manager->set_observer(new \tool_dataprivacy\manager_observer()); @@ -986,7 +986,7 @@ class expired_contexts_manager { * * @return int */ - protected function get_delete_limit() : int { + protected function get_delete_limit(): int { return self::DELETE_LIMIT; } @@ -995,7 +995,7 @@ class expired_contexts_manager { * * @return \progress_trace */ - protected function get_progress() : \progress_trace { + protected function get_progress(): \progress_trace { if (null === $this->progresstracer) { $this->set_progress(new \text_progress_trace()); } @@ -1009,7 +1009,7 @@ class expired_contexts_manager { * @param \progress_trace $trace * @return $this */ - public function set_progress(\progress_trace $trace) : expired_contexts_manager { + public function set_progress(\progress_trace $trace): expired_contexts_manager { $this->progresstracer = $trace; return $this; diff --git a/admin/tool/dataprivacy/classes/expiry_info.php b/admin/tool/dataprivacy/classes/expiry_info.php index 5e409af451f..7b7c3e51d1e 100644 --- a/admin/tool/dataprivacy/classes/expiry_info.php +++ b/admin/tool/dataprivacy/classes/expiry_info.php @@ -76,7 +76,7 @@ class expiry_info { * * @return bool */ - public function is_fully_expired() : bool { + public function is_fully_expired(): bool { return $this->defaultexpiryreached && empty($this->unexpired); } @@ -85,7 +85,7 @@ class expiry_info { * * @return bool */ - public function is_any_expired() : bool { + public function is_any_expired(): bool { if ($this->is_fully_expired()) { return true; } @@ -107,7 +107,7 @@ class expiry_info { * * @return int[] */ - public function get_expired_roles() : array { + public function get_expired_roles(): array { if ($this->is_default_expired()) { return []; } @@ -121,7 +121,7 @@ class expiry_info { * @param int $roleid * @return bool */ - public function is_role_expired(int $roleid) : bool { + public function is_role_expired(int $roleid): bool { return false !== array_search($roleid, $this->expired); } @@ -130,7 +130,7 @@ class expiry_info { * * @return bool */ - public function is_default_expired() : bool { + public function is_default_expired(): bool { return $this->defaultexpiryreached; } @@ -139,7 +139,7 @@ class expiry_info { * * @return bool */ - public function is_default_protected() : bool { + public function is_default_protected(): bool { return $this->defaultprotected; } @@ -148,7 +148,7 @@ class expiry_info { * * @return int[] */ - public function get_unexpired_roles() : array { + public function get_unexpired_roles(): array { return $this->unexpired; } @@ -157,7 +157,7 @@ class expiry_info { * * @return int[] */ - public function get_unexpired_protected_roles() : array { + public function get_unexpired_protected_roles(): array { return array_keys(array_filter($this->protectedroles)); } @@ -165,7 +165,7 @@ class expiry_info { * Get a list of all overridden roles which are unprotected. * @return int[] */ - public function get_unprotected_overridden_roles() : array { + public function get_unprotected_overridden_roles(): array { $allroles = array_merge($this->expired, $this->unexpired); return array_diff($allroles, $this->protectedroles); @@ -181,7 +181,7 @@ class expiry_info { * @param expiry_info $child The child record to merge with. * @return $this */ - public function merge_with_child(expiry_info $child) : expiry_info { + public function merge_with_child(expiry_info $child): expiry_info { if ($child->is_fully_expired()) { return $this; } diff --git a/admin/tool/dataprivacy/classes/filtered_userlist.php b/admin/tool/dataprivacy/classes/filtered_userlist.php index 523790c7546..ab206943b05 100644 --- a/admin/tool/dataprivacy/classes/filtered_userlist.php +++ b/admin/tool/dataprivacy/classes/filtered_userlist.php @@ -42,7 +42,7 @@ class filtered_userlist extends \core_privacy\local\request\approved_userlist { * @param int[] $unexpireduserids The list of userids for those users who should not be expired. * @return $this */ - public function apply_expired_context_filters(array $expireduserids, array $unexpireduserids) : filtered_userlist { + public function apply_expired_context_filters(array $expireduserids, array $unexpireduserids): filtered_userlist { // The current userlist content. $userids = $this->get_userids(); diff --git a/admin/tool/dataprivacy/classes/form/purpose.php b/admin/tool/dataprivacy/classes/form/purpose.php index 1de9317c41f..09d7296340a 100644 --- a/admin/tool/dataprivacy/classes/form/purpose.php +++ b/admin/tool/dataprivacy/classes/form/purpose.php @@ -245,7 +245,7 @@ class purpose extends persistent { * @param string $prefix The prefix to apply to the field * @return \stdClass */ - protected function get_role_override_id(string $prefix = '') : \stdClass { + protected function get_role_override_id(string $prefix = ''): \stdClass { $fieldname = "{$prefix}id"; $fielddata = (object) [ @@ -264,7 +264,7 @@ class purpose extends persistent { * @param string $prefix The prefix to apply to the field * @return \stdClass */ - protected function get_role_field(string $prefix = '') : \stdClass { + protected function get_role_field(string $prefix = ''): \stdClass { $fieldname = "{$prefix}roleid"; $fielddata = (object) [ @@ -297,7 +297,7 @@ class purpose extends persistent { * @param string $prefix The prefix to apply to the field * @return \stdClass */ - protected function get_lawful_base_field(string $prefix = '') : \stdClass { + protected function get_lawful_base_field(string $prefix = ''): \stdClass { $fieldname = "{$prefix}lawfulbases"; $data = (object) [ @@ -334,7 +334,7 @@ class purpose extends persistent { * @param string $prefix The prefix to apply to the field * @return \stdClass */ - protected function get_sensitive_base_field(string $prefix = '') : \stdClass { + protected function get_sensitive_base_field(string $prefix = ''): \stdClass { $fieldname = "{$prefix}sensitivedatareasons"; $data = (object) [ @@ -373,7 +373,7 @@ class purpose extends persistent { * @param string $prefix The name of the main field, and prefix for the subfields. * @return \stdClass */ - protected function get_retention_period_fields(string $prefix = '') : \stdClass { + protected function get_retention_period_fields(string $prefix = ''): \stdClass { $prefix = "{$prefix}retentionperiod"; $data = (object) [ 'fields' => [], @@ -411,7 +411,7 @@ class purpose extends persistent { * @param string $prefix The prefix to apply to the field * @return \stdClass */ - protected function get_protected_field(string $prefix = '') : \stdClass { + protected function get_protected_field(string $prefix = ''): \stdClass { $fieldname = "{$prefix}protected"; return (object) [ @@ -470,7 +470,7 @@ class purpose extends persistent { * @param \stdClass $data * @return \stdClass */ - protected function convert_existing_data_to_values(\stdClass $data) : \stdClass { + protected function convert_existing_data_to_values(\stdClass $data): \stdClass { $data->lawfulbases = explode(',', $data->lawfulbases); if (!empty($data->sensitivedatareasons)) { $data->sensitivedatareasons = explode(',', $data->sensitivedatareasons); diff --git a/admin/tool/dataprivacy/classes/output/data_requests_table.php b/admin/tool/dataprivacy/classes/output/data_requests_table.php index 837f0ae396d..0ea44f4738d 100644 --- a/admin/tool/dataprivacy/classes/output/data_requests_table.php +++ b/admin/tool/dataprivacy/classes/output/data_requests_table.php @@ -429,7 +429,7 @@ class data_requests_table extends table_sql { * * @return int The number of data request records. */ - public function get_requests_per_page() : int { + public function get_requests_per_page(): int { return $this->perpage; } @@ -447,7 +447,7 @@ class data_requests_table extends table_sql { * * @return array The available options for the number of data request to be displayed per page. */ - public function get_requests_per_page_options() : array { + public function get_requests_per_page_options(): array { return $this->perpageoptions; } } diff --git a/admin/tool/dataprivacy/classes/output/expired_contexts_table.php b/admin/tool/dataprivacy/classes/output/expired_contexts_table.php index 9583d014d5c..c2fed41d1d9 100644 --- a/admin/tool/dataprivacy/classes/output/expired_contexts_table.php +++ b/admin/tool/dataprivacy/classes/output/expired_contexts_table.php @@ -370,7 +370,7 @@ class expired_contexts_table extends table_sql { * @param expired_context $expiredcontext * @return purpose */ - protected function get_purpose_for_expiry(expired_context $expiredcontext) : purpose { + protected function get_purpose_for_expiry(expired_context $expiredcontext): purpose { $context = context_helper::instance_by_id($expiredcontext->get('contextid')); if (empty($this->purposemap[$context->id])) { diff --git a/admin/tool/dataprivacy/classes/privacy/provider.php b/admin/tool/dataprivacy/classes/privacy/provider.php index 0668704bed5..1f717592501 100644 --- a/admin/tool/dataprivacy/classes/privacy/provider.php +++ b/admin/tool/dataprivacy/classes/privacy/provider.php @@ -66,7 +66,7 @@ class provider implements * @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( 'tool_dataprivacy_request', [ @@ -103,7 +103,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT id FROM {context} WHERE instanceid = :userid diff --git a/admin/tool/dataprivacy/classes/purpose.php b/admin/tool/dataprivacy/classes/purpose.php index 0b97f07f9ee..2e4ef7292af 100644 --- a/admin/tool/dataprivacy/classes/purpose.php +++ b/admin/tool/dataprivacy/classes/purpose.php @@ -185,7 +185,7 @@ class purpose extends \core\persistent { * * @return array */ - public function get_purpose_overrides() : array { + public function get_purpose_overrides(): array { return purpose_override::get_overrides_for_purpose($this); } } diff --git a/admin/tool/dataprivacy/classes/purpose_override.php b/admin/tool/dataprivacy/classes/purpose_override.php index 5b022ab8633..131b1d1d161 100644 --- a/admin/tool/dataprivacy/classes/purpose_override.php +++ b/admin/tool/dataprivacy/classes/purpose_override.php @@ -88,7 +88,7 @@ class purpose_override extends \core\persistent { * @param purpose $purpose * @return array */ - public static function get_overrides_for_purpose(purpose $purpose) : array { + public static function get_overrides_for_purpose(purpose $purpose): array { $cache = \cache::make('tool_dataprivacy', 'purpose_overrides'); $overrides = []; diff --git a/admin/tool/dataprivacy/tests/api_test.php b/admin/tool/dataprivacy/tests/api_test.php index 72e58833ce0..74e227f8eef 100644 --- a/admin/tool/dataprivacy/tests/api_test.php +++ b/admin/tool/dataprivacy/tests/api_test.php @@ -2165,7 +2165,7 @@ class api_test extends \advanced_testcase { * @param string $course Retention policy for courses. * @param string $activity Retention policy for activities. */ - protected function setup_basics(string $system, string $user, string $course = null, string $activity = null) : \stdClass { + protected function setup_basics(string $system, string $user, string $course = null, string $activity = null): \stdClass { $this->resetAfterTest(); $purposes = (object) [ @@ -2321,7 +2321,7 @@ class api_test extends \advanced_testcase { * @param int $status * @return \tool_dataprivacy\data_request */ - protected function create_request_with_type_and_status(int $userid, int $type, int $status) : \tool_dataprivacy\data_request { + protected function create_request_with_type_and_status(int $userid, int $type, int $status): \tool_dataprivacy\data_request { $request = new \tool_dataprivacy\data_request(0, (object) [ 'userid' => $userid, 'type' => $type, diff --git a/admin/tool/dataprivacy/tests/data_request_test.php b/admin/tool/dataprivacy/tests/data_request_test.php index bb9f9310c68..d23403f48de 100644 --- a/admin/tool/dataprivacy/tests/data_request_test.php +++ b/admin/tool/dataprivacy/tests/data_request_test.php @@ -35,7 +35,7 @@ class data_request_test extends data_privacy_testcase { * * @return array */ - public function status_state_provider() : array { + public function status_state_provider(): array { return [ [ 'state' => api::DATAREQUEST_STATUS_PENDING, @@ -138,7 +138,7 @@ class data_request_test extends data_privacy_testcase { * * @return array */ - public function non_resettable_provider() : array { + public function non_resettable_provider(): array { $states = []; foreach ($this->status_state_provider() as $thisstatus) { if (!$thisstatus['resettable']) { @@ -221,7 +221,7 @@ class data_request_test extends data_privacy_testcase { * @param int $status * @return data_request */ - public function create_request_for_user_with_status(int $userid, int $type, int $status) : data_request { + public function create_request_for_user_with_status(int $userid, int $type, int $status): data_request { $request = new data_request(0, (object) [ 'userid' => $userid, 'type' => $type, diff --git a/admin/tool/dataprivacy/tests/expired_contexts_test.php b/admin/tool/dataprivacy/tests/expired_contexts_test.php index 0b289c85351..abd8d997d6d 100644 --- a/admin/tool/dataprivacy/tests/expired_contexts_test.php +++ b/admin/tool/dataprivacy/tests/expired_contexts_test.php @@ -33,7 +33,7 @@ class expired_contexts_test extends \advanced_testcase { * @param string $course Retention policy for courses. * @param string $activity Retention policy for activities. */ - protected function setup_basics(string $system, string $user, string $course = null, string $activity = null) : \stdClass { + protected function setup_basics(string $system, string $user, string $course = null, string $activity = null): \stdClass { $this->resetAfterTest(); $purposes = (object) [ @@ -59,7 +59,7 @@ class expired_contexts_test extends \advanced_testcase { * @param int $contextlevel * @return purpose */ - protected function create_and_set_purpose_for_contextlevel(string $retention, int $contextlevel) : purpose { + protected function create_and_set_purpose_for_contextlevel(string $retention, int $contextlevel): purpose { $purpose = new purpose(0, (object) [ 'name' => 'Test purpose ' . rand(1, 1000), 'retentionperiod' => $retention, @@ -1918,7 +1918,7 @@ class expired_contexts_test extends \advanced_testcase { * * @return array */ - public function can_process_deletion_provider() : array { + public function can_process_deletion_provider(): array { return [ 'Pending' => [ expired_context::STATUS_EXPIRED, @@ -1956,7 +1956,7 @@ class expired_contexts_test extends \advanced_testcase { * * @return array */ - public function is_complete_provider() : array { + public function is_complete_provider(): array { return [ 'Pending' => [ expired_context::STATUS_EXPIRED, @@ -1991,7 +1991,7 @@ class expired_contexts_test extends \advanced_testcase { * * @return array */ - public function is_fully_expired_provider() : array { + public function is_fully_expired_provider(): array { return [ 'Fully expired' => [ [ diff --git a/admin/tool/dataprivacy/tests/filtered_userlist_test.php b/admin/tool/dataprivacy/tests/filtered_userlist_test.php index 331ae911fbf..7d71da16370 100644 --- a/admin/tool/dataprivacy/tests/filtered_userlist_test.php +++ b/admin/tool/dataprivacy/tests/filtered_userlist_test.php @@ -58,7 +58,7 @@ class filtered_userlist_test extends \advanced_testcase { * * @return array */ - public function apply_expired_contexts_filters_provider() : array { + public function apply_expired_contexts_filters_provider(): array { return [ // Entire list should be preserved. 'No overrides' => [ diff --git a/admin/tool/dbtransfer/classes/privacy/provider.php b/admin/tool/dbtransfer/classes/privacy/provider.php index c576f1d2daf..5e3548b49d8 100644 --- a/admin/tool/dbtransfer/classes/privacy/provider.php +++ b/admin/tool/dbtransfer/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/filetypes/classes/privacy/provider.php b/admin/tool/filetypes/classes/privacy/provider.php index 9f3f011cf4c..7c9abc8c982 100644 --- a/admin/tool/filetypes/classes/privacy/provider.php +++ b/admin/tool/filetypes/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/generator/classes/privacy/provider.php b/admin/tool/generator/classes/privacy/provider.php index a4d6c011ad8..3f1177cc95e 100644 --- a/admin/tool/generator/classes/privacy/provider.php +++ b/admin/tool/generator/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/httpsreplace/classes/privacy/provider.php b/admin/tool/httpsreplace/classes/privacy/provider.php index 38424a2c097..581d02ad348 100644 --- a/admin/tool/httpsreplace/classes/privacy/provider.php +++ b/admin/tool/httpsreplace/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/innodb/classes/privacy/provider.php b/admin/tool/innodb/classes/privacy/provider.php index 69e66ff8250..a356d6c817d 100644 --- a/admin/tool/innodb/classes/privacy/provider.php +++ b/admin/tool/innodb/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/installaddon/classes/privacy/provider.php b/admin/tool/installaddon/classes/privacy/provider.php index 6769549a782..2ba7217c633 100644 --- a/admin/tool/installaddon/classes/privacy/provider.php +++ b/admin/tool/installaddon/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/langimport/classes/locale.php b/admin/tool/langimport/classes/locale.php index c489e6fbf6c..202bc5673f2 100644 --- a/admin/tool/langimport/classes/locale.php +++ b/admin/tool/langimport/classes/locale.php @@ -42,7 +42,7 @@ class locale { * @return bool TRUE if the locale is available on OS. * @throws coding_exception when $langpackcode parameter is a non-empty string. */ - public function check_locale_availability(string $langpackcode) : bool { + public function check_locale_availability(string $langpackcode): bool { global $CFG; if (empty($langpackcode)) { diff --git a/admin/tool/langimport/classes/privacy/provider.php b/admin/tool/langimport/classes/privacy/provider.php index eb0e50191b1..357a2d2e40e 100644 --- a/admin/tool/langimport/classes/privacy/provider.php +++ b/admin/tool/langimport/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/licensemanager/classes/helper.php b/admin/tool/licensemanager/classes/helper.php index fbc67f61bfd..7b99991b353 100644 --- a/admin/tool/licensemanager/classes/helper.php +++ b/admin/tool/licensemanager/classes/helper.php @@ -39,7 +39,7 @@ class helper { * * @return \moodle_url */ - public static function get_licensemanager_url() : moodle_url { + public static function get_licensemanager_url(): moodle_url { return new moodle_url(self::MANAGER_PATH); } @@ -50,7 +50,7 @@ class helper { * * @return \moodle_url */ - public static function get_enable_license_url(string $licenseshortname) : moodle_url { + public static function get_enable_license_url(string $licenseshortname): moodle_url { $url = new moodle_url(self::MANAGER_PATH, ['action' => manager::ACTION_ENABLE, 'license' => $licenseshortname, 'sesskey' => sesskey()]); @@ -64,7 +64,7 @@ class helper { * * @return \moodle_url */ - public static function get_disable_license_url(string $licenseshortname) : moodle_url { + public static function get_disable_license_url(string $licenseshortname): moodle_url { $url = new moodle_url(self::MANAGER_PATH, ['action' => manager::ACTION_DISABLE, 'license' => $licenseshortname, 'sesskey' => sesskey()]); @@ -76,7 +76,7 @@ class helper { * * @return \moodle_url */ - public static function get_create_license_url() : moodle_url { + public static function get_create_license_url(): moodle_url { $url = self::get_licensemanager_url(); $url->params(['action' => manager::ACTION_CREATE]); return $url; @@ -89,7 +89,7 @@ class helper { * * @return \moodle_url */ - public static function get_update_license_url(string $licenseshortname) : moodle_url { + public static function get_update_license_url(string $licenseshortname): moodle_url { $url = self::get_licensemanager_url(); $url->params(['action' => manager::ACTION_UPDATE, 'license' => $licenseshortname]); return $url; @@ -102,7 +102,7 @@ class helper { * * @return \moodle_url */ - public static function get_moveup_license_url(string $licenseshortname) : moodle_url { + public static function get_moveup_license_url(string $licenseshortname): moodle_url { $url = new moodle_url(self::MANAGER_PATH, ['action' => manager::ACTION_MOVE_UP, 'license' => $licenseshortname, 'sesskey' => sesskey()]); @@ -116,7 +116,7 @@ class helper { * * @return \moodle_url */ - public static function get_movedown_license_url(string $licenseshortname) : moodle_url { + public static function get_movedown_license_url(string $licenseshortname): moodle_url { $url = new moodle_url(self::MANAGER_PATH, ['action' => manager::ACTION_MOVE_DOWN, 'license' => $licenseshortname, 'sesskey' => sesskey()]); @@ -130,7 +130,7 @@ class helper { * * @return int $epoch */ - public static function convert_version_to_epoch(string $version) : int { + public static function convert_version_to_epoch(string $version): int { $date = substr($version, 0, 8); $epoch = strtotime($date); diff --git a/admin/tool/licensemanager/classes/manager.php b/admin/tool/licensemanager/classes/manager.php index 1e0bfb4b644..1b6571e3200 100644 --- a/admin/tool/licensemanager/classes/manager.php +++ b/admin/tool/licensemanager/classes/manager.php @@ -75,7 +75,7 @@ class manager { * @param string $action the api action to carry out. * @param string|object $license the license object or shortname of license to carry action out on. */ - public function execute(string $action, $license) : void { + public function execute(string $action, $license): void { admin_externalpage_setup('licensemanager'); @@ -140,7 +140,7 @@ class manager { * * @return bool true if license editing complete, false otherwise. */ - private function edit(string $action, string $licenseshortname) : bool { + private function edit(string $action, string $licenseshortname): bool { if ($action != self::ACTION_CREATE && $action != self::ACTION_UPDATE) { throw new \coding_exception('license edit actions are limited to create and update'); @@ -190,7 +190,7 @@ class manager { * @param string $direction which direction to move, up or down. * @param string $licenseshortname the shortname of the license to move up or down order. */ - private function change_license_order(string $direction, string $licenseshortname) : void { + private function change_license_order(string $direction, string $licenseshortname): void { if (!empty($licenseshortname)) { if ($direction == self::ACTION_MOVE_UP) { @@ -208,7 +208,7 @@ class manager { * @param string $licenseshortname the shortname of the license to create/edit. * @param \tool_licensemanager\form\edit_license $form the form for submitting edit data. */ - private function view_license_editor(string $action, string $licenseshortname, edit_license $form) : void { + private function view_license_editor(string $action, string $licenseshortname, edit_license $form): void { global $PAGE; $renderer = $PAGE->get_renderer('tool_licensemanager'); @@ -233,7 +233,7 @@ class manager { /** * View the license manager. */ - private function view_license_manager(string $message = null) : void { + private function view_license_manager(string $message = null): void { global $PAGE, $OUTPUT; $renderer = $PAGE->get_renderer('tool_licensemanager'); diff --git a/admin/tool/licensemanager/classes/output/renderer.php b/admin/tool/licensemanager/classes/output/renderer.php index 19ac8d419a4..d21d1dd587b 100644 --- a/admin/tool/licensemanager/classes/output/renderer.php +++ b/admin/tool/licensemanager/classes/output/renderer.php @@ -44,7 +44,7 @@ class renderer extends plugin_renderer_base { * * @return string html fragment for display. */ - public function render_create_licence_headers() : string { + public function render_create_licence_headers(): string { $this->page->navbar->add(get_string('createlicense', 'tool_licensemanager'), helper::get_create_license_url()); @@ -62,7 +62,7 @@ class renderer extends plugin_renderer_base { * * @return string html fragment for display. */ - public function render_edit_licence_headers(string $licenseshortname) : string { + public function render_edit_licence_headers(string $licenseshortname): string { $this->page->navbar->add(get_string('editlicense', 'tool_licensemanager'), helper::get_update_license_url($licenseshortname)); diff --git a/admin/tool/licensemanager/classes/privacy/provider.php b/admin/tool/licensemanager/classes/privacy/provider.php index b4eb6115dac..341b3961a61 100644 --- a/admin/tool/licensemanager/classes/privacy/provider.php +++ b/admin/tool/licensemanager/classes/privacy/provider.php @@ -41,7 +41,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'; } } diff --git a/admin/tool/log/classes/privacy/provider.php b/admin/tool/log/classes/privacy/provider.php index 9968e447753..b1cfbe5780a 100644 --- a/admin/tool/log/classes/privacy/provider.php +++ b/admin/tool/log/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @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_plugintype_link('logstore', [], 'privacy:metadata:logstore'); return $collection; } @@ -63,7 +63,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $contextlist = new \core_privacy\local\request\contextlist(); static::call_subplugins_method_with_args('add_contexts_for_userid', [$contextlist, $userid]); return $contextlist; diff --git a/admin/tool/log/store/database/classes/privacy/provider.php b/admin/tool/log/store/database/classes/privacy/provider.php index c9b31af931a..6aed10a0fb5 100644 --- a/admin/tool/log/store/database/classes/privacy/provider.php +++ b/admin/tool/log/store/database/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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_external_location_link('log', [ 'eventname' => 'privacy:metadata:log:eventname', 'userid' => 'privacy:metadata:log:userid', diff --git a/admin/tool/log/store/standard/classes/privacy/provider.php b/admin/tool/log/store/standard/classes/privacy/provider.php index 76a4e1f782c..c300574b8c3 100644 --- a/admin/tool/log/store/standard/classes/privacy/provider.php +++ b/admin/tool/log/store/standard/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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('logstore_standard_log', [ 'eventname' => 'privacy:metadata:log:eventname', 'userid' => 'privacy:metadata:log:userid', diff --git a/admin/tool/lp/classes/privacy/provider.php b/admin/tool/lp/classes/privacy/provider.php index c78bbb7c6e0..f3c25443545 100644 --- a/admin/tool/lp/classes/privacy/provider.php +++ b/admin/tool/lp/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/lpimportcsv/classes/privacy/provider.php b/admin/tool/lpimportcsv/classes/privacy/provider.php index 97eda402dc2..6e829d45dcb 100644 --- a/admin/tool/lpimportcsv/classes/privacy/provider.php +++ b/admin/tool/lpimportcsv/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/lpmigrate/classes/privacy/provider.php b/admin/tool/lpmigrate/classes/privacy/provider.php index 6d5ad12c69f..a69fbe8331d 100644 --- a/admin/tool/lpmigrate/classes/privacy/provider.php +++ b/admin/tool/lpmigrate/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/messageinbound/classes/privacy/provider.php b/admin/tool/messageinbound/classes/privacy/provider.php index 33dc481e7b8..6a9876a161a 100644 --- a/admin/tool/messageinbound/classes/privacy/provider.php +++ b/admin/tool/messageinbound/classes/privacy/provider.php @@ -54,7 +54,7 @@ class provider implements * @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('messageinbound_messagelist', [ 'messageid' => 'privacy:metadata:messagelist:messageid', @@ -75,7 +75,7 @@ class provider implements * @param int $userid The user to search. * @return \contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $contextlist = new \core_privacy\local\request\contextlist(); // Always add the user context so we're sure we're not dodging user keys, besides it's not costly to do so. diff --git a/admin/tool/mfa/factor/sms/classes/helper.php b/admin/tool/mfa/factor/sms/classes/helper.php index 03f7498c568..7035f95f158 100644 --- a/admin/tool/mfa/factor/sms/classes/helper.php +++ b/admin/tool/mfa/factor/sms/classes/helper.php @@ -60,7 +60,7 @@ class helper { * @param string $phonenumber from the given user input * @return bool */ - public static function is_valid_phonenumber(string $phonenumber) : bool { + public static function is_valid_phonenumber(string $phonenumber): bool { $phonenumber = self::format_number($phonenumber); return (preg_match("/^\+[1-9]\d{1,14}$/", $phonenumber)) ? true : false; } diff --git a/admin/tool/mfa/factor/sms/tests/aws_helper_test.php b/admin/tool/mfa/factor/sms/tests/aws_helper_test.php index e7028be20b6..4b96338c6ea 100644 --- a/admin/tool/mfa/factor/sms/tests/aws_helper_test.php +++ b/admin/tool/mfa/factor/sms/tests/aws_helper_test.php @@ -39,7 +39,7 @@ use factor_sms\local\aws_helper; */ class aws_helper_test extends \advanced_testcase { - public function test_get_proxy_string():void { + public function test_get_proxy_string(): void { global $CFG; $this->resetAfterTest(); // Confirm with no config an empty string is returned. diff --git a/admin/tool/mfa/factor/webauthn/classes/privacy/provider.php b/admin/tool/mfa/factor/webauthn/classes/privacy/provider.php index 32fdc1ed65f..df488903b63 100644 --- a/admin/tool/mfa/factor/webauthn/classes/privacy/provider.php +++ b/admin/tool/mfa/factor/webauthn/classes/privacy/provider.php @@ -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'; } } diff --git a/admin/tool/mobile/classes/api.php b/admin/tool/mobile/classes/api.php index b12a32abbe8..98c48161eee 100644 --- a/admin/tool/mobile/classes/api.php +++ b/admin/tool/mobile/classes/api.php @@ -781,7 +781,7 @@ class api { * * @return array Subscription information */ - public static function get_subscription_information() : ?array { + public static function get_subscription_information(): ?array { global $CFG; // Use session cache to prevent multiple requests. diff --git a/admin/tool/mobile/classes/privacy/provider.php b/admin/tool/mobile/classes/privacy/provider.php index 54c61a1c2a8..0172945a87f 100644 --- a/admin/tool/mobile/classes/privacy/provider.php +++ b/admin/tool/mobile/classes/privacy/provider.php @@ -47,7 +47,7 @@ class provider implements * @param collection $collection The initialised item 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 { // There is a one user preference. $collection->add_user_preference('tool_mobile_autologin_request_last', 'privacy:metadata:preference:tool_mobile_autologin_request_last'); @@ -61,7 +61,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_private_key} k JOIN {user} u ON k.userid = u.id diff --git a/admin/tool/monitor/classes/privacy/provider.php b/admin/tool/monitor/classes/privacy/provider.php index 2ffbf667310..603178fa56d 100644 --- a/admin/tool/monitor/classes/privacy/provider.php +++ b/admin/tool/monitor/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @param collection $collection An object for storing metadata. * @return collection The metadata. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $toolmonitorrules = [ 'description' => 'privacy:metadata:description', 'name' => 'privacy:metadata:name', @@ -90,7 +90,7 @@ class provider implements * @param int $userid The user ID. * @return contextlist The list of context IDs. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $params = ['useridrules' => $userid, 'useridsubscriptions' => $userid, 'contextuserrule' => CONTEXT_USER, 'contextusersub' => CONTEXT_USER]; $sql = "SELECT DISTINCT ctx.id diff --git a/admin/tool/monitor/classes/rule_form.php b/admin/tool/monitor/classes/rule_form.php index ac60dc939bd..731aa0a84b3 100644 --- a/admin/tool/monitor/classes/rule_form.php +++ b/admin/tool/monitor/classes/rule_form.php @@ -40,7 +40,7 @@ class rule_form extends \moodleform { * Mform class definition * */ - public function definition () { + public function definition() { global $PAGE; $mform = $this->_form; diff --git a/admin/tool/moodlenet/classes/privacy/provider.php b/admin/tool/moodlenet/classes/privacy/provider.php index a076f4bc744..2822d3e74c0 100644 --- a/admin/tool/moodlenet/classes/privacy/provider.php +++ b/admin/tool/moodlenet/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/admin/tool/multilangupgrade/classes/privacy/provider.php b/admin/tool/multilangupgrade/classes/privacy/provider.php index 997d0a370f5..e7ebf6993cb 100644 --- a/admin/tool/multilangupgrade/classes/privacy/provider.php +++ b/admin/tool/multilangupgrade/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/oauth2/classes/privacy/provider.php b/admin/tool/oauth2/classes/privacy/provider.php index 5b2ad2e39ec..551be7ea5e0 100644 --- a/admin/tool/oauth2/classes/privacy/provider.php +++ b/admin/tool/oauth2/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/phpunit/classes/privacy/provider.php b/admin/tool/phpunit/classes/privacy/provider.php index ab9c4a8f297..41d5a7f6897 100644 --- a/admin/tool/phpunit/classes/privacy/provider.php +++ b/admin/tool/phpunit/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/admin/tool/policy/classes/privacy/provider.php b/admin/tool/policy/classes/privacy/provider.php index cf9116d7571..a2e1046e499 100644 --- a/admin/tool/policy/classes/privacy/provider.php +++ b/admin/tool/policy/classes/privacy/provider.php @@ -57,7 +57,7 @@ class provider implements * @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( 'tool_policy_acceptances', [ @@ -104,7 +104,7 @@ class provider implements * @param int $userid The userid. * @return contextlist The list of contexts containing user info for the user. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // Policies a user has modified. diff --git a/admin/tool/profiling/classes/privacy/provider.php b/admin/tool/profiling/classes/privacy/provider.php index 5e758e6c2f2..0e56b4fc2be 100644 --- a/admin/tool/profiling/classes/privacy/provider.php +++ b/admin/tool/profiling/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/admin/tool/profiling/import_form.php b/admin/tool/profiling/import_form.php index f165a6b901a..5eec5d32ccc 100644 --- a/admin/tool/profiling/import_form.php +++ b/admin/tool/profiling/import_form.php @@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); class profiling_import_form extends moodleform { - public function definition () { + public function definition() { global $CFG; $mform = $this->_form; diff --git a/admin/tool/recyclebin/classes/privacy/provider.php b/admin/tool/recyclebin/classes/privacy/provider.php index 0ef68c99d25..2a74a5a912d 100644 --- a/admin/tool/recyclebin/classes/privacy/provider.php +++ b/admin/tool/recyclebin/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/admin/tool/replace/classes/privacy/provider.php b/admin/tool/replace/classes/privacy/provider.php index a10e57d95cb..4b2337b2aa3 100644 --- a/admin/tool/replace/classes/privacy/provider.php +++ b/admin/tool/replace/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/spamcleaner/classes/privacy/provider.php b/admin/tool/spamcleaner/classes/privacy/provider.php index 595c7d15bf7..89fb5fa0975 100644 --- a/admin/tool/spamcleaner/classes/privacy/provider.php +++ b/admin/tool/spamcleaner/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/task/classes/check/adhocqueue.php b/admin/tool/task/classes/check/adhocqueue.php index 0e8a15a0839..3787cd9e2dc 100644 --- a/admin/tool/task/classes/check/adhocqueue.php +++ b/admin/tool/task/classes/check/adhocqueue.php @@ -34,7 +34,7 @@ class adhocqueue extends check { * Return result * @return result */ - public function get_result() : result { + public function get_result(): result { global $DB, $CFG; $stats = $DB->get_record_sql(' diff --git a/admin/tool/task/classes/check/cronrunning.php b/admin/tool/task/classes/check/cronrunning.php index 8d2d8371182..155162e587c 100644 --- a/admin/tool/task/classes/check/cronrunning.php +++ b/admin/tool/task/classes/check/cronrunning.php @@ -52,7 +52,7 @@ class cronrunning extends check { * Return result * @return result */ - public function get_result() : result { + public function get_result(): result { global $CFG; // Eventually this should replace cron_overdue_warning and diff --git a/admin/tool/task/classes/check/maxfaildelay.php b/admin/tool/task/classes/check/maxfaildelay.php index 79b078db4a0..032be7be4a0 100644 --- a/admin/tool/task/classes/check/maxfaildelay.php +++ b/admin/tool/task/classes/check/maxfaildelay.php @@ -52,7 +52,7 @@ class maxfaildelay extends check { * Return result * @return result */ - public function get_result() : result { + public function get_result(): result { global $CFG; $status = result::OK; diff --git a/admin/tool/task/classes/privacy/provider.php b/admin/tool/task/classes/privacy/provider.php index ea58f7d4e76..0ff0934b1bf 100644 --- a/admin/tool/task/classes/privacy/provider.php +++ b/admin/tool/task/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/task/classes/running_tasks_table.php b/admin/tool/task/classes/running_tasks_table.php index d7e7c7fc587..f26265d99ab 100644 --- a/admin/tool/task/classes/running_tasks_table.php +++ b/admin/tool/task/classes/running_tasks_table.php @@ -85,7 +85,7 @@ class running_tasks_table extends \table_sql { * @param \stdClass $row * @return string */ - public function col_classname($row) : string { + public function col_classname($row): string { $output = $row->classname; if ($row->type == 'scheduled') { if (class_exists($row->classname)) { @@ -108,7 +108,7 @@ class running_tasks_table extends \table_sql { * @return string * @throws \coding_exception */ - public function col_type($row) : string { + public function col_type($row): string { if ($row->type == 'scheduled') { $output = \html_writer::span(get_string('scheduled', 'tool_task'), 'badge bg-primary text-white'); } else if ($row->type == 'adhoc') { @@ -126,7 +126,7 @@ class running_tasks_table extends \table_sql { * @param \stdClass $row * @return string */ - public function col_time($row) : string { + public function col_time($row): string { global $OUTPUT; $taskmethod = "{$row->type}_task_from_record"; @@ -150,7 +150,7 @@ class running_tasks_table extends \table_sql { * @param \stdClass $row * @return string */ - public function col_timestarted($row) : string { + public function col_timestarted($row): string { return userdate($row->timestarted); } } diff --git a/admin/tool/task/lib.php b/admin/tool/task/lib.php index 64d99754e8e..e6c45e6ed1a 100644 --- a/admin/tool/task/lib.php +++ b/admin/tool/task/lib.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); * * @return array of check objects */ -function tool_task_status_checks() : array { +function tool_task_status_checks(): array { return [ new \tool_task\check\cronrunning(), new \tool_task\check\maxfaildelay(), diff --git a/admin/tool/templatelibrary/classes/privacy/provider.php b/admin/tool/templatelibrary/classes/privacy/provider.php index f3f29fb8c62..396573c4351 100644 --- a/admin/tool/templatelibrary/classes/privacy/provider.php +++ b/admin/tool/templatelibrary/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/unsuproles/classes/privacy/provider.php b/admin/tool/unsuproles/classes/privacy/provider.php index 2af5885200d..a313d7c59db 100644 --- a/admin/tool/unsuproles/classes/privacy/provider.php +++ b/admin/tool/unsuproles/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/uploadcourse/classes/course.php b/admin/tool/uploadcourse/classes/course.php index b58f655d0a2..59477e3ac66 100644 --- a/admin/tool/uploadcourse/classes/course.php +++ b/admin/tool/uploadcourse/classes/course.php @@ -1199,7 +1199,7 @@ class tool_uploadcourse_course { * @param int $roleid Role ID. * @return bool */ - protected function validate_role_context(int $courseid, int $roleid) : bool { + protected function validate_role_context(int $courseid, int $roleid): bool { if (empty($this->assignableroles[$courseid])) { $coursecontext = \context_course::instance($courseid); $this->assignableroles[$courseid] = get_assignable_roles($coursecontext, ROLENAME_SHORT); @@ -1216,7 +1216,7 @@ class tool_uploadcourse_course { * @param int $roleid Role ID. * @return bool */ - protected function validate_role_context_level(int $roleid) : bool { + protected function validate_role_context_level(int $roleid): bool { if (empty($this->contextlevels[$roleid])) { $this->contextlevels[$roleid] = get_role_contextlevels($roleid); } diff --git a/admin/tool/uploadcourse/classes/privacy/provider.php b/admin/tool/uploadcourse/classes/privacy/provider.php index 0f463c110ff..a55977632c3 100644 --- a/admin/tool/uploadcourse/classes/privacy/provider.php +++ b/admin/tool/uploadcourse/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/uploadcourse/classes/step1_form.php b/admin/tool/uploadcourse/classes/step1_form.php index 2d37871ed47..4232cbb95dc 100644 --- a/admin/tool/uploadcourse/classes/step1_form.php +++ b/admin/tool/uploadcourse/classes/step1_form.php @@ -39,7 +39,7 @@ class tool_uploadcourse_step1_form extends tool_uploadcourse_base_form { * The standard form definiton. * @return void */ - public function definition () { + public function definition() { $mform = $this->_form; $mform->addElement('header', 'generalhdr', get_string('general')); diff --git a/admin/tool/uploadcourse/classes/step2_form.php b/admin/tool/uploadcourse/classes/step2_form.php index 19d07db0b31..2beab06d031 100644 --- a/admin/tool/uploadcourse/classes/step2_form.php +++ b/admin/tool/uploadcourse/classes/step2_form.php @@ -39,7 +39,7 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form { * The standard form definiton. * @return void. */ - public function definition () { + public function definition() { global $CFG; $mform = $this->_form; diff --git a/admin/tool/uploadcourse/tests/course_test.php b/admin/tool/uploadcourse/tests/course_test.php index 75866511219..1e8aa30d6d2 100644 --- a/admin/tool/uploadcourse/tests/course_test.php +++ b/admin/tool/uploadcourse/tests/course_test.php @@ -1739,7 +1739,7 @@ class course_test extends \advanced_testcase { * * @return core_customfield_generator */ - protected function get_customfield_generator() : \core_customfield_generator { + protected function get_customfield_generator(): \core_customfield_generator { return $this->getDataGenerator()->get_plugin_generator('core_customfield'); } @@ -1753,7 +1753,7 @@ class course_test extends \advanced_testcase { * @return \core_customfield\field_controller */ protected function create_custom_field(\core_customfield\category_controller $category, string $type, string $shortname, - array $configdata = []) : \core_customfield\field_controller { + array $configdata = []): \core_customfield\field_controller { return $this->get_customfield_generator()->create_field([ 'categoryid' => $category->get('id'), diff --git a/admin/tool/uploadcourse/tests/helper_test.php b/admin/tool/uploadcourse/tests/helper_test.php index 5f822e1d1a0..075af2bcd7a 100644 --- a/admin/tool/uploadcourse/tests/helper_test.php +++ b/admin/tool/uploadcourse/tests/helper_test.php @@ -470,7 +470,7 @@ class helper_test extends \advanced_testcase { * * @return core_customfield_generator */ - protected function get_customfield_generator() : \core_customfield_generator { + protected function get_customfield_generator(): \core_customfield_generator { return $this->getDataGenerator()->get_plugin_generator('core_customfield'); } @@ -484,7 +484,7 @@ class helper_test extends \advanced_testcase { * @return \core_customfield\field_controller */ protected function create_custom_field(\core_customfield\category_controller $category, string $type, string $shortname, - array $configdata = []) : \core_customfield\field_controller { + array $configdata = []): \core_customfield\field_controller { return $this->get_customfield_generator()->create_field([ 'categoryid' => $category->get('id'), diff --git a/admin/tool/uploaduser/classes/privacy/provider.php b/admin/tool/uploaduser/classes/privacy/provider.php index eb25a73ffa2..f0be404ccf2 100644 --- a/admin/tool/uploaduser/classes/privacy/provider.php +++ b/admin/tool/uploaduser/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/admin/tool/uploaduser/picture_form.php b/admin/tool/uploaduser/picture_form.php index 77359eb281f..401d3226856 100644 --- a/admin/tool/uploaduser/picture_form.php +++ b/admin/tool/uploaduser/picture_form.php @@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die(); require_once $CFG->libdir.'/formslib.php'; class admin_uploadpicture_form extends moodleform { - function definition (){ + function definition(){ global $CFG, $USER; $mform =& $this->_form; diff --git a/admin/tool/uploaduser/user_form.php b/admin/tool/uploaduser/user_form.php index 053e648185e..bbff39eedfa 100644 --- a/admin/tool/uploaduser/user_form.php +++ b/admin/tool/uploaduser/user_form.php @@ -35,7 +35,7 @@ require_once($CFG->dirroot . '/user/editlib.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class admin_uploaduser_form1 extends moodleform { - function definition () { + function definition() { $mform = $this->_form; $mform->addElement('header', 'settingsheader', get_string('upload')); @@ -90,7 +90,7 @@ class admin_uploaduser_form1 extends moodleform { * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class admin_uploaduser_form2 extends moodleform { - function definition () { + function definition() { global $CFG, $USER; $mform = $this->_form; diff --git a/admin/tool/usertours/classes/output/tour.php b/admin/tool/usertours/classes/output/tour.php index 000c2a8dfd4..6e933fb7cc4 100644 --- a/admin/tool/usertours/classes/output/tour.php +++ b/admin/tool/usertours/classes/output/tour.php @@ -46,7 +46,7 @@ class tour implements \renderable { * * @param toursource $tour The tour being output. */ - public function __construct (toursource $tour) { + public function __construct(toursource $tour) { $this->tour = $tour; } diff --git a/admin/tool/usertours/classes/privacy/provider.php b/admin/tool/usertours/classes/privacy/provider.php index 21b70deaf3b..db71ee9a1a9 100644 --- a/admin/tool/usertours/classes/privacy/provider.php +++ b/admin/tool/usertours/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @param collection $items The initialised item collection to add items to. * @return collection A listing of user data stored through this system. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { // There are several user preferences. $items->add_user_preference(\tool_usertours\tour::TOUR_REQUESTED_BY_USER, 'privacy:metadata:preference:requested'); $items->add_user_preference(\tool_usertours\tour::TOUR_LAST_COMPLETED_BY_USER, 'privacy:metadata:preference:completed'); diff --git a/admin/tool/xmldb/classes/privacy/provider.php b/admin/tool/xmldb/classes/privacy/provider.php index 7c9a42ba8b1..035061a4714 100644 --- a/admin/tool/xmldb/classes/privacy/provider.php +++ b/admin/tool/xmldb/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/analytics/classes/calculable.php b/analytics/classes/calculable.php index 7ef6b2db71d..9741abbb02e 100644 --- a/analytics/classes/calculable.php +++ b/analytics/classes/calculable.php @@ -79,7 +79,7 @@ abstract class calculable { * * @return \lang_string */ - public static abstract function get_name() : \lang_string; + public static abstract function get_name(): \lang_string; /** * The class id is the calculable class full qualified class name. diff --git a/analytics/classes/local/time_splitting/base.php b/analytics/classes/local/time_splitting/base.php index 7150e21243b..37f49606d63 100644 --- a/analytics/classes/local/time_splitting/base.php +++ b/analytics/classes/local/time_splitting/base.php @@ -77,7 +77,7 @@ abstract class base { * * @return \lang_string */ - public static abstract function get_name() : \lang_string; + public static abstract function get_name(): \lang_string; /** * Returns the time splitting method id. diff --git a/analytics/classes/manager.php b/analytics/classes/manager.php index 4216bbe4cfd..8bee35d30aa 100644 --- a/analytics/classes/manager.php +++ b/analytics/classes/manager.php @@ -357,7 +357,7 @@ class manager { * * @return \core_analytics\local\target\base[] */ - public static function get_all_targets() : array { + public static function get_all_targets(): array { if (self::$alltargets !== null) { return self::$alltargets; } @@ -909,7 +909,7 @@ class manager { * @param array $model Model declaration * @return string complying with PARAM_ALPHANUM rules and starting with an 'id' prefix */ - public static function model_declaration_identifier(array $model) : string { + public static function model_declaration_identifier(array $model): string { return 'id'.sha1(serialize($model)); } diff --git a/analytics/classes/model.php b/analytics/classes/model.php index 155cb3d66c0..7999033dfc6 100644 --- a/analytics/classes/model.php +++ b/analytics/classes/model.php @@ -1597,7 +1597,7 @@ class model { * @param bool $includeweights Include the model weights if available * @return string Zip file path */ - public function export_model(string $zipfilename, bool $includeweights = true) : string { + public function export_model(string $zipfilename, bool $includeweights = true): string { \core_analytics\manager::check_can_manage_models(); @@ -1614,7 +1614,7 @@ class model { * @param string $zipfilepath Zip file path * @return \core_analytics\model */ - public static function import_model(string $zipfilepath) : \core_analytics\model { + public static function import_model(string $zipfilepath): \core_analytics\model { \core_analytics\manager::check_can_manage_models(); @@ -1627,7 +1627,7 @@ class model { * * @return bool */ - public function can_export_configuration() : bool { + public function can_export_configuration(): bool { if (empty($this->model->timesplitting)) { return false; @@ -1680,7 +1680,7 @@ class model { * * @return bool */ - public function trained_locally() : bool { + public function trained_locally(): bool { global $DB; if (!$this->is_trained() || $this->is_static()) { diff --git a/analytics/classes/model_config.php b/analytics/classes/model_config.php index a715a8262ff..2f7edabf1a6 100644 --- a/analytics/classes/model_config.php +++ b/analytics/classes/model_config.php @@ -61,7 +61,7 @@ class model_config { * @param bool $includeweights Include the model weights if available * @return string */ - public function export(string $zipfilename, bool $includeweights = true) : string { + public function export(string $zipfilename, bool $includeweights = true): string { if (!$this->model) { throw new \coding_exception('No model object provided.'); @@ -111,7 +111,7 @@ class model_config { * @param string $zipfilepath Path to the zip file to import * @return \core_analytics\model */ - public function import(string $zipfilepath) : \core_analytics\model { + public function import(string $zipfilepath): \core_analytics\model { list($modeldata, $mlbackenddir) = $this->extract_import_contents($zipfilepath); @@ -144,7 +144,7 @@ class model_config { * @param bool $ignoreversionmismatches * @return string|null Error string or null if all good. */ - public function check_dependencies(\stdClass $modeldata, bool $ignoreversionmismatches) : ?string { + public function check_dependencies(\stdClass $modeldata, bool $ignoreversionmismatches): ?string { $siteversions = \core_component::get_all_versions(); @@ -228,7 +228,7 @@ class model_config { * @param string $fullclassname Qualified name including the namespace. * @return string|null Frankenstyle component */ - public static function get_class_component(string $fullclassname) : ?string { + public static function get_class_component(string $fullclassname): ?string { // Strip out leading backslash. $fullclassname = ltrim($fullclassname, '\\'); @@ -254,7 +254,7 @@ class model_config { * @param string $zipfilepath Zip file path * @return array [0] => \stdClass, [1] => string */ - public function extract_import_contents(string $zipfilepath) : array { + public function extract_import_contents(string $zipfilepath): array { $importtempdir = make_request_directory(); @@ -287,7 +287,7 @@ class model_config { * Exports the configuration of the model. * @return \stdClass */ - protected function export_model_data() : \stdClass { + protected function export_model_data(): \stdClass { $versions = \core_component::get_all_versions(); diff --git a/analytics/classes/packable.php b/analytics/classes/packable.php index 1d26f65f479..6e24ade5390 100644 --- a/analytics/classes/packable.php +++ b/analytics/classes/packable.php @@ -43,7 +43,7 @@ interface packable { * @param string $modeldir The directory that contains the trained model. * @return string The path to the directory that contains the exported model. */ - public function export(string $uniqueid, string $modeldir) : string; + public function export(string $uniqueid, string $modeldir): string; /** * Imports the provided machine learning model. @@ -53,5 +53,5 @@ interface packable { * @param string $importdir The directory that contains the files to import. * @return bool Success */ - public function import(string $uniqueid, string $modeldir, string $importdir) : bool; + public function import(string $uniqueid, string $modeldir, string $importdir): bool; } diff --git a/analytics/classes/privacy/provider.php b/analytics/classes/privacy/provider.php index 68e306db83c..3ccbffee788 100644 --- a/analytics/classes/privacy/provider.php +++ b/analytics/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @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( 'analytics_indicator_calc', [ @@ -125,7 +125,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { global $DB; $contextlist = new \core_privacy\local\request\contextlist(); diff --git a/analytics/classes/stats.php b/analytics/classes/stats.php index fd6e7cb3595..d71c60e65e3 100644 --- a/analytics/classes/stats.php +++ b/analytics/classes/stats.php @@ -39,7 +39,7 @@ class stats { * * @return int */ - public static function enabled_models() : int { + public static function enabled_models(): int { return count(manager::get_all_models(true)); } @@ -48,7 +48,7 @@ class stats { * * @return int */ - public static function predictions() : int { + public static function predictions(): int { global $DB; return $DB->count_records('analytics_predictions'); @@ -59,7 +59,7 @@ class stats { * * @return int */ - public static function actions() : int { + public static function actions(): int { global $DB; return $DB->count_records('analytics_prediction_actions'); @@ -70,7 +70,7 @@ class stats { * * @return int */ - public static function actions_not_useful() : int { + public static function actions_not_useful(): int { global $DB; // Simple version using core's TYPE_NEGATIVE actions. diff --git a/analytics/tests/fixtures/test_indicator_discrete.php b/analytics/tests/fixtures/test_indicator_discrete.php index 983b6554922..acbc3df4f0f 100644 --- a/analytics/tests/fixtures/test_indicator_discrete.php +++ b/analytics/tests/fixtures/test_indicator_discrete.php @@ -40,7 +40,7 @@ class test_indicator_discrete extends \core_analytics\local\indicator\discrete { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_indicator_fullname.php b/analytics/tests/fixtures/test_indicator_fullname.php index 761d40b482b..eda3a6e377e 100644 --- a/analytics/tests/fixtures/test_indicator_fullname.php +++ b/analytics/tests/fixtures/test_indicator_fullname.php @@ -42,7 +42,7 @@ class test_indicator_fullname extends \core_analytics\local\indicator\linear { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_indicator_max.php b/analytics/tests/fixtures/test_indicator_max.php index ee506e48b82..9f557cbaa59 100644 --- a/analytics/tests/fixtures/test_indicator_max.php +++ b/analytics/tests/fixtures/test_indicator_max.php @@ -42,7 +42,7 @@ class test_indicator_max extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_indicator_min.php b/analytics/tests/fixtures/test_indicator_min.php index ba3c33b2380..e7be1f0a358 100644 --- a/analytics/tests/fixtures/test_indicator_min.php +++ b/analytics/tests/fixtures/test_indicator_min.php @@ -42,7 +42,7 @@ class test_indicator_min extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_indicator_multiclass.php b/analytics/tests/fixtures/test_indicator_multiclass.php index 64872a81b92..0c20e1a5ac5 100644 --- a/analytics/tests/fixtures/test_indicator_multiclass.php +++ b/analytics/tests/fixtures/test_indicator_multiclass.php @@ -42,7 +42,7 @@ class test_indicator_multiclass extends \core_analytics\local\indicator\linear { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_indicator_null.php b/analytics/tests/fixtures/test_indicator_null.php index 8b928477d2f..b5b867ca414 100644 --- a/analytics/tests/fixtures/test_indicator_null.php +++ b/analytics/tests/fixtures/test_indicator_null.php @@ -42,7 +42,7 @@ class test_indicator_null extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_indicator_random.php b/analytics/tests/fixtures/test_indicator_random.php index 19106a682ed..fb38d819d05 100644 --- a/analytics/tests/fixtures/test_indicator_random.php +++ b/analytics/tests/fixtures/test_indicator_random.php @@ -42,7 +42,7 @@ class test_indicator_random extends \core_analytics\local\indicator\linear { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_static_target_shortname.php b/analytics/tests/fixtures/test_static_target_shortname.php index 8ce97c1d6cc..adf0fb1fde7 100644 --- a/analytics/tests/fixtures/test_static_target_shortname.php +++ b/analytics/tests/fixtures/test_static_target_shortname.php @@ -47,7 +47,7 @@ class test_static_target_shortname extends test_target_shortname { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_target_course_users.php b/analytics/tests/fixtures/test_target_course_users.php index 7be0a87f6d9..ddb8e8f235a 100644 --- a/analytics/tests/fixtures/test_target_course_users.php +++ b/analytics/tests/fixtures/test_target_course_users.php @@ -53,7 +53,7 @@ class test_target_course_users extends test_target_site_users { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('adminhelpedituser'); } diff --git a/analytics/tests/fixtures/test_target_shortname.php b/analytics/tests/fixtures/test_target_shortname.php index 5d941523c54..49b803e6876 100644 --- a/analytics/tests/fixtures/test_target_shortname.php +++ b/analytics/tests/fixtures/test_target_shortname.php @@ -42,7 +42,7 @@ class test_target_shortname extends \core_analytics\local\target\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } diff --git a/analytics/tests/fixtures/test_target_shortname_multiclass.php b/analytics/tests/fixtures/test_target_shortname_multiclass.php index 91c5e35cbb0..89cda9a9d3d 100644 --- a/analytics/tests/fixtures/test_target_shortname_multiclass.php +++ b/analytics/tests/fixtures/test_target_shortname_multiclass.php @@ -42,7 +42,7 @@ class test_target_shortname_multiclass extends \core_analytics\local\target\disc * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('allowstealthmodules'); } @@ -205,7 +205,7 @@ class test_target_shortname_multiclass extends \core_analytics\local\target\disc * @param \core_analytics\local\time_splitting\base $timesplitting * @return bool */ - public function can_use_timesplitting(\core_analytics\local\time_splitting\base $timesplitting):bool { + public function can_use_timesplitting(\core_analytics\local\time_splitting\base $timesplitting): bool { return true; } } diff --git a/analytics/tests/fixtures/test_target_site_users.php b/analytics/tests/fixtures/test_target_site_users.php index 342f5169645..3ff585bf828 100644 --- a/analytics/tests/fixtures/test_target_site_users.php +++ b/analytics/tests/fixtures/test_target_site_users.php @@ -44,7 +44,7 @@ class test_target_site_users extends \core_analytics\local\target\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { // Using a string that exists and contains a corresponding '_help' string. return new \lang_string('adminhelplogs'); } diff --git a/analytics/tests/fixtures/test_timesplitting_seconds.php b/analytics/tests/fixtures/test_timesplitting_seconds.php index 289474bcc20..0b945d41b71 100644 --- a/analytics/tests/fixtures/test_timesplitting_seconds.php +++ b/analytics/tests/fixtures/test_timesplitting_seconds.php @@ -46,7 +46,7 @@ class test_timesplitting_seconds extends \core_analytics\local\time_splitting\pa * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('error'); } } diff --git a/analytics/tests/fixtures/test_timesplitting_upcoming_seconds.php b/analytics/tests/fixtures/test_timesplitting_upcoming_seconds.php index 9309f7511c0..6882dc11a51 100644 --- a/analytics/tests/fixtures/test_timesplitting_upcoming_seconds.php +++ b/analytics/tests/fixtures/test_timesplitting_upcoming_seconds.php @@ -46,7 +46,7 @@ class test_timesplitting_upcoming_seconds extends \core_analytics\local\time_spl * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('error'); } } diff --git a/auth/cas/auth.php b/auth/cas/auth.php index 1a888207d93..7378b4fa436 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -70,7 +70,7 @@ class auth_plugin_cas extends auth_plugin_ldap { * @param string $password The password (with system magic quotes) * @return bool Authentication success or failure. */ - function user_login ($username, $password) { + function user_login($username, $password) { $this->connectCAS(); return phpCAS::isAuthenticated() && (trim(core_text::strtolower(phpCAS::getUser())) == $username); } diff --git a/auth/cas/classes/privacy/provider.php b/auth/cas/classes/privacy/provider.php index f7d6f53dcdd..8184a3fe4ac 100644 --- a/auth/cas/classes/privacy/provider.php +++ b/auth/cas/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/auth/classes/privacy/provider.php b/auth/classes/privacy/provider.php index 1c61c57958c..644bd67aa9f 100644 --- a/auth/classes/privacy/provider.php +++ b/auth/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('auth_forcepasswordchange', 'privacy:metadata:userpref:forcepasswordchange'); $collection->add_user_preference('create_password', 'privacy:metadata:userpref:createpassword'); diff --git a/auth/db/classes/privacy/provider.php b/auth/db/classes/privacy/provider.php index c4008d1bdb4..37a008c804f 100644 --- a/auth/db/classes/privacy/provider.php +++ b/auth/db/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/auth/email/auth.php b/auth/email/auth.php index 42a6e2d9960..09805d9ee98 100644 --- a/auth/email/auth.php +++ b/auth/email/auth.php @@ -57,7 +57,7 @@ class auth_plugin_email extends auth_plugin_base { * @param string $password The password * @return bool Authentication success or failure. */ - function user_login ($username, $password) { + function user_login($username, $password) { global $CFG, $DB; if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) { return validate_internal_user_password($user, $password); diff --git a/auth/email/classes/privacy/provider.php b/auth/email/classes/privacy/provider.php index 8b410d3d4d3..b0bc5662fab 100644 --- a/auth/email/classes/privacy/provider.php +++ b/auth/email/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index e0971147673..927968ccd87 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -1467,7 +1467,7 @@ class auth_plugin_ldap extends auth_plugin_base { * @param string $user_dn User distinguished name for the user we are checking password expiration (only needed for Active Directory). * @return timestamp */ - function ldap_expirationtime2unix ($time, $ldapconnection, $user_dn) { + function ldap_expirationtime2unix($time, $ldapconnection, $user_dn) { $result = false; switch ($this->config->user_type) { case 'edir': @@ -1520,7 +1520,7 @@ class auth_plugin_ldap extends auth_plugin_base { * @return array */ - function ldap_attributes () { + function ldap_attributes() { $moodleattributes = array(); // If we have custom fields then merge them with user fields. $customfields = $this->get_custom_user_profile_fields(); diff --git a/auth/ldap/classes/privacy/provider.php b/auth/ldap/classes/privacy/provider.php index 3e09a1645ed..c8bf1d7ebb8 100644 --- a/auth/ldap/classes/privacy/provider.php +++ b/auth/ldap/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/auth/manual/classes/privacy/provider.php b/auth/manual/classes/privacy/provider.php index 73bb78b59d2..641242a6a6f 100644 --- a/auth/manual/classes/privacy/provider.php +++ b/auth/manual/classes/privacy/provider.php @@ -45,7 +45,7 @@ class provider implements * @param collection $collection The initialised item 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 { // There is a one user preference. $collection->add_user_preference('auth_manual_passwordupdatetime', 'privacy:metadata:preference:passwordupdatetime'); diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index f86b3b4495b..676368ebc60 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -1037,7 +1037,7 @@ class auth_plugin_mnet extends auth_plugin_base { * @param object $logline The log information to be trimmed * @return object The passed logline object trimmed to not exceed storable limits */ - function trim_logline ($logline) { + function trim_logline($logline) { $limits = array('ip' => 15, 'coursename' => 40, 'module' => 20, 'action' => 40, 'url' => 255); foreach ($limits as $property => $limit) { diff --git a/auth/mnet/classes/privacy/provider.php b/auth/mnet/classes/privacy/provider.php index c1a95c6f6f7..4132f48ea38 100644 --- a/auth/mnet/classes/privacy/provider.php +++ b/auth/mnet/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @param collection $collection The initialised item 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 { $sessionfields = [ 'userid' => 'privacy:metadata:mnet_session:userid', @@ -130,7 +130,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {mnet_log} ml JOIN {context} ctx ON ctx.instanceid = ml.userid AND ctx.contextlevel = :contextlevel diff --git a/auth/nologin/auth.php b/auth/nologin/auth.php index 7b7dd3a0128..34484fd8df0 100644 --- a/auth/nologin/auth.php +++ b/auth/nologin/auth.php @@ -112,7 +112,7 @@ class auth_plugin_nologin extends auth_plugin_base { * @param stdClass $user A user object * @return string[] An array of strings with keys subject and message */ - public function get_password_change_info(stdClass $user) : array { + public function get_password_change_info(stdClass $user): array { $site = get_site(); $data = new stdClass(); diff --git a/auth/nologin/classes/privacy/provider.php b/auth/nologin/classes/privacy/provider.php index d354e2f6c32..55f19e74c66 100644 --- a/auth/nologin/classes/privacy/provider.php +++ b/auth/nologin/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/auth/none/auth.php b/auth/none/auth.php index 832c8843670..75ea4349ebe 100644 --- a/auth/none/auth.php +++ b/auth/none/auth.php @@ -57,7 +57,7 @@ class auth_plugin_none extends auth_plugin_base { * @param string $password The password * @return bool Authentication success or failure. */ - function user_login ($username, $password) { + function user_login($username, $password) { global $CFG, $DB; if ($user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$CFG->mnet_localhost_id))) { return validate_internal_user_password($user, $password); diff --git a/auth/none/classes/privacy/provider.php b/auth/none/classes/privacy/provider.php index 9e9720d77f7..d6e819c373e 100644 --- a/auth/none/classes/privacy/provider.php +++ b/auth/none/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/auth/oauth2/classes/auth.php b/auth/oauth2/classes/auth.php index fd2343f6bea..b8023216fb1 100644 --- a/auth/oauth2/classes/auth.php +++ b/auth/oauth2/classes/auth.php @@ -631,7 +631,7 @@ class auth extends \auth_plugin_base { * @param stdClass $user A user object * @return string[] An array of strings with keys subject and message */ - public function get_password_change_info(stdClass $user) : array { + public function get_password_change_info(stdClass $user): array { $site = get_site(); $data = new stdClass(); diff --git a/auth/oauth2/classes/privacy/provider.php b/auth/oauth2/classes/privacy/provider.php index c60abc69ab4..1bc8c8982ff 100644 --- a/auth/oauth2/classes/privacy/provider.php +++ b/auth/oauth2/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @param collection $collection An object for storing metadata. * @return collection The metadata. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $authfields = [ 'timecreated' => 'privacy:metadata:auth_oauth2:timecreated', 'timemodified' => 'privacy:metadata:auth_oauth2:timemodified', @@ -89,7 +89,7 @@ class provider implements * @param int $userid The user ID. * @return contextlist The list of context IDs. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {auth_oauth2_linked_login} ao JOIN {context} ctx ON ctx.instanceid = ao.userid AND ctx.contextlevel = :contextlevel diff --git a/auth/shibboleth/classes/privacy/provider.php b/auth/shibboleth/classes/privacy/provider.php index 374e3257f38..8d4d9298976 100644 --- a/auth/shibboleth/classes/privacy/provider.php +++ b/auth/shibboleth/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/auth/webservice/classes/privacy/provider.php b/auth/webservice/classes/privacy/provider.php index 5fc6c042ecd..babcc53fcc5 100644 --- a/auth/webservice/classes/privacy/provider.php +++ b/auth/webservice/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/availability/classes/privacy/provider.php b/availability/classes/privacy/provider.php index bb8a3a7b73c..4c3a78f66c0 100644 --- a/availability/classes/privacy/provider.php +++ b/availability/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/availability/condition/completion/classes/privacy/provider.php b/availability/condition/completion/classes/privacy/provider.php index 7461d469ef4..2c7099d1ba9 100644 --- a/availability/condition/completion/classes/privacy/provider.php +++ b/availability/condition/completion/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/availability/condition/date/classes/privacy/provider.php b/availability/condition/date/classes/privacy/provider.php index 3e842c9d10b..9c2ed49b350 100644 --- a/availability/condition/date/classes/privacy/provider.php +++ b/availability/condition/date/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/availability/condition/grade/classes/privacy/provider.php b/availability/condition/grade/classes/privacy/provider.php index 8e6abc438c8..d1794dfabc4 100644 --- a/availability/condition/grade/classes/privacy/provider.php +++ b/availability/condition/grade/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/availability/condition/group/classes/privacy/provider.php b/availability/condition/group/classes/privacy/provider.php index 0fc0f698465..264de4a8c6c 100644 --- a/availability/condition/group/classes/privacy/provider.php +++ b/availability/condition/group/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/availability/condition/grouping/classes/privacy/provider.php b/availability/condition/grouping/classes/privacy/provider.php index 8e073de0a8c..d4833c265c3 100644 --- a/availability/condition/grouping/classes/privacy/provider.php +++ b/availability/condition/grouping/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/availability/condition/profile/classes/privacy/provider.php b/availability/condition/profile/classes/privacy/provider.php index 5f73f19600f..cc40d29008a 100644 --- a/availability/condition/profile/classes/privacy/provider.php +++ b/availability/condition/profile/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/availability/tests/fixtures/mock_info_module.php b/availability/tests/fixtures/mock_info_module.php index 47f75cc3fa7..5c13f3b864e 100644 --- a/availability/tests/fixtures/mock_info_module.php +++ b/availability/tests/fixtures/mock_info_module.php @@ -109,7 +109,7 @@ class mock_info_module extends info_module { * Override course-module info. * @param \cm_info $cm */ - public function set_cm (\cm_info $cm) { + public function set_cm(\cm_info $cm) { $this->cm = $cm; } } diff --git a/availability/tests/fixtures/mock_info_section.php b/availability/tests/fixtures/mock_info_section.php index 15fba4597c2..2dde1240622 100644 --- a/availability/tests/fixtures/mock_info_section.php +++ b/availability/tests/fixtures/mock_info_section.php @@ -110,7 +110,7 @@ class mock_info_section extends info_section { * * @param \section_info $section */ - public function set_section (\section_info $section) { + public function set_section(\section_info $section) { $this->section = $section; } } diff --git a/backup/cc/cc112moodle.php b/backup/cc/cc112moodle.php index faafa20d808..33972579b80 100644 --- a/backup/cc/cc112moodle.php +++ b/backup/cc/cc112moodle.php @@ -60,7 +60,7 @@ class cc112moodle extends cc2moodle { parent::__construct($path_to_manifest); } - public function generate_moodle_xml () { + public function generate_moodle_xml() { global $CFG; $cdir = static::$path_to_manifest_folder . DIRECTORY_SEPARATOR . 'course_files'; @@ -137,7 +137,7 @@ class cc112moodle extends cc2moodle { } - public function convert_to_moodle_type ($cc_type) { + public function convert_to_moodle_type($cc_type) { $type = parent::convert_to_moodle_type($cc_type); if ($type == TYPE_UNKNOWN) { @@ -149,7 +149,7 @@ class cc112moodle extends cc2moodle { return $type; } - protected function create_node_question_categories () { + protected function create_node_question_categories() { $quiz = new cc11_quiz(); @@ -160,7 +160,7 @@ class cc112moodle extends cc2moodle { return $node_course_question_categories; } - protected function create_code_info_details_mod () { + protected function create_code_info_details_mod() { $result = parent::create_code_info_details_mod(); $count_blti = $this->count_instances(MOODLE_TYPE_LTI); @@ -199,7 +199,7 @@ class cc112moodle extends cc2moodle { return $mod_visible; } - protected function create_node_course_modules_mod () { + protected function create_node_course_modules_mod() { $labels = new cc_label(); $resources = new cc11_resource(); $forums = new cc11_forum(); diff --git a/backup/cc/cc2moodle.php b/backup/cc/cc2moodle.php index 291611117ce..9ffcbe3352c 100644 --- a/backup/cc/cc2moodle.php +++ b/backup/cc/cc2moodle.php @@ -102,7 +102,7 @@ class cc2moodle { 'xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'cc' => 'http://www.imsglobal.org/xsd/imsccauth_v1p0'); - function __construct ($path_to_manifest) { + function __construct($path_to_manifest) { static::$manifest = new DOMDocument(); static::$manifest->validateOnParse = false; @@ -117,7 +117,7 @@ class cc2moodle { } } - public function is_auth () { + public function is_auth() { $xpath = static::newx_path(static::$manifest, static::$namespaces); @@ -132,7 +132,7 @@ class cc2moodle { return $response; } - protected function get_metadata ($section, $key) { + protected function get_metadata($section, $key) { $xpath = static::newx_path(static::$manifest, static::$namespaces); @@ -142,7 +142,7 @@ class cc2moodle { return $value; } - public function generate_moodle_xml () { + public function generate_moodle_xml() { global $CFG, $OUTPUT; @@ -221,7 +221,7 @@ class cc2moodle { } - protected function get_sections_numbers ($instances) { + protected function get_sections_numbers($instances) { $count = 0; @@ -236,7 +236,7 @@ class cc2moodle { return $count; } - protected function create_node_course_header () { + protected function create_node_course_header() { $node_course_header = ''; $sheet_course_header = static::loadsheet(SHEET_COURSE_HEADER); @@ -273,7 +273,7 @@ class cc2moodle { return $node_course_header; } - protected function create_node_question_categories () { + protected function create_node_question_categories() { $quiz = new cc_quiz(); @@ -284,7 +284,7 @@ class cc2moodle { return $node_course_question_categories; } - protected function create_node_course_modules_mod () { + protected function create_node_course_modules_mod() { $labels = new cc_label(); $resources = new cc_resource(); @@ -311,7 +311,7 @@ class cc2moodle { } - protected function create_node_course_sections_section () { + protected function create_node_course_sections_section() { static::log_action('Creating node: COURSE/SECTIONS/SECTION'); @@ -363,7 +363,7 @@ class cc2moodle { return $node_course_sections_section; } - protected function create_node_course_blocks_block () { + protected function create_node_course_blocks_block() { global $CFG; @@ -455,7 +455,7 @@ class cc2moodle { return $mod_visible; } - protected function create_node_course_sections_section_mods_mod ($root_parent) { + protected function create_node_course_sections_section_mods_mod($root_parent) { $sheet_course_sections_section_mods_mod = static::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD); $childs = $this->get_nodes_by_criteria('root_parent', $root_parent); @@ -512,7 +512,7 @@ class cc2moodle { } - public function get_nodes_by_criteria ($key, $value) { + public function get_nodes_by_criteria($key, $value) { $response = array(); @@ -528,7 +528,7 @@ class cc2moodle { } //Modified here - protected function create_code_info_details_mod () { + protected function create_code_info_details_mod() { static::log_action('Creating node: INFO/DETAILS/MOD'); @@ -568,7 +568,7 @@ class cc2moodle { } - protected function create_mod_info_details_mod ($mod_type, $node_info_details_mod_instances_instance) { + protected function create_mod_info_details_mod($mod_type, $node_info_details_mod_instances_instance) { $sheet_info_details_mod = static::loadsheet(SHEET_INFO_DETAILS_MOD); @@ -578,7 +578,7 @@ class cc2moodle { return str_replace($find_tags, $replace_values, $sheet_info_details_mod); } - protected function create_mod_info_details_mod_instances_instance ($sheet, $instances_quantity, $instances) { + protected function create_mod_info_details_mod_instances_instance($sheet, $instances_quantity, $instances) { $instance = ''; @@ -606,7 +606,7 @@ class cc2moodle { } - protected function create_instances ($items, $level = 0, &$array_index = 0, $index_root = 0) { + protected function create_instances($items, $level = 0, &$array_index = 0, $index_root = 0) { $level++; $i = 1; @@ -681,7 +681,7 @@ class cc2moodle { } } - public function count_instances ($type) { + public function count_instances($type) { $quantity = 0; @@ -702,7 +702,7 @@ class cc2moodle { return $quantity; } - public function convert_to_moodle_type ($cc_type) { + public function convert_to_moodle_type($cc_type) { $type = TYPE_UNKNOWN; if ($cc_type == static::CC_TYPE_FORUM) { @@ -736,7 +736,7 @@ class cc2moodle { return $type; } - public function get_item_cc_type ($identifier) { + public function get_item_cc_type($identifier) { $xpath = static::newx_path(static::$manifest, static::$namespaces); @@ -749,7 +749,7 @@ class cc2moodle { } } - public static function newx_path (DOMDocument $manifest, $namespaces = '') { + public static function newx_path(DOMDocument $manifest, $namespaces = '') { $xpath = new DOMXPath($manifest); @@ -764,7 +764,7 @@ class cc2moodle { return $xpath; } - public static function loadsheet ($file) { + public static function loadsheet($file) { $content = (is_readable($file) && ($content = file_get_contents($file))) ? $content : false; @@ -783,7 +783,7 @@ class cc2moodle { return static::$path_to_manifest_folder . DIRECTORY_SEPARATOR . 'cc2moodle.log'; } - public static function log_action ($text, $critical_error = false) { + public static function log_action($text, $critical_error = false) { $full_message = strtoupper(date("j/n/Y g:i:s a")) . " - " . $text . "\r"; @@ -794,7 +794,7 @@ class cc2moodle { } } - protected static function critical_error ($text) { + protected static function critical_error($text) { $path_to_log = static::log_file(); @@ -819,7 +819,7 @@ class cc2moodle { die(); } - protected function create_course_code ($title) { + protected function create_course_code($title) { //Making sure that text of the short name does not go over the DB limit. //and leaving the space to add additional characters by the platform $code = substr(strtoupper(str_replace(' ', '', trim($title))),0,94); diff --git a/backup/cc/cc_lib/cc_basiclti.php b/backup/cc/cc_lib/cc_basiclti.php index d31e0b886af..c44fb810286 100644 --- a/backup/cc/cc_lib/cc_basiclti.php +++ b/backup/cc/cc_lib/cc_basiclti.php @@ -60,45 +60,45 @@ class basicltil1_resurce_file extends general_cc_file { public function set_description($description) { $this->description = self::safexml($description); } - public function set_launch_url ($url) { + public function set_launch_url($url) { $this->launch_url = $url; } - public function set_secure_launch_url ($url) { + public function set_secure_launch_url($url) { $this->secure_launch_url = $url; } - public function set_launch_icon ($icon) { + public function set_launch_icon($icon) { $this->icon = $icon; } - public function set_secure_launch_icon ($icon) { + public function set_secure_launch_icon($icon) { $this->secure_icon = $icon; } - public function set_vendor_code ($code) { + public function set_vendor_code($code) { $this->vendor_code = $code; $this->vendor = true; } - public function set_vendor_name ($name) { + public function set_vendor_name($name) { $this->vendor_name = self::safexml($name); $this->vendor = true; } - public function set_vendor_description ($desc) { + public function set_vendor_description($desc) { $this->vendor_description = self::safexml($desc); $this->vendor = true; } - public function set_vendor_url ($url) { + public function set_vendor_url($url) { $this->vendor_url = $url; $this->vendor = true; } - public function set_vendor_contact ($email) { + public function set_vendor_contact($email) { $this->vendor_contact = array('email' => $email); $this->vendor = true; } - public function add_custom_property ($property, $value) { + public function add_custom_property($property, $value) { $this->custom_properties[$property] = $value; } - public function add_extension ($extension, $value) { + public function add_extension($extension, $value) { $this->extension_properties[$extension] = $value; } - public function set_extension_platform ($value) { + public function set_extension_platform($value) { $this->extension_platform = $value; } diff --git a/backup/cc/cc_lib/cc_interfaces.php b/backup/cc/cc_lib/cc_interfaces.php index 81feabdafd3..4345533f8c6 100644 --- a/backup/cc/cc_lib/cc_interfaces.php +++ b/backup/cc/cc_lib/cc_interfaces.php @@ -25,17 +25,17 @@ */ interface cc_i_manifest { - public function on_create (); - public function on_load (); - public function on_save (); - public function add_new_organization (cc_i_organization &$org); - public function get_resources (); - public function get_resource_list (); - public function add_resource (cc_i_resource $res, $identifier=null, $type='webcontent'); + public function on_create(); + public function on_load(); + public function on_save(); + public function add_new_organization(cc_i_organization &$org); + public function get_resources(); + public function get_resource_list(); + public function add_resource(cc_i_resource $res, $identifier=null, $type='webcontent'); public function add_metadata_manifest(cc_i_metadata_manifest $met); - public function add_metadata_resource (cc_i_metadata_resource $met,$identifier); - public function add_metadata_file (cc_i_metadata_file $met,$identifier,$filename); - public function put_nodes (); + public function add_metadata_resource(cc_i_metadata_resource $met,$identifier); + public function add_metadata_file(cc_i_metadata_file $met,$identifier,$filename); + public function put_nodes(); } @@ -46,10 +46,10 @@ interface cc_i_manifest { */ interface cc_i_organization { - public function add_item (cc_i_item &$item); - public function has_items (); - public function attr_value (&$nod, $name, $ns=null); - public function process_organization (&$node,&$doc); + public function add_item(cc_i_item &$item); + public function has_items(); + public function attr_value(&$nod, $name, $ns=null); + public function process_organization(&$node,&$doc); } @@ -60,11 +60,11 @@ interface cc_i_organization { */ interface cc_i_item { - public function add_child_item (cc_i_item &$item); - public function attach_resource ($res); // can be object or value - public function has_child_items (); - public function attr_value (&$nod, $name, $ns=null); - public function process_item (&$node,&$doc); + public function add_child_item(cc_i_item &$item); + public function attach_resource($res); // can be object or value + public function has_child_items(); + public function attr_value(&$nod, $name, $ns=null); + public function process_item(&$node,&$doc); } @@ -74,10 +74,10 @@ interface cc_i_item { */ interface cc_i_resource { - public function get_attr_value (&$nod, $name, $ns=null); - public function add_resource ($fname, $location=''); - public function import_resource (DOMElement &$node, cc_i_manifest &$doc); - public function process_resource ($manifestroot, &$fname,$folder); + public function get_attr_value(&$nod, $name, $ns=null); + public function add_resource($fname, $location=''); + public function import_resource(DOMElement &$node, cc_i_manifest &$doc); + public function process_resource($manifestroot, &$fname,$folder); } diff --git a/backup/cc/cc_lib/cc_metadata.php b/backup/cc/cc_lib/cc_metadata.php index 6020b9055c3..5a624aee1cf 100644 --- a/backup/cc/cc_lib/cc_metadata.php +++ b/backup/cc/cc_lib/cc_metadata.php @@ -81,10 +81,10 @@ class language_lom { class cc_metadata_manifest implements cc_i_metadata_manifest { - public $arraygeneral = array(); - public $arraytech = array(); - public $arrayrights = array(); - public $arraylifecycle = array(); + public $arraygeneral = array(); + public $arraytech = array(); + public $arrayrights = array(); + public $arraylifecycle = array(); public function add_metadata_general($obj){ @@ -168,7 +168,7 @@ class cc_metadata_rights { public function set_copyright($copy){ $this->copyright[] = array($copy); } - public function set_description ($des,$language){ + public function set_description($des,$language){ $this->description[] = array($language,$des); } public function set_cost($cost){ @@ -184,7 +184,7 @@ class cc_metadata_rights { */ class cc_metadata_technical { - public $format = array(); + public $format = array(); public function set_format($format){ @@ -200,35 +200,35 @@ class cc_metadata_technical { */ class cc_metadata_general { - public $title = array(); - public $language = array(); - public $description = array(); - public $keyword = array(); - public $coverage = array(); - public $catalog = array(); - public $entry = array(); + public $title = array(); + public $language = array(); + public $description = array(); + public $keyword = array(); + public $coverage = array(); + public $catalog = array(); + public $entry = array(); - public function set_coverage ($coverage,$language){ + public function set_coverage($coverage,$language){ $this->coverage[] = array($language,$coverage); } - public function set_description ($description,$language){ + public function set_description($description,$language){ $this->description[] = array($language,$description); } - public function set_keyword ($keyword,$language){ + public function set_keyword($keyword,$language){ $this->keyword[] = array($language,$keyword); } - public function set_language ($language){ + public function set_language($language){ $this->language[] = array($language); } - public function set_title ($title,$language){ + public function set_title($title,$language){ $this->title[] = array($language,$title); } - public function set_catalog ($cat){ + public function set_catalog($cat){ $this->catalog[] = array($cat); } - public function set_entry ($entry){ + public function set_entry($entry){ $this->entry[] = array($entry); } diff --git a/backup/cc/cc_lib/cc_metadata_file.php b/backup/cc/cc_lib/cc_metadata_file.php index 525a32bb9ca..ad116cbea3a 100644 --- a/backup/cc/cc_lib/cc_metadata_file.php +++ b/backup/cc/cc_lib/cc_metadata_file.php @@ -32,7 +32,7 @@ class cc_metadata_file_educational{ public $value = array(); - public function set_value ($value){ + public function set_value($value){ $arr = array($value); $this->value[] = $arr; } diff --git a/backup/cc/cc_lib/cc_metadata_resource.php b/backup/cc/cc_lib/cc_metadata_resource.php index b575beffef1..80411d838f3 100644 --- a/backup/cc/cc_lib/cc_metadata_resource.php +++ b/backup/cc/cc_lib/cc_metadata_resource.php @@ -34,7 +34,7 @@ class cc_metadata_resouce_educational{ public $value = array(); - public function set_value ($value){ + public function set_value($value){ $arr = array($value); $this->value[] = $arr; } diff --git a/backup/cc/cc_lib/cc_organization.php b/backup/cc/cc_lib/cc_organization.php index ecaa4558028..7e1879e05e5 100644 --- a/backup/cc/cc_lib/cc_organization.php +++ b/backup/cc/cc_lib/cc_organization.php @@ -35,12 +35,12 @@ require_once 'cc_manifest.php'; class cc_organization implements cc_i_organization { - public $title = null; - public $identifier = null; - public $structure = null; - public $itemlist = null; - private $metadata = null; - private $sequencing = null; + public $title = null; + public $identifier = null; + public $structure = null; + public $itemlist = null; + private $metadata = null; + private $sequencing = null; /** @var bool true if empty, otherwise false. */ protected $isempty; @@ -132,12 +132,12 @@ class cc_organization implements cc_i_organization { class cc_item implements cc_i_item { - public $identifier = null; - public $identifierref = null; - public $isvisible = null; - public $title = null; - public $parameters = null; - public $childitems = null; + public $identifier = null; + public $identifierref = null; + public $isvisible = null; + public $title = null; + public $parameters = null; + public $childitems = null; private $parentItem = null; private $isempty = true; diff --git a/backup/cc/cc_lib/cc_resources.php b/backup/cc/cc_lib/cc_resources.php index d03ba251830..8b385707c5b 100644 --- a/backup/cc/cc_lib/cc_resources.php +++ b/backup/cc/cc_lib/cc_resources.php @@ -116,7 +116,7 @@ class cc_resource implements cc_i_resource { * @param string $fname * @param string $location */ - public function add_resource ($fname, $location ='') { + public function add_resource($fname, $location ='') { $this->process_resource($fname, $location, null); } diff --git a/backup/cc/entities.class.php b/backup/cc/entities.class.php index 712b84f7871..ebf1163487c 100644 --- a/backup/cc/entities.class.php +++ b/backup/cc/entities.class.php @@ -154,7 +154,7 @@ class entities { return $result; } - public function include_titles ($html) { + public function include_titles($html) { $document = $this->load_html($html); @@ -181,7 +181,7 @@ class entities { return $html; } - public function get_external_xml ($identifier) { + public function get_external_xml($identifier) { $xpath = cc2moodle::newx_path(cc2moodle::$manifest, cc2moodle::$namespaces); @@ -227,7 +227,7 @@ class entities { } } - protected function get_all_files () { + protected function get_all_files() { global $CFG; $all_files = array(); @@ -316,7 +316,7 @@ class entities { return $html; } - public function generate_random_string ($length = 6) { + public function generate_random_string($length = 6) { $response = ''; $source = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; diff --git a/backup/cc/entities11.class.php b/backup/cc/entities11.class.php index b5b2f782c99..73d93061140 100644 --- a/backup/cc/entities11.class.php +++ b/backup/cc/entities11.class.php @@ -34,7 +34,7 @@ class entities11 extends entities { return $response; } - protected function get_all_files () { + protected function get_all_files() { global $CFG; $all_files = array(); $xpath = cc2moodle::newx_path(cc112moodle::$manifest, cc112moodle::$namespaces); diff --git a/backup/cc/entity.forum.class.php b/backup/cc/entity.forum.class.php index 3e652ab7420..b51fcbeea91 100644 --- a/backup/cc/entity.forum.class.php +++ b/backup/cc/entity.forum.class.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc_forum extends entities { - public function full_path ($path, $dir_sep = DIRECTORY_SEPARATOR) { + public function full_path($path, $dir_sep = DIRECTORY_SEPARATOR) { $token = '$IMS-CC-FILEBASE$'; $path = str_replace($token, '', $path); @@ -68,7 +68,7 @@ class cc_forum extends entities { return $result; } - public function generate_node () { + public function generate_node() { cc2moodle::log_action('Creating Forum mods'); @@ -83,7 +83,7 @@ class cc_forum extends entities { return $response; } - private function create_node_course_modules_mod_forum ($instance) { + private function create_node_course_modules_mod_forum($instance) { $sheet_mod_forum = cc2moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_FORUM); @@ -110,7 +110,7 @@ class cc_forum extends entities { return $result; } - public function get_topic_data ($instance) { + public function get_topic_data($instance) { $topic_data = array(); @@ -156,7 +156,7 @@ class cc_forum extends entities { return $topic_data; } - private function generate_attachment_html ($filename) { + private function generate_attachment_html($filename) { $images_extensions = array('gif' , 'jpeg' , 'jpg' , 'jif' , 'jfif' , 'png' , 'bmp'); diff --git a/backup/cc/entity.label.class.php b/backup/cc/entity.label.class.php index e8dfe82efcb..ff08a8f190a 100644 --- a/backup/cc/entity.label.class.php +++ b/backup/cc/entity.label.class.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc_label extends entities { - public function generate_node () { + public function generate_node() { cc2moodle::log_action('Creating Labels mods'); @@ -41,7 +41,7 @@ class cc_label extends entities { return $response; } - private function create_node_course_modules_mod_label ($sheet_mod_label, $instance) { + private function create_node_course_modules_mod_label($sheet_mod_label, $instance) { if ($instance['deep'] <= ROOT_DEEP) { return ''; } diff --git a/backup/cc/entity.quiz.class.php b/backup/cc/entity.quiz.class.php index af384309af4..d7e1dfa173d 100644 --- a/backup/cc/entity.quiz.class.php +++ b/backup/cc/entity.quiz.class.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc_quiz extends entities { - public function generate_node_question_categories () { + public function generate_node_question_categories() { $instances = $this->generate_instances(); @@ -36,7 +36,7 @@ class cc_quiz extends entities { } - public function generate_node_course_modules_mod () { + public function generate_node_course_modules_mod() { cc2moodle::log_action('Creating Quiz mods'); @@ -55,14 +55,14 @@ class cc_quiz extends entities { } - private function create_node_course_modules_mod_quiz_feedback () { + private function create_node_course_modules_mod_quiz_feedback() { $sheet_question_mod_feedback = cc2moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ_FEEDBACK); return $sheet_question_mod_feedback; } - private function generate_instances () { + private function generate_instances() { $last_instance_id = 0; $last_question_id = 0; @@ -124,7 +124,7 @@ class cc_quiz extends entities { } - private function create_node_course_modules_mod ($instance) { + private function create_node_course_modules_mod($instance) { $sheet_question_mod = cc2moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ); @@ -161,7 +161,7 @@ class cc_quiz extends entities { return $node_question_mod; } - private function get_global_config ($assessment, $option, $default_value, $replace_values = '') { + private function get_global_config($assessment, $option, $default_value, $replace_values = '') { $xpath = cc2moodle::newx_path($assessment, cc2moodle::getquizns()); $metadata = $xpath->query('/xmlns:questestinterop/xmlns:assessment/xmlns:qtimetadata/xmlns:qtimetadatafield'); @@ -189,7 +189,7 @@ class cc_quiz extends entities { return $response; } - private function create_node_course_modules_mod_quiz_question_instances ($instance) { + private function create_node_course_modules_mod_quiz_question_instances($instance) { $node_course_module_mod_quiz_questions_instances = ''; $sheet_question_mod_instance = cc2moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ_QUESTION_INSTANCE); @@ -213,7 +213,7 @@ class cc_quiz extends entities { return $node_course_module_mod_quiz_questions_instances; } - private function get_questions_string ($instance) { + private function get_questions_string($instance) { $questions_string = ''; @@ -252,7 +252,7 @@ class cc_quiz extends entities { return $node_course_question_categories; } - private function create_node_course_question_categories_question_category ($instance) { + private function create_node_course_question_categories_question_category($instance) { $sheet_question_categories_quetion_category = cc2moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY); @@ -278,7 +278,7 @@ class cc_quiz extends entities { return $node_question_categories; } - private function create_node_course_question_categories_question_category_question ($instance) { + private function create_node_course_question_categories_question_category_question($instance) { global $USER; @@ -338,7 +338,7 @@ class cc_quiz extends entities { return $node_course_question_categories_question; } - private function get_questions ($assessment, &$last_question_id, &$last_answer_id, $root_path, $is_question_bank) { + private function get_questions($assessment, &$last_question_id, &$last_answer_id, $root_path, $is_question_bank) { $questions = array(); @@ -395,7 +395,7 @@ class cc_quiz extends entities { return $questions; } - private function str_replace_once ($search, $replace, $subject) { + private function str_replace_once($search, $replace, $subject) { $first_char = strpos($subject, $search); @@ -426,7 +426,7 @@ class cc_quiz extends entities { return $result; } - private function get_general_feedback ($assessment, $question_identifier) { + private function get_general_feedback($assessment, $question_identifier) { $xpath = cc2moodle::newx_path($assessment, cc2moodle::getquizns()); @@ -471,7 +471,7 @@ class cc_quiz extends entities { return $feedback; } - private function get_feedback ($assessment, $identifier, $item_identifier, $question_type) { + private function get_feedback($assessment, $identifier, $item_identifier, $question_type) { $xpath = cc2moodle::newx_path($assessment, cc2moodle::getquizns()); @@ -516,7 +516,7 @@ class cc_quiz extends entities { return $feedback; } - private function get_answers_fib ($question_identifier, $identifier, $assessment, &$last_answer_id) { + private function get_answers_fib($question_identifier, $identifier, $assessment, &$last_answer_id) { $xpath = cc2moodle::newx_path($assessment, cc2moodle::getquizns()); @@ -582,7 +582,7 @@ class cc_quiz extends entities { return $answers_fib; } - private function get_answers_pattern_match ($question_identifier, $identifier, $assessment, &$last_answer_id) { + private function get_answers_pattern_match($question_identifier, $identifier, $assessment, &$last_answer_id) { $xpath = cc2moodle::newx_path($assessment, cc2moodle::getquizns()); @@ -658,7 +658,7 @@ class cc_quiz extends entities { } - private function get_answers ($identifier, $assessment, &$last_answer_id) { + private function get_answers($identifier, $assessment, &$last_answer_id) { $xpath = cc2moodle::newx_path($assessment, cc2moodle::getquizns()); @@ -764,7 +764,7 @@ class cc_quiz extends entities { } - private function get_score ($assessment, $identifier, $question_identifier) { + private function get_score($assessment, $identifier, $question_identifier) { $xpath = cc2moodle::newx_path($assessment, cc2moodle::getquizns()); @@ -792,7 +792,7 @@ class cc_quiz extends entities { return $score; } - private function create_node_course_question_categories_question_category_question_multiple_choice ($question) { + private function create_node_course_question_categories_question_category_question_multiple_choice($question) { $node_course_question_categories_question_answer = ''; $sheet_question_categories_question = cc2moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_MULTIPLE_CHOICE); @@ -820,7 +820,7 @@ class cc_quiz extends entities { return $node_question_categories_question; } - private function create_node_course_question_categories_question_category_question_eesay ($question) { + private function create_node_course_question_categories_question_category_question_eesay($question) { $node_course_question_categories_question_answer = ''; @@ -840,7 +840,7 @@ class cc_quiz extends entities { return $node_question_categories_question; } - private function create_node_course_question_categories_question_category_question_shortanswer ($question) { //, &$fib_questions) { + private function create_node_course_question_categories_question_category_question_shortanswer($question) { //, &$fib_questions) { $sheet_question_categories_question = cc2moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_SHORTANSWER); $node_course_question_categories_question_answer = ''; @@ -879,7 +879,7 @@ class cc_quiz extends entities { } - private function create_node_course_question_categories_question_category_question_true_false ($question) { + private function create_node_course_question_categories_question_category_question_true_false($question) { $node_course_question_categories_question_answer = ''; @@ -925,7 +925,7 @@ class cc_quiz extends entities { return $node_question_categories_question; } - private function get_answers_string ($answers) { + private function get_answers_string($answers) { $answer_string = ''; @@ -941,7 +941,7 @@ class cc_quiz extends entities { } - private function create_node_course_question_categories_question_category_question_answer ($answer) { + private function create_node_course_question_categories_question_category_question_answer($answer) { $sheet_question_categories_question_answer = cc2moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_ANSWER); @@ -960,7 +960,7 @@ class cc_quiz extends entities { return $node_question_categories_question_answer; } - private function get_question_type ($identifier, $assessment) { + private function get_question_type($identifier, $assessment) { $xpath = cc2moodle::newx_path($assessment, cc2moodle::getquizns()); diff --git a/backup/cc/entity.resource.class.php b/backup/cc/entity.resource.class.php index 6de81164296..b4ecf6c704c 100644 --- a/backup/cc/entity.resource.class.php +++ b/backup/cc/entity.resource.class.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc_resource extends entities { - public function generate_node () { + public function generate_node() { cc2moodle::log_action('Creating Resource mods'); @@ -42,7 +42,7 @@ class cc_resource extends entities { } - private function create_node_course_modules_mod_resource ($sheet_mod_resource, $instance) { + private function create_node_course_modules_mod_resource($sheet_mod_resource, $instance) { global $CFG; require_once($CFG->libdir.'/validateurlsyntax.php'); diff --git a/backup/cc/entity11.basiclti.class.php b/backup/cc/entity11.basiclti.class.php index 74770d1324a..d1f8a490e74 100644 --- a/backup/cc/entity11.basiclti.class.php +++ b/backup/cc/entity11.basiclti.class.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc11_basiclti extends entities11 { - public function generate_node () { + public function generate_node() { cc2moodle::log_action('Creating BasicLTI mods'); @@ -40,7 +40,7 @@ class cc11_basiclti extends entities11 { return $response; } - private function create_node_course_modules_mod_basiclti ($instance) { + private function create_node_course_modules_mod_basiclti($instance) { $sheet_mod_basiclti = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_BASICLTI); diff --git a/backup/cc/entity11.forum.class.php b/backup/cc/entity11.forum.class.php index 275d33023ff..988b8fd8db2 100644 --- a/backup/cc/entity11.forum.class.php +++ b/backup/cc/entity11.forum.class.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc11_forum extends entities11 { - public function full_path ($path, $dir_sep = DIRECTORY_SEPARATOR) { + public function full_path($path, $dir_sep = DIRECTORY_SEPARATOR) { $token = '$IMS-CC-FILEBASE$'; $path = str_replace($token, '', $path); @@ -67,7 +67,7 @@ class cc11_forum extends entities11 { return $result; } - public function generate_node () { + public function generate_node() { cc2moodle::log_action('Creating Forum mods'); @@ -82,7 +82,7 @@ class cc11_forum extends entities11 { return $response; } - private function create_node_course_modules_mod_forum ($instance) { + private function create_node_course_modules_mod_forum($instance) { $sheet_mod_forum = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_FORUM); @@ -109,7 +109,7 @@ class cc11_forum extends entities11 { return $result; } - public function get_topic_data ($instance) { + public function get_topic_data($instance) { $topic_data = array(); @@ -159,7 +159,7 @@ class cc11_forum extends entities11 { return $topic_data; } - private function generate_attachment_html ($filename) { + private function generate_attachment_html($filename) { $images_extensions = array('gif' , 'jpeg' , 'jpg' , 'jif' , 'jfif' , 'png' , 'bmp'); diff --git a/backup/cc/entity11.lti.class.php b/backup/cc/entity11.lti.class.php index 67ab43e6b5a..823536de962 100644 --- a/backup/cc/entity11.lti.class.php +++ b/backup/cc/entity11.lti.class.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc11_lti extends entities11 { - public function generate_node () { + public function generate_node() { cc2moodle::log_action('Creating BasicLTI mods'); @@ -39,7 +39,7 @@ class cc11_lti extends entities11 { return $response; } - private function create_node_course_modules_mod_basiclti ($instance) { + private function create_node_course_modules_mod_basiclti($instance) { $sheet_mod_basiclti = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_LTI); diff --git a/backup/cc/entity11.quiz.class.php b/backup/cc/entity11.quiz.class.php index c2048e0dee3..5fec33b824d 100644 --- a/backup/cc/entity11.quiz.class.php +++ b/backup/cc/entity11.quiz.class.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc11_quiz extends entities11 { - public function generate_node_question_categories () { + public function generate_node_question_categories() { $instances = $this->generate_instances(); @@ -36,7 +36,7 @@ class cc11_quiz extends entities11 { } - public function generate_node_course_modules_mod () { + public function generate_node_course_modules_mod() { cc112moodle::log_action('Creating Quiz mods'); @@ -55,14 +55,14 @@ class cc11_quiz extends entities11 { } - private function create_node_course_modules_mod_quiz_feedback () { + private function create_node_course_modules_mod_quiz_feedback() { $sheet_question_mod_feedback = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ_FEEDBACK); return $sheet_question_mod_feedback; } - private function generate_instances () { + private function generate_instances() { $last_instance_id = 0; $last_question_id = 0; @@ -118,7 +118,7 @@ class cc11_quiz extends entities11 { } - private function create_node_course_modules_mod ($instance) { + private function create_node_course_modules_mod($instance) { $sheet_question_mod = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ); @@ -155,7 +155,7 @@ class cc11_quiz extends entities11 { return $node_question_mod; } - private function get_global_config ($assessment, $option, $default_value, $replace_values = '') { + private function get_global_config($assessment, $option, $default_value, $replace_values = '') { $xpath = cc112moodle::newx_path($assessment, cc112moodle::getquizns()); $metadata = $xpath->query('/xmlns:questestinterop/xmlns:assessment/xmlns:qtimetadata/xmlns:qtimetadatafield'); @@ -183,7 +183,7 @@ class cc11_quiz extends entities11 { return $response; } - private function create_node_course_modules_mod_quiz_question_instances ($instance) { + private function create_node_course_modules_mod_quiz_question_instances($instance) { $node_course_module_mod_quiz_questions_instances = ''; $sheet_question_mod_instance = cc112moodle::loadsheet(SHEET_COURSE_SECTIONS_SECTION_MODS_MOD_QUIZ_QUESTION_INSTANCE); @@ -203,7 +203,7 @@ class cc11_quiz extends entities11 { return $node_course_module_mod_quiz_questions_instances; } - private function get_questions_string ($instance) { + private function get_questions_string($instance) { $questions_string = ''; @@ -218,7 +218,7 @@ class cc11_quiz extends entities11 { return $questions_string; } - private function create_node_course_question_categories ($instances) { + private function create_node_course_question_categories($instances) { $sheet_question_categories = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES); @@ -241,7 +241,7 @@ class cc11_quiz extends entities11 { return $node_course_question_categories; } - private function create_node_course_question_categories_question_category ($instance) { + private function create_node_course_question_categories_question_category($instance) { $sheet_question_categories_quetion_category = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY); @@ -265,7 +265,7 @@ class cc11_quiz extends entities11 { return $node_question_categories; } - private function create_node_course_question_categories_question_category_question ($instance) { + private function create_node_course_question_categories_question_category_question($instance) { global $USER; @@ -326,7 +326,7 @@ class cc11_quiz extends entities11 { return $node_course_question_categories_question; } - private function get_questions ($assessment, &$last_question_id, &$last_answer_id, $root_path, $is_question_bank) { + private function get_questions($assessment, &$last_question_id, &$last_answer_id, $root_path, $is_question_bank) { $questions = array(); @@ -388,7 +388,7 @@ class cc11_quiz extends entities11 { return $questions; } - private function str_replace_once ($search, $replace, $subject) { + private function str_replace_once($search, $replace, $subject) { $first_char = strpos($subject, $search); @@ -419,7 +419,7 @@ class cc11_quiz extends entities11 { return $result; } - private function get_general_feedback ($assessment, $question_identifier) { + private function get_general_feedback($assessment, $question_identifier) { $xpath = cc112moodle::newx_path($assessment, cc112moodle::getquizns()); @@ -464,7 +464,7 @@ class cc11_quiz extends entities11 { return $feedback; } - private function get_feedback ($assessment, $identifier, $item_identifier, $question_type) { + private function get_feedback($assessment, $identifier, $item_identifier, $question_type) { $xpath = cc112moodle::newx_path($assessment, cc112moodle::getquizns()); @@ -509,7 +509,7 @@ class cc11_quiz extends entities11 { return $feedback; } - private function get_answers_fib ($question_identifier, $identifier, $assessment, &$last_answer_id) { + private function get_answers_fib($question_identifier, $identifier, $assessment, &$last_answer_id) { $xpath = cc112moodle::newx_path($assessment, cc112moodle::getquizns()); @@ -602,7 +602,7 @@ class cc11_quiz extends entities11 { return $answers_fib; } - private function get_answers_pattern_match ($question_identifier, $identifier, $assessment, &$last_answer_id) { + private function get_answers_pattern_match($question_identifier, $identifier, $assessment, &$last_answer_id) { $xpath = cc112moodle::newx_path($assessment, cc112moodle::getquizns()); @@ -678,7 +678,7 @@ class cc11_quiz extends entities11 { } - private function get_answers ($identifier, $assessment, &$last_answer_id) { + private function get_answers($identifier, $assessment, &$last_answer_id) { $xpath = cc112moodle::newx_path($assessment, cc112moodle::getquizns()); @@ -786,7 +786,7 @@ class cc11_quiz extends entities11 { } - private function get_score ($assessment, $identifier, $question_identifier) { + private function get_score($assessment, $identifier, $question_identifier) { $xpath = cc112moodle::newx_path($assessment, cc112moodle::getquizns()); @@ -815,7 +815,7 @@ class cc11_quiz extends entities11 { return $score; } - private function create_node_course_question_categories_question_category_question_multiple_choice ($question) { + private function create_node_course_question_categories_question_category_question_multiple_choice($question) { $node_course_question_categories_question_answer = ''; $sheet_question_categories_question = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_MULTIPLE_CHOICE); @@ -843,7 +843,7 @@ class cc11_quiz extends entities11 { return $node_question_categories_question; } - private function create_node_course_question_categories_question_category_question_eesay ($question) { + private function create_node_course_question_categories_question_category_question_eesay($question) { $node_course_question_categories_question_answer = ''; @@ -863,7 +863,7 @@ class cc11_quiz extends entities11 { return $node_question_categories_question; } - private function create_node_course_question_categories_question_category_question_shortanswer ($question) { //, &$fib_questions) { + private function create_node_course_question_categories_question_category_question_shortanswer($question) { //, &$fib_questions) { $sheet_question_categories_question = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_SHORTANSWER); $node_course_question_categories_question_answer = ''; @@ -902,7 +902,7 @@ class cc11_quiz extends entities11 { } - private function create_node_course_question_categories_question_category_question_true_false ($question) { + private function create_node_course_question_categories_question_category_question_true_false($question) { $node_course_question_categories_question_answer = ''; @@ -948,7 +948,7 @@ class cc11_quiz extends entities11 { return $node_question_categories_question; } - private function get_answers_string ($answers) { + private function get_answers_string($answers) { $answer_string = ''; @@ -964,7 +964,7 @@ class cc11_quiz extends entities11 { } - private function create_node_course_question_categories_question_category_question_answer ($answer) { + private function create_node_course_question_categories_question_category_question_answer($answer) { $sheet_question_categories_question_answer = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_ANSWER); @@ -983,7 +983,7 @@ class cc11_quiz extends entities11 { return $node_question_categories_question_answer; } - private function get_question_type ($identifier, $assessment) { + private function get_question_type($identifier, $assessment) { $xpath = cc112moodle::newx_path($assessment, cc112moodle::getquizns()); diff --git a/backup/cc/entity11.resource.class.php b/backup/cc/entity11.resource.class.php index 7bb6da78d02..17e5030a5b3 100644 --- a/backup/cc/entity11.resource.class.php +++ b/backup/cc/entity11.resource.class.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); class cc11_resource extends entities11 { - public function generate_node () { + public function generate_node() { cc112moodle::log_action('Creating Resource mods'); @@ -42,7 +42,7 @@ class cc11_resource extends entities11 { } - private function create_node_course_modules_mod_resource ($sheet_mod_resource, $instance) { + private function create_node_course_modules_mod_resource($sheet_mod_resource, $instance) { global $CFG; require_once($CFG->libdir.'/validateurlsyntax.php'); diff --git a/backup/cc/validator.php b/backup/cc/validator.php index 510a403cb57..22d20a06611 100644 --- a/backup/cc/validator.php +++ b/backup/cc/validator.php @@ -121,7 +121,7 @@ final class libxml_errors_mgr { libxml_clear_errors(); } - private function collect_errors ($filename=''){ + private function collect_errors($filename=''){ $errors = libxml_get_errors(); static $error_types = array( LIBXML_ERR_ERROR => 'Error' diff --git a/backup/controller/backup_controller.class.php b/backup/controller/backup_controller.class.php index b342c13685e..8fb30a78257 100644 --- a/backup/controller/backup_controller.class.php +++ b/backup/controller/backup_controller.class.php @@ -380,7 +380,7 @@ class backup_controller extends base_controller { * @return bool * @throws dml_exception */ - protected function get_include_files_default() : bool { + protected function get_include_files_default(): bool { // We normally include files. $includefiles = true; diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 27dc0c946f0..71e27982fe2 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -2024,7 +2024,7 @@ class restore_course_structure_step extends restore_structure_step { * @throws base_step_exception * @throws dml_exception */ - public function process_course_format_option(array $data) : void { + public function process_course_format_option(array $data): void { global $DB; if ($data['sectionid']) { diff --git a/backup/util/helper/backup_helper.class.php b/backup/util/helper/backup_helper.class.php index 1334792bb0e..093ba9f2ed2 100644 --- a/backup/util/helper/backup_helper.class.php +++ b/backup/util/helper/backup_helper.class.php @@ -386,7 +386,7 @@ abstract class backup_helper { * * @param string $current The current course reuse option where the header is modified */ - public static function print_coursereuse_selector(string $current):void { + public static function print_coursereuse_selector(string $current): void { global $OUTPUT, $PAGE; if ($coursereusenode = $PAGE->settingsnav->find('coursereuse', \navigation_node::TYPE_CONTAINER)) { diff --git a/backup/util/ui/classes/privacy/provider.php b/backup/util/ui/classes/privacy/provider.php index e4893e69a17..b9f97407252 100644 --- a/backup/util/ui/classes/privacy/provider.php +++ b/backup/util/ui/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @param collection $items a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { $items->link_external_location( 'Backup', [ @@ -83,7 +83,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); $sql = "SELECT ctx.id diff --git a/backup/util/ui/renderer.php b/backup/util/ui/renderer.php index fc15f0c8efa..2ff449f015c 100644 --- a/backup/util/ui/renderer.php +++ b/backup/util/ui/renderer.php @@ -1036,7 +1036,7 @@ class core_backup_renderer extends plugin_renderer_base { * @param \context $context The Moodle context for these restores. * @return string $html The table HTML. */ - public function restore_progress_viewer ($userid, $context) { + public function restore_progress_viewer($userid, $context) { $tablehead = array(get_string('course'), get_string('time'), get_string('status', 'backup')); $table = new html_table(); diff --git a/badges/classes/assertion.php b/badges/classes/assertion.php index 1fc9d48c105..9a54c1300c9 100644 --- a/badges/classes/assertion.php +++ b/badges/classes/assertion.php @@ -336,7 +336,7 @@ class core_badges_assertion { * @param array $json for assertion, badges, issuer. * @param string $type Content type. */ - protected function embed_data_badge_version2 (&$json, $type = OPEN_BADGES_V2_TYPE_ASSERTION) { + protected function embed_data_badge_version2(&$json, $type = OPEN_BADGES_V2_TYPE_ASSERTION) { // Specification Version 2.0. if ($this->_obversion >= OPEN_BADGES_V2) { $badge = new badge($this->_data->id); diff --git a/badges/classes/privacy/provider.php b/badges/classes/privacy/provider.php index 06dfd7a862d..826995be3fb 100644 --- a/badges/classes/privacy/provider.php +++ b/badges/classes/privacy/provider.php @@ -62,7 +62,7 @@ class provider implements * @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('badge', [ 'usercreated' => 'privacy:metadata:badge:usercreated', @@ -122,7 +122,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $contextlist = new \core_privacy\local\request\contextlist(); // Find the modifications we made on badges (course & system). diff --git a/blocks/accessreview/classes/privacy/provider.php b/blocks/accessreview/classes/privacy/provider.php index 7ccfd5ae3bb..807b4300993 100644 --- a/blocks/accessreview/classes/privacy/provider.php +++ b/blocks/accessreview/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @param collection $items The initialised item collection to add items to. * @return collection A listing of user data stored through this system. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { $items->add_user_preference(self::TOGGLE_STATE, 'privacy:metadata:preference:block_accessreviewtogglestate'); return $items; } diff --git a/blocks/activity_modules/classes/privacy/provider.php b/blocks/activity_modules/classes/privacy/provider.php index 7f8b3154624..b92600e1e54 100644 --- a/blocks/activity_modules/classes/privacy/provider.php +++ b/blocks/activity_modules/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/activity_results/classes/privacy/provider.php b/blocks/activity_results/classes/privacy/provider.php index d68134e0663..0d731330c58 100644 --- a/blocks/activity_results/classes/privacy/provider.php +++ b/blocks/activity_results/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/admin_bookmarks/classes/privacy/provider.php b/blocks/admin_bookmarks/classes/privacy/provider.php index ac5ef870cd3..a3d015b66c9 100644 --- a/blocks/admin_bookmarks/classes/privacy/provider.php +++ b/blocks/admin_bookmarks/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/badges/classes/privacy/provider.php b/blocks/badges/classes/privacy/provider.php index bf9721c22ad..7b33bebf66f 100644 --- a/blocks/badges/classes/privacy/provider.php +++ b/blocks/badges/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/blog_menu/classes/privacy/provider.php b/blocks/blog_menu/classes/privacy/provider.php index 8850872cdad..b88f9ff443d 100644 --- a/blocks/blog_menu/classes/privacy/provider.php +++ b/blocks/blog_menu/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/blog_recent/classes/privacy/provider.php b/blocks/blog_recent/classes/privacy/provider.php index 2b33898e8ca..0d691bad393 100644 --- a/blocks/blog_recent/classes/privacy/provider.php +++ b/blocks/blog_recent/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/blog_tags/classes/privacy/provider.php b/blocks/blog_tags/classes/privacy/provider.php index 8235cd8b9b4..a5fc2281d52 100644 --- a/blocks/blog_tags/classes/privacy/provider.php +++ b/blocks/blog_tags/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/calendar_month/classes/privacy/provider.php b/blocks/calendar_month/classes/privacy/provider.php index 0ff00af3dc3..0ce71844419 100644 --- a/blocks/calendar_month/classes/privacy/provider.php +++ b/blocks/calendar_month/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/calendar_upcoming/classes/privacy/provider.php b/blocks/calendar_upcoming/classes/privacy/provider.php index ae4f01a5fe5..ac06a1c2830 100644 --- a/blocks/calendar_upcoming/classes/privacy/provider.php +++ b/blocks/calendar_upcoming/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/classes/privacy/provider.php b/blocks/classes/privacy/provider.php index d756dac67fe..59bd28a4c38 100644 --- a/blocks/classes/privacy/provider.php +++ b/blocks/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @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_user_preference('blockIDhidden', 'privacy:metadata:userpref:hiddenblock'); $collection->add_user_preference('docked_block_instance_ID', 'privacy:metadata:userpref:dockedinstance'); return $collection; @@ -65,7 +65,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { global $DB; $contextlist = new \core_privacy\local\request\contextlist(); diff --git a/blocks/comments/classes/privacy/provider.php b/blocks/comments/classes/privacy/provider.php index 6a0ee2ebc62..0bcba9e0951 100644 --- a/blocks/comments/classes/privacy/provider.php +++ b/blocks/comments/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @param collection $collection * @return collection */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { return $collection->add_subsystem_link('core_comment', [], 'privacy:metadata:core_comment'); } @@ -62,7 +62,7 @@ class provider implements * @param int $userid * @return contextlist */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); $sql = "SELECT contextid diff --git a/blocks/completionstatus/classes/privacy/provider.php b/blocks/completionstatus/classes/privacy/provider.php index 97fd398ee26..fa069ee0e86 100644 --- a/blocks/completionstatus/classes/privacy/provider.php +++ b/blocks/completionstatus/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/course_list/classes/privacy/provider.php b/blocks/course_list/classes/privacy/provider.php index 37066fd8844..7599b74af1b 100644 --- a/blocks/course_list/classes/privacy/provider.php +++ b/blocks/course_list/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/course_summary/classes/privacy/provider.php b/blocks/course_summary/classes/privacy/provider.php index 4023e49103d..9896d8112ff 100644 --- a/blocks/course_summary/classes/privacy/provider.php +++ b/blocks/course_summary/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/feedback/classes/privacy/provider.php b/blocks/feedback/classes/privacy/provider.php index 157e25e0ec2..132d6b28116 100644 --- a/blocks/feedback/classes/privacy/provider.php +++ b/blocks/feedback/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/globalsearch/classes/privacy/provider.php b/blocks/globalsearch/classes/privacy/provider.php index 0c57f732b1f..1bd02251794 100644 --- a/blocks/globalsearch/classes/privacy/provider.php +++ b/blocks/globalsearch/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/glossary_random/classes/privacy/provider.php b/blocks/glossary_random/classes/privacy/provider.php index d1c64d441fe..94be7254381 100644 --- a/blocks/glossary_random/classes/privacy/provider.php +++ b/blocks/glossary_random/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/html/classes/privacy/provider.php b/blocks/html/classes/privacy/provider.php index 9d987a0d542..6b934ef1fd9 100644 --- a/blocks/html/classes/privacy/provider.php +++ b/blocks/html/classes/privacy/provider.php @@ -56,7 +56,7 @@ class provider implements * @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->link_subsystem('block', 'privacy:metadata:block'); return $collection; @@ -68,7 +68,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { // This block doesn't know who information is stored against unless it // is at the user context. $contextlist = new \core_privacy\local\request\contextlist(); diff --git a/blocks/html/lib.php b/blocks/html/lib.php index ecc2d8d45c2..cdd2e8b4c41 100644 --- a/blocks/html/lib.php +++ b/blocks/html/lib.php @@ -117,7 +117,7 @@ function block_html_global_db_replace($search, $replace) { * @param array $args The path (the part after the filearea and before the filename). * @return array The itemid and the filepath inside the $args path, for the defined filearea. */ -function block_html_get_path_from_pluginfile(string $filearea, array $args) : array { +function block_html_get_path_from_pluginfile(string $filearea, array $args): array { // This block never has an itemid (the number represents the revision but it's not stored in database). array_shift($args); diff --git a/blocks/login/block_login.php b/blocks/login/block_login.php index ba1d8b14d92..edd1863ca79 100644 --- a/blocks/login/block_login.php +++ b/blocks/login/block_login.php @@ -31,7 +31,7 @@ class block_login extends block_base { return array('site' => true); } - function get_content () { + function get_content() { global $USER, $CFG, $SESSION, $OUTPUT; require_once($CFG->libdir . '/authlib.php'); diff --git a/blocks/login/classes/privacy/provider.php b/blocks/login/classes/privacy/provider.php index 3978b4faf08..b0391074199 100644 --- a/blocks/login/classes/privacy/provider.php +++ b/blocks/login/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/lp/classes/privacy/provider.php b/blocks/lp/classes/privacy/provider.php index 602af6fd950..fff1784b612 100644 --- a/blocks/lp/classes/privacy/provider.php +++ b/blocks/lp/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/mentees/classes/privacy/provider.php b/blocks/mentees/classes/privacy/provider.php index ca86561b104..e7bccec8466 100644 --- a/blocks/mentees/classes/privacy/provider.php +++ b/blocks/mentees/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/mnet_hosts/classes/privacy/provider.php b/blocks/mnet_hosts/classes/privacy/provider.php index e70f8648b83..790a1341834 100644 --- a/blocks/mnet_hosts/classes/privacy/provider.php +++ b/blocks/mnet_hosts/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/myoverview/classes/privacy/provider.php b/blocks/myoverview/classes/privacy/provider.php index 729bbce37f1..31c5af59b96 100644 --- a/blocks/myoverview/classes/privacy/provider.php +++ b/blocks/myoverview/classes/privacy/provider.php @@ -44,7 +44,7 @@ class provider implements \core_privacy\local\metadata\provider, user_preference * @param \core_privacy\local\metadata\collection $collection A collection of meta-data. * @return \core_privacy\local\metadata\collection Return the collection of meta-data. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_user_preference('block_myoverview_user_sort_preference', 'privacy:metadata:overviewsortpreference'); $collection->add_user_preference('block_myoverview_user_view_preference', 'privacy:metadata:overviewviewpreference'); $collection->add_user_preference('block_myoverview_user_grouping_preference', diff --git a/blocks/myprofile/classes/privacy/provider.php b/blocks/myprofile/classes/privacy/provider.php index 160c1861a0f..ac94911fced 100644 --- a/blocks/myprofile/classes/privacy/provider.php +++ b/blocks/myprofile/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/navigation/block_navigation.php b/blocks/navigation/block_navigation.php index b8080b427c6..bc48c81c1eb 100644 --- a/blocks/navigation/block_navigation.php +++ b/blocks/navigation/block_navigation.php @@ -90,7 +90,7 @@ class block_navigation extends block_base { * * @return false */ - function instance_can_be_hidden() { + function instance_can_be_hidden() { return false; } diff --git a/blocks/navigation/classes/privacy/provider.php b/blocks/navigation/classes/privacy/provider.php index 032a554ccc9..78275ba1976 100644 --- a/blocks/navigation/classes/privacy/provider.php +++ b/blocks/navigation/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/news_items/classes/privacy/provider.php b/blocks/news_items/classes/privacy/provider.php index d4b883b8b14..fcdaded4961 100644 --- a/blocks/news_items/classes/privacy/provider.php +++ b/blocks/news_items/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/online_users/classes/privacy/provider.php b/blocks/online_users/classes/privacy/provider.php index 3f29a8e980c..187ae26e9b0 100644 --- a/blocks/online_users/classes/privacy/provider.php +++ b/blocks/online_users/classes/privacy/provider.php @@ -46,7 +46,7 @@ class provider implements * @param collection $collection Collection of items to add metadata to. * @return collection Collection with our added items. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_user_preference('block_online_users_uservisibility', 'privacy:metadata:preference:uservisibility'); diff --git a/blocks/private_files/classes/privacy/provider.php b/blocks/private_files/classes/privacy/provider.php index 147ab4463bf..2bf0e4b2746 100644 --- a/blocks/private_files/classes/privacy/provider.php +++ b/blocks/private_files/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/recent_activity/classes/privacy/provider.php b/blocks/recent_activity/classes/privacy/provider.php index 063a39ac11e..4cd1f7c3ed6 100644 --- a/blocks/recent_activity/classes/privacy/provider.php +++ b/blocks/recent_activity/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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 { // This plugin defines a db table but it is not considered personal data and, therefore, not exported or deleted. $collection->add_database_table('block_recent_activity', [ @@ -71,7 +71,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/blocks/recentlyaccessedcourses/classes/privacy/provider.php b/blocks/recentlyaccessedcourses/classes/privacy/provider.php index 2cd3c291510..037063ce59c 100644 --- a/blocks/recentlyaccessedcourses/classes/privacy/provider.php +++ b/blocks/recentlyaccessedcourses/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/recentlyaccesseditems/classes/privacy/provider.php b/blocks/recentlyaccesseditems/classes/privacy/provider.php index 7eb72354e72..5d75e179e8c 100644 --- a/blocks/recentlyaccesseditems/classes/privacy/provider.php +++ b/blocks/recentlyaccesseditems/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @param collection $collection A list of information about this component * @return collection The collection object filled out with information about this component. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $recentitems = [ 'userid' => 'privacy:metadata:userid', 'courseid' => 'privacy:metadata:courseid', @@ -72,7 +72,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $params = ['userid' => $userid, 'contextuser' => CONTEXT_USER]; $sql = "SELECT c.id FROM {context} c diff --git a/blocks/rss_client/classes/privacy/provider.php b/blocks/rss_client/classes/privacy/provider.php index 2ad457bbde3..9e208270489 100644 --- a/blocks/rss_client/classes/privacy/provider.php +++ b/blocks/rss_client/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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('block_rss_client', [ 'userid' => 'privacy:metadata:block_rss_client:userid', 'title' => 'privacy:metadata:block_rss_client:title', @@ -69,7 +69,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {block_rss_client} brc JOIN {user} u diff --git a/blocks/rss_client/classes/task/refreshfeeds.php b/blocks/rss_client/classes/task/refreshfeeds.php index 3e12ab28afc..1416bd5ff41 100644 --- a/blocks/rss_client/classes/task/refreshfeeds.php +++ b/blocks/rss_client/classes/task/refreshfeeds.php @@ -119,7 +119,7 @@ class refreshfeeds extends \core\task\scheduled_task { * @param string $url The URL to fetch * @return \moodle_simplepie */ - protected function fetch_feed(string $url) : \moodle_simplepie { + protected function fetch_feed(string $url): \moodle_simplepie { // Fetch the rss feed, using standard simplepie caching so feeds will be renewed only if cache has expired. \core_php_time_limit::raise(60); @@ -140,7 +140,7 @@ class refreshfeeds extends \core\task\scheduled_task { * @param int $currentskip The current skip time of a record. * @return int The newly calculated skip time. */ - protected function calculate_skiptime(int $currentskip) : int { + protected function calculate_skiptime(int $currentskip): int { // If the feed has never failed, then the initial skiptime will be 0. We use a default of 5 minutes in this case. // If the feed has previously failed then we double that time. $newskiptime = max(MINSECS * 5, ($currentskip * 2)); diff --git a/blocks/rss_client/tests/cron_test.php b/blocks/rss_client/tests/cron_test.php index 9bcf0894bba..5f8f3b3dd89 100644 --- a/blocks/rss_client/tests/cron_test.php +++ b/blocks/rss_client/tests/cron_test.php @@ -67,7 +67,7 @@ class cron_test extends \advanced_testcase { * * @return array */ - public function skip_time_increase_provider() : array { + public function skip_time_increase_provider(): array { return [ 'Never failed' => [ 'skiptime' => 0, diff --git a/blocks/search_forums/classes/privacy/provider.php b/blocks/search_forums/classes/privacy/provider.php index 090f9602f78..8145589f598 100644 --- a/blocks/search_forums/classes/privacy/provider.php +++ b/blocks/search_forums/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/section_links/classes/privacy/provider.php b/blocks/section_links/classes/privacy/provider.php index 83bb444c7d8..f5a1d044296 100644 --- a/blocks/section_links/classes/privacy/provider.php +++ b/blocks/section_links/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/selfcompletion/classes/privacy/provider.php b/blocks/selfcompletion/classes/privacy/provider.php index c96a1876937..4eb193e41b2 100644 --- a/blocks/selfcompletion/classes/privacy/provider.php +++ b/blocks/selfcompletion/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/settings/block_settings.php b/blocks/settings/block_settings.php index 226d6870ed8..aa7b46e5a9e 100644 --- a/blocks/settings/block_settings.php +++ b/blocks/settings/block_settings.php @@ -65,7 +65,7 @@ class block_settings extends block_base { * * @return false */ - function instance_can_be_hidden() { + function instance_can_be_hidden() { return false; } diff --git a/blocks/settings/classes/privacy/provider.php b/blocks/settings/classes/privacy/provider.php index 808dda4c199..d269b23d10f 100644 --- a/blocks/settings/classes/privacy/provider.php +++ b/blocks/settings/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/site_main_menu/classes/privacy/provider.php b/blocks/site_main_menu/classes/privacy/provider.php index b9e69912be6..d10a5463ff1 100644 --- a/blocks/site_main_menu/classes/privacy/provider.php +++ b/blocks/site_main_menu/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/social_activities/classes/privacy/provider.php b/blocks/social_activities/classes/privacy/provider.php index cad5ba3fe32..05b2f4318da 100644 --- a/blocks/social_activities/classes/privacy/provider.php +++ b/blocks/social_activities/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/starredcourses/classes/privacy/provider.php b/blocks/starredcourses/classes/privacy/provider.php index c5e8c879654..abc25edebeb 100644 --- a/blocks/starredcourses/classes/privacy/provider.php +++ b/blocks/starredcourses/classes/privacy/provider.php @@ -39,7 +39,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'; } } diff --git a/blocks/tag_flickr/block_tag_flickr.php b/blocks/tag_flickr/block_tag_flickr.php index 30aec42ec7d..b750ac57406 100644 --- a/blocks/tag_flickr/block_tag_flickr.php +++ b/blocks/tag_flickr/block_tag_flickr.php @@ -168,7 +168,7 @@ class block_tag_flickr extends block_base { return $response; } - function build_photo_url ($photo, $size='medium') { + function build_photo_url($photo, $size='medium') { //receives an array (can use the individual photo data returned //from an API call) and returns a URL (doesn't mean that the //file size exists) diff --git a/blocks/tag_flickr/classes/privacy/provider.php b/blocks/tag_flickr/classes/privacy/provider.php index 071395fe0d8..ed2a467dc57 100644 --- a/blocks/tag_flickr/classes/privacy/provider.php +++ b/blocks/tag_flickr/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_external_location_link( 'flickr.com', [ @@ -68,7 +68,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/blocks/tag_youtube/classes/privacy/provider.php b/blocks/tag_youtube/classes/privacy/provider.php index e4b1c08ab20..a6b86b6e415 100644 --- a/blocks/tag_youtube/classes/privacy/provider.php +++ b/blocks/tag_youtube/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/tags/classes/privacy/provider.php b/blocks/tags/classes/privacy/provider.php index 8ce51595fc9..370bcd463f3 100644 --- a/blocks/tags/classes/privacy/provider.php +++ b/blocks/tags/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/blocks/timeline/classes/privacy/provider.php b/blocks/timeline/classes/privacy/provider.php index ed1df85bd13..a366323a1d6 100644 --- a/blocks/timeline/classes/privacy/provider.php +++ b/blocks/timeline/classes/privacy/provider.php @@ -41,7 +41,7 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l * @param \core_privacy\local\metadata\collection $collection A collection of meta-data. * @return \core_privacy\local\metadata\collection Return the collection of meta-data. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_user_preference('block_timeline_user_sort_preference', 'privacy:metadata:timelinesortpreference'); $collection->add_user_preference('block_timeline_user_filter_preference', 'privacy:metadata:timelinefilterpreference'); $collection->add_user_preference('block_timeline_user_limit_preference', 'privacy:metadata:timelinelimitpreference'); diff --git a/blog/classes/privacy/provider.php b/blog/classes/privacy/provider.php index 8ff19c3f03d..3032abc30ab 100644 --- a/blog/classes/privacy/provider.php +++ b/blog/classes/privacy/provider.php @@ -58,7 +58,7 @@ class provider implements * @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('post', [ 'userid' => 'privacy:metadata:post:userid', @@ -98,7 +98,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { global $DB; $contextlist = new \core_privacy\local\request\contextlist(); diff --git a/cache/classes/factory.php b/cache/classes/factory.php index f535e72986d..116b1b36258 100644 --- a/cache/classes/factory.php +++ b/cache/classes/factory.php @@ -652,7 +652,7 @@ class cache_factory { * * @return core_cache\administration_helper */ - public static function get_administration_display_helper() : core_cache\administration_helper { + public static function get_administration_display_helper(): core_cache\administration_helper { if (is_null(self::$displayhelper)) { self::$displayhelper = new \core_cache\local\administration_display_helper(); } diff --git a/cache/classes/local/administration_display_helper.php b/cache/classes/local/administration_display_helper.php index cadf8e028c0..6d4409c724f 100644 --- a/cache/classes/local/administration_display_helper.php +++ b/cache/classes/local/administration_display_helper.php @@ -440,7 +440,7 @@ class administration_display_helper extends \core_cache\administration_helper { * * @return array an array of the form to display to the user, and the page title. */ - public function action_addstore() : array { + public function action_addstore(): array { global $PAGE; $storepluginsummaries = $this->get_store_plugin_summaries(); diff --git a/cache/classes/output/renderer.php b/cache/classes/output/renderer.php index 6a9391937f4..9f634f9a8ac 100644 --- a/cache/classes/output/renderer.php +++ b/cache/classes/output/renderer.php @@ -377,7 +377,7 @@ class renderer extends \plugin_renderer_base { * * @return string */ - public function additional_lock_actions() : string { + public function additional_lock_actions(): string { $url = new moodle_url('/cache/admin.php', array('action' => 'newlockinstance')); $select = new single_select($url, 'lock', cache_factory::get_administration_display_helper()->get_addable_lock_options()); $select->label = get_string('addnewlockinstance', 'cache'); diff --git a/cache/classes/privacy/provider.php b/cache/classes/privacy/provider.php index 2bbb07e88dd..9816123b5fd 100644 --- a/cache/classes/privacy/provider.php +++ b/cache/classes/privacy/provider.php @@ -57,7 +57,7 @@ class provider implements * @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 { // Data is stored in cache stores. $collection->add_plugintype_link('cachestore', [], 'privacy:metadata:cachestore'); diff --git a/cache/disabledlib.php b/cache/disabledlib.php index 3758f26d328..3538d1ed648 100644 --- a/cache/disabledlib.php +++ b/cache/disabledlib.php @@ -207,7 +207,7 @@ class cache_disabled extends cache implements cache_loader_with_locking { * @param int|string $key * @return bool */ - public function acquire_lock($key) : bool { + public function acquire_lock($key): bool { return true; } @@ -217,7 +217,7 @@ class cache_disabled extends cache implements cache_loader_with_locking { * @param int|string $key * @return bool */ - public function release_lock($key) : bool { + public function release_lock($key): bool { return true; } @@ -227,7 +227,7 @@ class cache_disabled extends cache implements cache_loader_with_locking { * @param int|string $key * @return bool */ - public function check_lock_state($key) : bool { + public function check_lock_state($key): bool { return true; } } diff --git a/cache/locks/file/classes/privacy/provider.php b/cache/locks/file/classes/privacy/provider.php index a125cc5813e..30c00be9a5e 100644 --- a/cache/locks/file/classes/privacy/provider.php +++ b/cache/locks/file/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/cache/stores/apcu/classes/privacy/provider.php b/cache/stores/apcu/classes/privacy/provider.php index ce0998f32b8..440ae33a36f 100644 --- a/cache/stores/apcu/classes/privacy/provider.php +++ b/cache/stores/apcu/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/cache/stores/file/classes/privacy/provider.php b/cache/stores/file/classes/privacy/provider.php index ab08c8e3dfc..4f63440cd89 100644 --- a/cache/stores/file/classes/privacy/provider.php +++ b/cache/stores/file/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php index 4f011d4d08c..d1c1057e359 100644 --- a/cache/stores/file/lib.php +++ b/cache/stores/file/lib.php @@ -981,7 +981,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i * @param string $ownerid Cache identifier * @return bool|null */ - public function check_lock_state($key, $ownerid) : ?bool { + public function check_lock_state($key, $ownerid): ?bool { if (!array_key_exists($key, $this->locks)) { return null; // Lock does not exist. } @@ -1011,7 +1011,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i * @return bool * @throws cache_exception */ - public function acquire_lock($key, $ownerid) : bool { + public function acquire_lock($key, $ownerid): bool { $lock = $this->lockfactory->get_lock($key, $this->lockwait); if ($lock) { $this->locks[$key][$ownerid] = $lock; @@ -1026,7 +1026,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i * @param string $ownerid Cache identifier * @return bool */ - public function release_lock($key, $ownerid) : bool { + public function release_lock($key, $ownerid): bool { if (!array_key_exists($key, $this->locks)) { return false; // No lock to release. } diff --git a/cache/stores/redis/classes/privacy/provider.php b/cache/stores/redis/classes/privacy/provider.php index b3c829e82aa..4ff9fe78e25 100644 --- a/cache/stores/redis/classes/privacy/provider.php +++ b/cache/stores/redis/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_external_location_link('redis', [ 'data' => 'privacy:metadata:redis:data', ], 'privacy:metadata:redis'); @@ -63,7 +63,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/cache/stores/session/classes/privacy/provider.php b/cache/stores/session/classes/privacy/provider.php index f7f31757510..a9d208b9856 100644 --- a/cache/stores/session/classes/privacy/provider.php +++ b/cache/stores/session/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_subsystem_link('core_user', [], 'privacy:metadata:core_user'); return $collection; } @@ -61,7 +61,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/cache/stores/static/classes/privacy/provider.php b/cache/stores/static/classes/privacy/provider.php index 3e994ee5aab..eff907240cf 100644 --- a/cache/stores/static/classes/privacy/provider.php +++ b/cache/stores/static/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/calendar/classes/local/event/proxies/coursecat_proxy.php b/calendar/classes/local/event/proxies/coursecat_proxy.php index 8b0d4568979..936508d618b 100644 --- a/calendar/classes/local/event/proxies/coursecat_proxy.php +++ b/calendar/classes/local/event/proxies/coursecat_proxy.php @@ -81,7 +81,7 @@ class coursecat_proxy implements proxy_interface { * * @return \core_course_category */ - public function get_proxied_instance() : \core_course_category { + public function get_proxied_instance(): \core_course_category { if (!$this->category) { $this->category = \core_course_category::get($this->id, IGNORE_MISSING, true); } diff --git a/calendar/classes/privacy/provider.php b/calendar/classes/privacy/provider.php index 63f4b72ed04..0ff568d17fa 100644 --- a/calendar/classes/privacy/provider.php +++ b/calendar/classes/privacy/provider.php @@ -54,7 +54,7 @@ class provider implements * @param collection $collection A collection of meta data items to be added to. * @return collection Returns the collection of metadata. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { // The calendar 'event' table contains user data. $collection->add_database_table( 'event', @@ -94,7 +94,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // Calendar Events can exist at Site, Course Category, Course, Course Group, User, or Course Modules contexts. diff --git a/calendar/event_form.php b/calendar/event_form.php index cfff16feaff..05f49cc8332 100644 --- a/calendar/event_form.php +++ b/calendar/event_form.php @@ -42,7 +42,7 @@ class event_form extends moodleform { /** * The form definition */ - function definition () { + function definition() { global $CFG, $USER, $OUTPUT; $mform = $this->_form; $newevent = (empty($this->_customdata->event) || empty($this->_customdata->event->id)); diff --git a/calendar/externallib.php b/calendar/externallib.php index a9f062d7830..11193e5dcdb 100644 --- a/calendar/externallib.php +++ b/calendar/externallib.php @@ -114,7 +114,7 @@ class core_calendar_external extends external_api { * @return \core_external\external_description * @since Moodle 2.5 */ - public static function delete_calendar_events_returns() { + public static function delete_calendar_events_returns() { return null; } @@ -365,7 +365,7 @@ class core_calendar_external extends external_api { * @return \core_external\external_description * @since Moodle 2.5 */ - public static function get_calendar_events_returns() { + public static function get_calendar_events_returns() { return new external_single_structure(array( 'events' => new external_multiple_structure( new external_single_structure( array( @@ -760,7 +760,7 @@ class core_calendar_external extends external_api { * @return \core_external\external_description. * @since Moodle 2.5 */ - public static function create_calendar_events_returns() { + public static function create_calendar_events_returns() { return new external_single_structure( array( 'events' => new external_multiple_structure( new external_single_structure( @@ -989,7 +989,7 @@ class core_calendar_external extends external_api { * * @return \core_external\external_description. */ - public static function submit_create_update_form_returns() { + public static function submit_create_update_form_returns() { $eventstructure = event_exporter::get_read_structure(); $eventstructure->required = VALUE_OPTIONAL; @@ -1329,7 +1329,7 @@ class core_calendar_external extends external_api { * @return \core_external\external_description. * @since Moodle 3.7 */ - public static function get_calendar_access_information_returns() { + public static function get_calendar_access_information_returns() { return new external_single_structure( [ @@ -1389,7 +1389,7 @@ class core_calendar_external extends external_api { * @return \core_external\external_description. * @since Moodle 3.7 */ - public static function get_allowed_event_types_returns() { + public static function get_allowed_event_types_returns() { return new external_single_structure( [ diff --git a/calendar/lib.php b/calendar/lib.php index bd014951d6c..6ccd58cd483 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1121,7 +1121,7 @@ class calendar_information { * If a courseid is specified, this value is ignored. * @return calendar_information */ - public static function create($time, int $courseid, int $categoryid = null) : calendar_information { + public static function create($time, int $courseid, int $categoryid = null): calendar_information { $calendar = new static(0, 0, 0, $time); if ($courseid != SITEID && !empty($courseid)) { // Course ID must be valid and existing. diff --git a/calendar/tests/externallib_test.php b/calendar/tests/externallib_test.php index e0921c05db8..a9259cf2797 100644 --- a/calendar/tests/externallib_test.php +++ b/calendar/tests/externallib_test.php @@ -134,7 +134,7 @@ class externallib_test extends externallib_advanced_testcase { return $event->create($prop); } - public function test_create_calendar_events () { + public function test_create_calendar_events() { global $DB, $USER; $this->setAdminUser(); diff --git a/calendar/type/gregorian/classes/privacy/provider.php b/calendar/type/gregorian/classes/privacy/provider.php index 8f7f01722c9..c7baccbfeca 100644 --- a/calendar/type/gregorian/classes/privacy/provider.php +++ b/calendar/type/gregorian/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/cohort/classes/privacy/provider.php b/cohort/classes/privacy/provider.php index 978855440c4..48b9fed9252 100644 --- a/cohort/classes/privacy/provider.php +++ b/cohort/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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('cohort_members', [ 'cohortid' => 'privacy:metadata:cohort_members:cohortid', 'userid' => 'privacy:metadata:cohort_members:userid', @@ -66,7 +66,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {context} ctx INNER JOIN {cohort} c ON c.contextid = ctx.id diff --git a/comment/classes/privacy/provider.php b/comment/classes/privacy/provider.php index d4f19866c14..1b2f73c2c60 100644 --- a/comment/classes/privacy/provider.php +++ b/comment/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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('comments', [ 'content' => 'privacy:metadata:comment:content', 'timecreated' => 'privacy:metadata:comment:timecreated', diff --git a/competency/classes/privacy/provider.php b/competency/classes/privacy/provider.php index 534fc785f9d..a3fdcf1e6af 100644 --- a/competency/classes/privacy/provider.php +++ b/competency/classes/privacy/provider.php @@ -69,7 +69,7 @@ class provider implements * @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 { // Tables not related to users aside from the editing information. $collection->add_database_table('competency', [ @@ -215,7 +215,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { global $DB; $contextlist = new \core_privacy\local\request\contextlist(); diff --git a/completion/classes/privacy/provider.php b/completion/classes/privacy/provider.php index 93a7a692c2e..04dbcb9b0ac 100644 --- a/completion/classes/privacy/provider.php +++ b/completion/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @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('course_completions', [ 'userid' => 'privacy:metadata:userid', 'course' => 'privacy:metadata:course', @@ -92,7 +92,7 @@ class provider implements * @param string $joinfield A field to join these tables to. Joins to course ID. * @return array The join, where, and params for this join. */ - public static function get_course_completion_join_sql(int $userid, string $prefix, string $joinfield) : array { + public static function get_course_completion_join_sql(int $userid, string $prefix, string $joinfield): array { $cccalias = "{$prefix}_ccc"; // Course completion criteria. $cmcalias = "{$prefix}_cmc"; // Course modules completion. $cmvalias = "{$prefix}_cmv"; // Course modules viewed. @@ -157,7 +157,7 @@ class provider implements * @param \stdClass $cm Course module information. * @return \stdClass Activity completion information. */ - public static function get_activity_completion_info(\stdClass $user, \stdClass $course, $cm) : \stdClass { + public static function get_activity_completion_info(\stdClass $user, \stdClass $course, $cm): \stdClass { $completioninfo = new \completion_info($course); $completion = $completioninfo->is_enabled($cm); return ($completion != COMPLETION_TRACKING_NONE) ? $completioninfo->get_data($cm, true, $user->id) : new \stdClass(); @@ -170,7 +170,7 @@ class provider implements * @param \stdClass $course The course we are interested in. * @return \stdClass Course completion information. */ - public static function get_course_completion_info(\stdClass $user, \stdClass $course) : array { + public static function get_course_completion_info(\stdClass $user, \stdClass $course): array { $completioninfo = new \completion_info($course); $completion = $completioninfo->is_enabled(); diff --git a/contentbank/contenttype/h5p/classes/privacy/provider.php b/contentbank/contenttype/h5p/classes/privacy/provider.php index 48aa9e23275..4751a87e9ed 100644 --- a/contentbank/contenttype/h5p/classes/privacy/provider.php +++ b/contentbank/contenttype/h5p/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/course/classes/analytics/indicator/activities_due.php b/course/classes/analytics/indicator/activities_due.php index 297d31eda74..4561720467f 100644 --- a/course/classes/analytics/indicator/activities_due.php +++ b/course/classes/analytics/indicator/activities_due.php @@ -44,7 +44,7 @@ class activities_due extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:activitiesdue'); } diff --git a/course/classes/analytics/indicator/completion_enabled.php b/course/classes/analytics/indicator/completion_enabled.php index 87d09199c19..81ccc50bebc 100644 --- a/course/classes/analytics/indicator/completion_enabled.php +++ b/course/classes/analytics/indicator/completion_enabled.php @@ -42,7 +42,7 @@ class completion_enabled extends \core_analytics\local\indicator\binary { * * @return new \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:completionenabled', 'moodle'); } diff --git a/course/classes/analytics/indicator/no_student.php b/course/classes/analytics/indicator/no_student.php index 30b872e7381..a2bc51d5a04 100644 --- a/course/classes/analytics/indicator/no_student.php +++ b/course/classes/analytics/indicator/no_student.php @@ -49,7 +49,7 @@ class no_student extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:nostudent', 'moodle'); } diff --git a/course/classes/analytics/indicator/no_teacher.php b/course/classes/analytics/indicator/no_teacher.php index a2d7833a23f..b518f11c120 100644 --- a/course/classes/analytics/indicator/no_teacher.php +++ b/course/classes/analytics/indicator/no_teacher.php @@ -49,7 +49,7 @@ class no_teacher extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:noteacher', 'moodle'); } diff --git a/course/classes/analytics/indicator/potential_cognitive_depth.php b/course/classes/analytics/indicator/potential_cognitive_depth.php index ea96e426bae..446845a10c0 100644 --- a/course/classes/analytics/indicator/potential_cognitive_depth.php +++ b/course/classes/analytics/indicator/potential_cognitive_depth.php @@ -45,7 +45,7 @@ class potential_cognitive_depth extends \core_analytics\local\indicator\linear { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:potentialcognitive', 'moodle'); } diff --git a/course/classes/analytics/indicator/potential_social_breadth.php b/course/classes/analytics/indicator/potential_social_breadth.php index dc149b5b01f..c006e7e42ab 100644 --- a/course/classes/analytics/indicator/potential_social_breadth.php +++ b/course/classes/analytics/indicator/potential_social_breadth.php @@ -45,7 +45,7 @@ class potential_social_breadth extends \core_analytics\local\indicator\linear { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:potentialsocial', 'moodle'); } diff --git a/course/classes/analytics/target/course_competencies.php b/course/classes/analytics/target/course_competencies.php index a1ae89c3e00..043638f57d8 100644 --- a/course/classes/analytics/target/course_competencies.php +++ b/course/classes/analytics/target/course_competencies.php @@ -49,7 +49,7 @@ class course_competencies extends course_enrolments { * @param int $courseid The course id. * @return int Number of competencies assigned to the course. */ - protected function get_num_competencies_in_course ($courseid) { + protected function get_num_competencies_in_course($courseid) { if (!isset($this->coursecompetencies[$courseid])) { $ccs = \core_competency\api::count_competencies_in_course($courseid); @@ -68,7 +68,7 @@ class course_competencies extends course_enrolments { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('target:coursecompetencies', 'course'); } diff --git a/course/classes/analytics/target/course_completion.php b/course/classes/analytics/target/course_completion.php index 966ceafda3c..e7dd37750e7 100644 --- a/course/classes/analytics/target/course_completion.php +++ b/course/classes/analytics/target/course_completion.php @@ -46,7 +46,7 @@ class course_completion extends course_enrolments { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('target:coursecompletion', 'course'); } diff --git a/course/classes/analytics/target/course_dropout.php b/course/classes/analytics/target/course_dropout.php index e271e820acd..b3bdb3d1bf2 100644 --- a/course/classes/analytics/target/course_dropout.php +++ b/course/classes/analytics/target/course_dropout.php @@ -47,7 +47,7 @@ class course_dropout extends course_enrolments { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('target:coursedropout', 'course'); } diff --git a/course/classes/analytics/target/course_gradetopass.php b/course/classes/analytics/target/course_gradetopass.php index e3f588cf2e2..8c7b2ec4f70 100644 --- a/course/classes/analytics/target/course_gradetopass.php +++ b/course/classes/analytics/target/course_gradetopass.php @@ -113,7 +113,7 @@ class course_gradetopass extends course_enrolments { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('target:coursegradetopass', 'course'); } diff --git a/course/classes/analytics/target/no_access_since_course_start.php b/course/classes/analytics/target/no_access_since_course_start.php index 32c12af84bc..53f334425e2 100644 --- a/course/classes/analytics/target/no_access_since_course_start.php +++ b/course/classes/analytics/target/no_access_since_course_start.php @@ -52,7 +52,7 @@ class no_access_since_course_start extends no_recent_accesses { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('target:noaccesssincecoursestart', 'course'); } diff --git a/course/classes/analytics/target/no_recent_accesses.php b/course/classes/analytics/target/no_recent_accesses.php index 5244d5ade16..2df1d689970 100644 --- a/course/classes/analytics/target/no_recent_accesses.php +++ b/course/classes/analytics/target/no_recent_accesses.php @@ -51,7 +51,7 @@ class no_recent_accesses extends course_enrolments { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('target:norecentaccesses', 'course'); } diff --git a/course/classes/analytics/target/no_teaching.php b/course/classes/analytics/target/no_teaching.php index 7af378ab360..65d6906d627 100644 --- a/course/classes/analytics/target/no_teaching.php +++ b/course/classes/analytics/target/no_teaching.php @@ -61,7 +61,7 @@ class no_teaching extends \core_analytics\local\target\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('target:noteachingactivity', 'course'); } diff --git a/course/classes/category.php b/course/classes/category.php index 8a546a7ea62..4256c5d3ed9 100644 --- a/course/classes/category.php +++ b/course/classes/category.php @@ -177,7 +177,7 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr * @param string $name Callback function name. * @return [callable] $pluginfunctions */ - public function get_plugins_callback_function(string $name) : array { + public function get_plugins_callback_function(string $name): array { $pluginfunctions = []; if ($pluginsfunction = get_plugins_with_function($name)) { foreach ($pluginsfunction as $plugintype => $plugins) { @@ -766,7 +766,7 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr * @throws dml_exception * @throws moodle_exception */ - private static function get_cached_cat_tree() : ?array { + private static function get_cached_cat_tree(): ?array { $coursecattreecache = cache::make('core', 'coursecattree'); $all = $coursecattreecache->get('all'); if ($all !== false) { @@ -804,7 +804,7 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr * @throws dml_exception * @throws moodle_exception */ - private static function rebuild_coursecattree_cache_contents() : array { + private static function rebuild_coursecattree_cache_contents(): array { global $DB; $sql = "SELECT cc.id, cc.parent, cc.visible FROM {course_categories} cc diff --git a/course/classes/customfield/course_handler.php b/course/classes/customfield/course_handler.php index 99b16ded926..47af9bf6e4b 100644 --- a/course/classes/customfield/course_handler.php +++ b/course/classes/customfield/course_handler.php @@ -61,7 +61,7 @@ class course_handler extends \core_customfield\handler { * @param int $itemid * @return \core_course\customfield\course_handler */ - public static function create(int $itemid = 0) : \core_customfield\handler { + public static function create(int $itemid = 0): \core_customfield\handler { if (static::$singleton === null) { self::$singleton = new static(0); } @@ -84,7 +84,7 @@ class course_handler extends \core_customfield\handler { * * @return bool true if the current can configure custom fields, false otherwise */ - public function can_configure() : bool { + public function can_configure(): bool { return has_capability('moodle/course:configurecustomfields', $this->get_configuration_context()); } @@ -95,7 +95,7 @@ class course_handler extends \core_customfield\handler { * @param int $instanceid id of the course to test edit permission * @return bool true if the current can edit custom fields, false otherwise */ - public function can_edit(field_controller $field, int $instanceid = 0) : bool { + public function can_edit(field_controller $field, int $instanceid = 0): bool { if ($instanceid) { $context = $this->get_instance_context($instanceid); return (!$field->get_configdata_property('locked') || @@ -119,7 +119,7 @@ class course_handler extends \core_customfield\handler { * @param int $instanceid id of the course to test edit permission * @return bool true if the current can edit custom fields, false otherwise */ - public function can_view(field_controller $field, int $instanceid) : bool { + public function can_view(field_controller $field, int $instanceid): bool { $visibility = $field->get_configdata_property('visibility'); if ($visibility == self::NOTVISIBLE) { return false; @@ -146,7 +146,7 @@ class course_handler extends \core_customfield\handler { * * @return \context */ - protected function get_parent_context() : \context { + protected function get_parent_context(): \context { global $PAGE; if ($this->parentcontext) { return $this->parentcontext; @@ -161,7 +161,7 @@ class course_handler extends \core_customfield\handler { * * @return \context the context for configuration */ - public function get_configuration_context() : \context { + public function get_configuration_context(): \context { return \context_system::instance(); } @@ -170,7 +170,7 @@ class course_handler extends \core_customfield\handler { * * @return \moodle_url The URL to configure custom fields for this component */ - public function get_configuration_url() : \moodle_url { + public function get_configuration_url(): \moodle_url { return new \moodle_url('/course/customfield.php'); } @@ -180,7 +180,7 @@ class course_handler extends \core_customfield\handler { * @param int $instanceid id of the record to get the context for * @return \context the context for the given record */ - public function get_instance_context(int $instanceid = 0) : \context { + public function get_instance_context(int $instanceid = 0): \context { if ($instanceid > 0) { return \context_course::instance($instanceid); } else { diff --git a/course/classes/list_element.php b/course/classes/list_element.php index df124e363f3..8ff59b5b28b 100644 --- a/course/classes/list_element.php +++ b/course/classes/list_element.php @@ -205,7 +205,7 @@ class core_course_list_element implements IteratorAggregate { * * @return \core_customfield\data_controller[] */ - public function get_custom_fields() : array { + public function get_custom_fields(): array { if (!isset($this->record->customfields)) { $this->record->customfields = \core_course\customfield\course_handler::create()->get_instance_data($this->id); } @@ -217,7 +217,7 @@ class core_course_list_element implements IteratorAggregate { * * @return bool */ - public function has_custom_fields() : bool { + public function has_custom_fields(): bool { $customfields = $this->get_custom_fields(); return !empty($customfields); } diff --git a/course/classes/privacy/provider.php b/course/classes/privacy/provider.php index 2fa4b368672..88ab4867cc0 100644 --- a/course/classes/privacy/provider.php +++ b/course/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @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_subsystem_link('core_completion', [], 'privacy:metadata:completionsummary'); $collection->add_subsystem_link('core_favourites', [], 'privacy:metadata:favouritessummary'); $collection->add_subsystem_link('core_favourites', [], 'privacy:metadata:activityfavouritessummary'); @@ -67,7 +67,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { list($join, $where, $params) = \core_completion\privacy\provider::get_course_completion_join_sql($userid, 'cc', 'c.id'); $sql = "SELECT ctx.id FROM {context} ctx diff --git a/course/classes/search/course.php b/course/classes/search/course.php index b1bab831c08..213904a020f 100644 --- a/course/classes/search/course.php +++ b/course/classes/search/course.php @@ -183,7 +183,7 @@ class course extends \core_search\base { * @param \core_search\document $doc * @return \core_search\document_icon */ - public function get_doc_icon(\core_search\document $doc) : \core_search\document_icon { + public function get_doc_icon(\core_search\document $doc): \core_search\document_icon { return new \core_search\document_icon('i/course'); } diff --git a/course/classes/search/customfield.php b/course/classes/search/customfield.php index faeaa721b7a..dc74ae9790e 100644 --- a/course/classes/search/customfield.php +++ b/course/classes/search/customfield.php @@ -194,7 +194,7 @@ class customfield extends \core_search\base { * @param \core_search\document $doc * @return \core_search\document_icon */ - public function get_doc_icon(\core_search\document $doc) : \core_search\document_icon { + public function get_doc_icon(\core_search\document $doc): \core_search\document_icon { return new \core_search\document_icon('i/customfield'); } diff --git a/course/classes/search/section.php b/course/classes/search/section.php index 6be829d95b0..d5eaa4ff785 100644 --- a/course/classes/search/section.php +++ b/course/classes/search/section.php @@ -202,7 +202,7 @@ class section extends \core_search\base { * @param \core_search\document $doc * @return \core_search\document_icon */ - public function get_doc_icon(\core_search\document $doc) : \core_search\document_icon { + public function get_doc_icon(\core_search\document $doc): \core_search\document_icon { return new \core_search\document_icon('i/section'); } diff --git a/course/format/classes/base.php b/course/format/classes/base.php index 2d897626f22..579fd32638b 100644 --- a/course/format/classes/base.php +++ b/course/format/classes/base.php @@ -1213,7 +1213,7 @@ abstract class base { * @param int|null $sectionid null if it is course format option * @return array array of options that have valid values */ - protected function validate_format_options(array $rawdata, int $sectionid = null) : array { + protected function validate_format_options(array $rawdata, int $sectionid = null): array { if (!$sectionid) { $allformatoptions = $this->course_format_options(true); } else { @@ -1237,7 +1237,7 @@ abstract class base { * @param array $data data to insert/update * @return array array of options that have valid values */ - public function validate_course_format_options(array $data) : array { + public function validate_course_format_options(array $data): array { return $this->validate_format_options($data); } diff --git a/course/format/classes/output/local/content/cm/title.php b/course/format/classes/output/local/content/cm/title.php index e7cc8b3c5da..e18b68b205c 100644 --- a/course/format/classes/output/local/content/cm/title.php +++ b/course/format/classes/output/local/content/cm/title.php @@ -138,7 +138,7 @@ class title extends inplace_editable implements named_templatable, renderable { * Return the title template data to be used inside the inplace editable. * */ - protected function get_title_displayvalue (): string { + protected function get_title_displayvalue(): string { global $PAGE; // Inplace editable uses core renderer by default. However, course elements require diff --git a/course/format/classes/stateactions.php b/course/format/classes/stateactions.php index 0be2e06d1cc..c18b88f4a08 100644 --- a/course/format/classes/stateactions.php +++ b/course/format/classes/stateactions.php @@ -423,7 +423,7 @@ class stateactions { * @param int[] $ids section ids * @param int $visible the new visible value */ - protected function set_section_visibility ( + protected function set_section_visibility( stateupdates $updates, stdClass $course, array $ids, @@ -808,7 +808,7 @@ class stateactions { * @param int[] $ids the course modules $ids * @return cm_info[] the extracted cm_info objects */ - protected function get_cm_info (course_modinfo $modinfo, array $ids): array { + protected function get_cm_info(course_modinfo $modinfo, array $ids): array { $cms = []; foreach ($ids as $cmid) { $cms[$cmid] = $modinfo->get_cm($cmid); diff --git a/course/format/lib.php b/course/format/lib.php index 2b0025f2513..c64d61ae065 100644 --- a/course/format/lib.php +++ b/course/format/lib.php @@ -144,7 +144,7 @@ class format_site extends course_format { * @param array $option The definition structure of the option. * @param string $optionname The name of the option, as provided in the definition. */ -function contract_value(array &$dest, array $source, array $option, string $optionname) : void { +function contract_value(array &$dest, array $source, array $option, string $optionname): void { if (substr($optionname, -7) == '_editor') { // Suffix '_editor' indicates that the element is an editor. $name = substr($optionname, 0, -7); if (isset($source[$name])) { @@ -184,7 +184,7 @@ function clean_param_if_not_null($param, string $type = PARAM_RAW) { * @param array $option The definition structure of the option. * @param string $optionname The name of the option, as provided in the definition. */ -function expand_value(array &$dest, array $source, array $option, string $optionname) : void { +function expand_value(array &$dest, array $source, array $option, string $optionname): void { if (substr($optionname, -7) == '_editor') { // Suffix '_editor' indicates that the element is an editor. $name = substr($optionname, 0, -7); if (is_string($source[$optionname])) { diff --git a/course/format/singleactivity/classes/privacy/provider.php b/course/format/singleactivity/classes/privacy/provider.php index fd37615f11a..ad63250a571 100644 --- a/course/format/singleactivity/classes/privacy/provider.php +++ b/course/format/singleactivity/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/course/format/social/classes/privacy/provider.php b/course/format/social/classes/privacy/provider.php index e5999ef6d25..fa77ebcaaee 100644 --- a/course/format/social/classes/privacy/provider.php +++ b/course/format/social/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/course/format/weeks/classes/privacy/provider.php b/course/format/weeks/classes/privacy/provider.php index 7e44c2741f9..87f389cc0e0 100644 --- a/course/format/weeks/classes/privacy/provider.php +++ b/course/format/weeks/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/course/lib.php b/course/lib.php index a8074c50473..3835b406b89 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1016,7 +1016,7 @@ function course_module_flag_for_async_deletion($cmid) { * @param bool $onlygradable whether to check only gradable modules or all modules. * @return bool true if the course contains any modules pending deletion, false otherwise. */ -function course_modules_pending_deletion(int $courseid, bool $onlygradable = false) : bool { +function course_modules_pending_deletion(int $courseid, bool $onlygradable = false): bool { if (empty($courseid)) { return false; } @@ -4262,7 +4262,7 @@ function course_get_enrolled_courses_for_logged_in_user( int $dbquerylimit = COURSE_DB_QUERY_LIMIT, array $includecourses = [], array $hiddencourses = [] -) : Generator { +): Generator { $haslimit = !empty($limit); $recordsloaded = 0; @@ -4308,7 +4308,7 @@ function course_get_enrolled_courses_for_logged_in_user_from_search( int $dbquerylimit = COURSE_DB_QUERY_LIMIT, array $searchcriteria = [], array $options = [] -) : Generator { +): Generator { $haslimit = !empty($limit); $recordsloaded = 0; @@ -4355,7 +4355,7 @@ function course_filter_courses_by_timeline_classification( $courses, string $classification, int $limit = 0 -) : array { +): array { if (!in_array($classification, [COURSE_TIMELINE_ALLINCLUDINGHIDDEN, COURSE_TIMELINE_ALL, COURSE_TIMELINE_PAST, COURSE_TIMELINE_INPROGRESS, @@ -4412,7 +4412,7 @@ function course_filter_courses_by_favourites( $courses, $favouritecourseids, int $limit = 0 -) : array { +): array { $filteredcourses = []; $numberofcoursesprocessed = 0; @@ -4459,7 +4459,7 @@ function course_filter_courses_by_customfield( $customfieldname, $customfieldvalue, int $limit = 0 -) : array { +): array { global $DB; if (!$courses) { diff --git a/course/reset_form.php b/course/reset_form.php index 23fe7f83164..4c649079743 100644 --- a/course/reset_form.php +++ b/course/reset_form.php @@ -34,7 +34,7 @@ require_once($CFG->dirroot . '/course/lib.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class course_reset_form extends moodleform { - function definition (){ + function definition(){ global $CFG, $COURSE, $DB; $mform =& $this->_form; diff --git a/course/tests/category_hooks_test.php b/course/tests/category_hooks_test.php index 17d347a465c..21a73bd9163 100644 --- a/course/tests/category_hooks_test.php +++ b/course/tests/category_hooks_test.php @@ -53,7 +53,7 @@ class category_hooks_test extends \advanced_testcase { * @param string $callback Callback function used in method we test. * @return MockObject */ - public function get_mock_category(\core_course_category $category, string $callback = '') : MockObject { + public function get_mock_category(\core_course_category $category, string $callback = ''): MockObject { // Setup mock object for \core_course_category. // Disable original constructor, since we can't use it directly since it is private. $mockcategory = $this->getMockBuilder(\core_course_category::class) diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index b939a07f644..8d6a7ad13e7 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -737,7 +737,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Test get_courses */ - public function test_get_courses () { + public function test_get_courses() { global $DB; $this->resetAfterTest(true); @@ -923,7 +923,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Test search_courses */ - public function test_search_courses () { + public function test_search_courses() { global $DB; @@ -3286,7 +3286,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Test cases for the get_enrolled_courses_by_timeline_classification test. */ - public function get_get_enrolled_courses_by_timeline_classification_test_cases():array { + public function get_get_enrolled_courses_by_timeline_classification_test_cases(): array { $now = time(); $day = 86400; diff --git a/course/tests/fixtures/mock_hooks.php b/course/tests/fixtures/mock_hooks.php index b1bc5bcdfd5..e259ab9b70d 100644 --- a/course/tests/fixtures/mock_hooks.php +++ b/course/tests/fixtures/mock_hooks.php @@ -76,7 +76,7 @@ namespace core_course\test { * * @return bool */ - public static function get_can_course_category_delete_return() : bool { + public static function get_can_course_category_delete_return(): bool { return self::$cancoursecategorydelete; } @@ -94,7 +94,7 @@ namespace core_course\test { * * @return bool */ - public static function get_can_course_category_delete_move_return() : bool { + public static function get_can_course_category_delete_move_return(): bool { return self::$cancoursecategorydeletemove; } @@ -112,7 +112,7 @@ namespace core_course\test { * * @return string */ - public static function get_get_course_category_contents_return() : string { + public static function get_get_course_category_contents_return(): string { return self::$getcoursecategorycontents; } diff --git a/customfield/classes/api.php b/customfield/classes/api.php index 08e744ae4dc..c9988376900 100644 --- a/customfield/classes/api.php +++ b/customfield/classes/api.php @@ -54,7 +54,7 @@ class api { * If ($adddefaults): All fieldids are present, some data_controller objects may have 'id', some not. * If (!$adddefaults): Only fieldids with data are present, all data_controller objects have 'id'. */ - public static function get_instance_fields_data(array $fields, int $instanceid, bool $adddefaults = true) : array { + public static function get_instance_fields_data(array $fields, int $instanceid, bool $adddefaults = true): array { return self::get_instances_fields_data($fields, [$instanceid], $adddefaults)[$instanceid]; } @@ -69,7 +69,7 @@ class api { * If (!$adddefaults): All instanceids are present but only fieldids with data are present, all * data_controller objects have 'id'. */ - public static function get_instances_fields_data(array $fields, array $instanceids, bool $adddefaults = true) : array { + public static function get_instances_fields_data(array $fields, array $instanceids, bool $adddefaults = true): array { global $DB; // Create the results array where instances and fields order is the same as in the input arrays. @@ -230,7 +230,7 @@ class api { * * @param field_controller $field */ - public static function delete_field_configuration(field_controller $field) : bool { + public static function delete_field_configuration(field_controller $field): bool { $event = field_deleted::create_from_object($field); get_file_storage()->delete_area_files($field->get_handler()->get_configuration_context()->id, 'core_customfield', 'description', $field->get('id')); @@ -246,7 +246,7 @@ class api { * @param bool $editable * @return inplace_editable */ - public static function get_category_inplace_editable(category_controller $category, bool $editable = true) : inplace_editable { + public static function get_category_inplace_editable(category_controller $category, bool $editable = true): inplace_editable { return new inplace_editable('core_customfield', 'category', $category->get('id'), @@ -318,7 +318,7 @@ class api { * @param category_controller $category * @return bool */ - public static function delete_category(category_controller $category) : bool { + public static function delete_category(category_controller $category): bool { $event = category_deleted::create_from_object($category); // Delete all fields. @@ -339,7 +339,7 @@ class api { * @param int $itemid * @return category_controller[] */ - public static function get_categories_with_fields(string $component, string $area, int $itemid) : array { + public static function get_categories_with_fields(string $component, string $area, int $itemid): array { global $DB; $categories = []; @@ -397,7 +397,7 @@ class api { * @param field_controller $field * @return \stdClass */ - public static function prepare_field_for_config_form(field_controller $field) : \stdClass { + public static function prepare_field_for_config_form(field_controller $field): \stdClass { if ($field->get('id')) { $formdata = $field->to_record(); $formdata->configdata = $field->get('configdata'); diff --git a/customfield/classes/category.php b/customfield/classes/category.php index dd89f556bad..0a7dff99851 100644 --- a/customfield/classes/category.php +++ b/customfield/classes/category.php @@ -46,7 +46,7 @@ class category extends persistent { * * @return array */ - protected static function define_properties() : array { + protected static function define_properties(): array { return array( 'name' => [ 'type' => PARAM_TEXT, diff --git a/customfield/classes/category_controller.php b/customfield/classes/category_controller.php index 601b10616ab..ee2e3fc6a62 100644 --- a/customfield/classes/category_controller.php +++ b/customfield/classes/category_controller.php @@ -77,7 +77,7 @@ class category_controller { * @throws \moodle_exception * @throws \coding_exception */ - public static function create(int $id, \stdClass $record = null, handler $handler = null) : category_controller { + public static function create(int $id, \stdClass $record = null, handler $handler = null): category_controller { global $DB; if ($id && $record) { // This warning really should be in persistent as well. @@ -180,7 +180,7 @@ class category_controller { * * @return handler */ - public function get_handler() : handler { + public function get_handler(): handler { if ($this->handler === null) { $this->handler = handler::get_handler($this->get('component'), $this->get('area'), $this->get('itemid')); } @@ -224,7 +224,7 @@ class category_controller { * * @return string */ - public function get_formatted_name() : string { + public function get_formatted_name(): string { $context = $this->get_handler()->get_configuration_context(); return format_string($this->get('name'), true, ['context' => $context]); } diff --git a/customfield/classes/data.php b/customfield/classes/data.php index d402d321c61..677bf24485b 100644 --- a/customfield/classes/data.php +++ b/customfield/classes/data.php @@ -47,7 +47,7 @@ class data extends persistent { * * @return array */ - protected static function define_properties() : array { + protected static function define_properties(): array { return array( 'fieldid' => [ 'type' => PARAM_INT, diff --git a/customfield/classes/data_controller.php b/customfield/classes/data_controller.php index 3c51d77c6fe..300df61f1c1 100644 --- a/customfield/classes/data_controller.php +++ b/customfield/classes/data_controller.php @@ -83,7 +83,7 @@ abstract class data_controller { * @throws \coding_exception * @throws \moodle_exception */ - public static function create(int $id, \stdClass $record = null, field_controller $field = null) : data_controller { + public static function create(int $id, \stdClass $record = null, field_controller $field = null): data_controller { global $DB; if ($id && $record) { // This warning really should be in persistent as well. @@ -123,7 +123,7 @@ abstract class data_controller { * * @return string */ - public function get_form_element_name() : string { + public function get_form_element_name(): string { return 'customfield_' . $this->get_field()->get('shortname'); } @@ -161,7 +161,7 @@ abstract class data_controller { * * @return string */ - abstract public function datafield() : string; + abstract public function datafield(): string; /** * Delete data. Element can override it if related information needs to be deleted as well (such as files) @@ -186,7 +186,7 @@ abstract class data_controller { * * @return field_controller */ - public function get_field() : field_controller { + public function get_field(): field_controller { return $this->field; } @@ -224,7 +224,7 @@ abstract class data_controller { * @param mixed $value * @return bool */ - protected function is_empty($value) : bool { + protected function is_empty($value): bool { if ($this->datafield() === 'value' || $this->datafield() === 'charvalue' || $this->datafield() === 'shortcharvalue') { return '' . $value === ''; } @@ -237,7 +237,7 @@ abstract class data_controller { * @param mixed $value * @return bool */ - protected function is_unique($value) : bool { + protected function is_unique($value): bool { global $DB; // Ensure the "value" datafield can be safely compared across all databases. @@ -262,7 +262,7 @@ abstract class data_controller { * @param array $files * @return array array of errors */ - public function instance_form_validation(array $data, array $files) : array { + public function instance_form_validation(array $data, array $files): array { $errors = []; $elementname = $this->get_form_element_name(); if ($this->get_field()->get_configdata_property('uniquevalues') == 1) { @@ -288,7 +288,7 @@ abstract class data_controller { * * @return string */ - public function display() : string { + public function display(): string { global $PAGE; $output = $PAGE->get_renderer('core_customfield'); return $output->render(new field_data($this)); @@ -318,7 +318,7 @@ abstract class data_controller { * * @return \context */ - public function get_context() : \context { + public function get_context(): \context { if ($this->get('contextid')) { return \context::instance_by_id($this->get('contextid')); } else if ($this->get('instanceid')) { diff --git a/customfield/classes/event/category_created.php b/customfield/classes/event/category_created.php index 5a83d290f82..b5234e03f3f 100644 --- a/customfield/classes/event/category_created.php +++ b/customfield/classes/event/category_created.php @@ -53,7 +53,7 @@ class category_created extends \core\event\base { * @param category_controller $category * @return category_created */ - public static function create_from_object(category_controller $category) : category_created { + public static function create_from_object(category_controller $category): category_created { $eventparams = [ 'objectid' => $category->get('id'), 'context' => $category->get_handler()->get_configuration_context(), diff --git a/customfield/classes/event/category_deleted.php b/customfield/classes/event/category_deleted.php index 1e08f258cb5..ce6064db846 100644 --- a/customfield/classes/event/category_deleted.php +++ b/customfield/classes/event/category_deleted.php @@ -53,7 +53,7 @@ class category_deleted extends \core\event\base { * @param category_controller $category * @return category_deleted */ - public static function create_from_object(category_controller $category) : category_deleted { + public static function create_from_object(category_controller $category): category_deleted { $eventparams = [ 'objectid' => $category->get('id'), 'context' => $category->get_handler()->get_configuration_context(), diff --git a/customfield/classes/event/category_updated.php b/customfield/classes/event/category_updated.php index ba7bc2c1d6b..2006c12344a 100644 --- a/customfield/classes/event/category_updated.php +++ b/customfield/classes/event/category_updated.php @@ -53,7 +53,7 @@ class category_updated extends \core\event\base { * @param category_controller $category * @return category_updated */ - public static function create_from_object(category_controller $category) : category_updated { + public static function create_from_object(category_controller $category): category_updated { $eventparams = [ 'objectid' => $category->get('id'), 'context' => $category->get_handler()->get_configuration_context(), diff --git a/customfield/classes/event/field_created.php b/customfield/classes/event/field_created.php index 20d4f556532..cdb016787dd 100644 --- a/customfield/classes/event/field_created.php +++ b/customfield/classes/event/field_created.php @@ -53,7 +53,7 @@ class field_created extends \core\event\base { * @param field_controller $field * @return field_created */ - public static function create_from_object(field_controller $field) : field_created { + public static function create_from_object(field_controller $field): field_created { $eventparams = [ 'objectid' => $field->get('id'), 'context' => $field->get_handler()->get_configuration_context(), diff --git a/customfield/classes/event/field_deleted.php b/customfield/classes/event/field_deleted.php index 586705d21cd..f3c935f21fa 100644 --- a/customfield/classes/event/field_deleted.php +++ b/customfield/classes/event/field_deleted.php @@ -53,7 +53,7 @@ class field_deleted extends \core\event\base { * @param field_controller $field * @return field_deleted */ - public static function create_from_object(field_controller $field) : field_deleted { + public static function create_from_object(field_controller $field): field_deleted { $eventparams = [ 'objectid' => $field->get('id'), 'context' => $field->get_handler()->get_configuration_context(), diff --git a/customfield/classes/event/field_updated.php b/customfield/classes/event/field_updated.php index 619a4a4dad4..02a17f2e605 100644 --- a/customfield/classes/event/field_updated.php +++ b/customfield/classes/event/field_updated.php @@ -53,7 +53,7 @@ class field_updated extends \core\event\base { * @param field_controller $field * @return field_updated */ - public static function create_from_object(field_controller $field) : field_updated { + public static function create_from_object(field_controller $field): field_updated { $eventparams = [ 'objectid' => $field->get('id'), 'context' => $field->get_handler()->get_configuration_context(), diff --git a/customfield/classes/field.php b/customfield/classes/field.php index 7bd440abce1..7ba3ffced34 100644 --- a/customfield/classes/field.php +++ b/customfield/classes/field.php @@ -47,7 +47,7 @@ class field extends persistent { * * @return array */ - protected static function define_properties() : array { + protected static function define_properties(): array { return array( 'name' => [ 'type' => PARAM_TEXT, @@ -91,7 +91,7 @@ class field extends persistent { * * @return array */ - protected function get_configdata() : array { + protected function get_configdata(): array { return json_decode($this->raw_get('configdata') ?? '', true) ?? array(); } } diff --git a/customfield/classes/field_controller.php b/customfield/classes/field_controller.php index 5dea8aac877..cd4abe91279 100644 --- a/customfield/classes/field_controller.php +++ b/customfield/classes/field_controller.php @@ -81,7 +81,7 @@ abstract class field_controller { * @throws \coding_exception * @throws \moodle_exception */ - public static function create(int $id, \stdClass $record = null, category_controller $category = null) : field_controller { + public static function create(int $id, \stdClass $record = null, category_controller $category = null): field_controller { global $DB; if ($id && $record) { // This warning really should be in persistent as well. @@ -144,7 +144,7 @@ abstract class field_controller { * @param array $files * @return array associative array of error messages */ - public function config_form_validation(array $data, $files = array()) : array { + public function config_form_validation(array $data, $files = array()): array { return array(); } @@ -179,7 +179,7 @@ abstract class field_controller { * * @return bool */ - public function delete() : bool { + public function delete(): bool { global $DB; $DB->delete_records('customfield_data', ['fieldid' => $this->get('id')]); return $this->field->delete(); @@ -208,7 +208,7 @@ abstract class field_controller { * * @return category_controller */ - public final function get_category() : category_controller { + public final function get_category(): category_controller { return $this->category; } @@ -231,7 +231,7 @@ abstract class field_controller { * * @return handler */ - public final function get_handler() : handler { + public final function get_handler(): handler { return $this->get_category()->get_handler(); } @@ -257,7 +257,7 @@ abstract class field_controller { * * @return string */ - public function get_formatted_name() : string { + public function get_formatted_name(): string { $context = $this->get_handler()->get_configuration_context(); return format_string($this->get('name'), true, ['context' => $context]); } diff --git a/customfield/classes/handler.php b/customfield/classes/handler.php index a6cd753a2ab..2c286d0bfe9 100644 --- a/customfield/classes/handler.php +++ b/customfield/classes/handler.php @@ -100,7 +100,7 @@ abstract class handler { * @param int $itemid * @return handler */ - public static function create(int $itemid = 0) : handler { + public static function create(int $itemid = 0): handler { return new static($itemid); } @@ -112,7 +112,7 @@ abstract class handler { * @param int $itemid item id if the area uses them (usually not used) * @return handler */ - public static function get_handler(string $component, string $area, int $itemid = 0) : handler { + public static function get_handler(string $component, string $area, int $itemid = 0): handler { $classname = $component . '\\customfield\\' . $area . '_handler'; if (class_exists($classname) && is_subclass_of($classname, self::class)) { return $classname::create($itemid); @@ -126,7 +126,7 @@ abstract class handler { * * @return string */ - public function get_component() : string { + public function get_component(): string { return $this->component; } @@ -135,7 +135,7 @@ abstract class handler { * * @return string */ - public function get_area() : string { + public function get_area(): string { return $this->area; } @@ -144,14 +144,14 @@ abstract class handler { * * @return \context */ - abstract public function get_configuration_context() : \context; + abstract public function get_configuration_context(): \context; /** * URL for configuration of the fields on this handler. * * @return \moodle_url */ - abstract public function get_configuration_url() : \moodle_url; + abstract public function get_configuration_url(): \moodle_url; /** * Context that should be used for data stored for the given record @@ -159,14 +159,14 @@ abstract class handler { * @param int $instanceid id of the instance or 0 if the instance is being created * @return \context */ - abstract public function get_instance_context(int $instanceid = 0) : \context; + abstract public function get_instance_context(int $instanceid = 0): \context; /** * Get itemid * * @return int|null */ - public function get_itemid() : int { + public function get_itemid(): int { return $this->itemid; } @@ -175,7 +175,7 @@ abstract class handler { * * @return bool */ - public function uses_categories() : bool { + public function uses_categories(): bool { return true; } @@ -185,7 +185,7 @@ abstract class handler { * @param int $suffix * @return string */ - protected function generate_category_name($suffix = 0) : string { + protected function generate_category_name($suffix = 0): string { if ($suffix) { return get_string('otherfieldsn', 'core_customfield', $suffix); } else { @@ -199,7 +199,7 @@ abstract class handler { * @param string $name name of the category, null to generate automatically * @return int id of the new category */ - public function create_category(string $name = null) : int { + public function create_category(string $name = null): int { global $DB; $params = ['component' => $this->get_component(), 'area' => $this->get_area(), 'itemid' => $this->get_itemid()]; @@ -225,7 +225,7 @@ abstract class handler { * @return category_controller * @throws \moodle_exception */ - protected function validate_category(category_controller $category) : category_controller { + protected function validate_category(category_controller $category): category_controller { $categories = $this->get_categories_with_fields(); if (!array_key_exists($category->get('id'), $categories)) { throw new \moodle_exception('categorynotfound', 'core_customfield'); @@ -240,7 +240,7 @@ abstract class handler { * @return field_controller * @throws \moodle_exception */ - protected function validate_field(field_controller $field) : field_controller { + protected function validate_field(field_controller $field): field_controller { if (!array_key_exists($field->get('categoryid'), $this->get_categories_with_fields())) { throw new \moodle_exception('fieldnotfound', 'core_customfield'); } @@ -282,7 +282,7 @@ abstract class handler { * @param category_controller $category * @return bool */ - public function delete_category(category_controller $category) : bool { + public function delete_category(category_controller $category): bool { $category = $this->validate_category($category); $result = api::delete_category($category); $this->clear_configuration_cache(); @@ -306,7 +306,7 @@ abstract class handler { * @param field_controller $field * @return bool */ - public function delete_field_configuration(field_controller $field) : bool { + public function delete_field_configuration(field_controller $field): bool { $field = $this->validate_field($field); $result = api::delete_field_configuration($field); $this->clear_configuration_cache(); @@ -331,7 +331,7 @@ abstract class handler { * * @return bool */ - abstract public function can_configure() : bool; + abstract public function can_configure(): bool; /** * The current user can edit given custom fields on the given instance @@ -344,7 +344,7 @@ abstract class handler { * @param int $instanceid id of the instance or 0 if the instance is being created * @return bool */ - abstract public function can_edit(field_controller $field, int $instanceid = 0) : bool; + abstract public function can_edit(field_controller $field, int $instanceid = 0): bool; /** * The current user can view the value of the custom field for a given custom field and instance @@ -358,7 +358,7 @@ abstract class handler { * @param int $instanceid * @return bool */ - abstract public function can_view(field_controller $field, int $instanceid) : bool; + abstract public function can_view(field_controller $field, int $instanceid): bool; /** * Returns the custom field values for an individual instance @@ -373,7 +373,7 @@ abstract class handler { * some data_controller objects may have 'id', some not * In the last case data_controller::get_value() and export_value() functions will return default values. */ - public function get_instance_data(int $instanceid, bool $returnall = false) : array { + public function get_instance_data(int $instanceid, bool $returnall = false): array { $fields = $returnall ? $this->get_fields() : $this->get_visible_fields($instanceid); return api::get_instance_fields_data($fields, $instanceid); } @@ -391,7 +391,7 @@ abstract class handler { * All instanceids and all fieldids are present, some data_controller objects may have 'id', some not. * In the last case data_controller::get_value() and export_value() functions will return default values. */ - public function get_instances_data(array $instanceids, bool $returnall = false) : array { + public function get_instances_data(array $instanceids, bool $returnall = false): array { $result = api::get_instances_fields_data($this->get_fields(), $instanceids); if (!$returnall) { @@ -417,7 +417,7 @@ abstract class handler { * @param bool $returnall * @return \core_customfield\output\field_data[] */ - public function export_instance_data(int $instanceid, bool $returnall = false) : array { + public function export_instance_data(int $instanceid, bool $returnall = false): array { return array_map(function($d) { return new field_data($d); }, $this->get_instance_data($instanceid, $returnall)); @@ -434,7 +434,7 @@ abstract class handler { * @param bool $returnall * @return stdClass */ - public function export_instance_data_object(int $instanceid, bool $returnall = false) : stdClass { + public function export_instance_data_object(int $instanceid, bool $returnall = false): stdClass { $rv = new stdClass(); foreach ($this->export_instance_data($instanceid, $returnall) as $d) { $rv->{$d->get_shortname()} = $d->get_value(); @@ -449,7 +449,7 @@ abstract class handler { * @param data_controller[] $fieldsdata * @return string */ - public function display_custom_fields_data(array $fieldsdata) : string { + public function display_custom_fields_data(array $fieldsdata): string { global $PAGE; $output = $PAGE->get_renderer('core_customfield'); $content = ''; @@ -466,7 +466,7 @@ abstract class handler { * * @return category_controller[] */ - public function get_categories_with_fields() : array { + public function get_categories_with_fields(): array { if ($this->categories === null) { $this->categories = api::get_categories_with_fields($this->get_component(), $this->get_area(), $this->get_itemid()); } @@ -493,7 +493,7 @@ abstract class handler { * @param int $instanceid * @return bool */ - protected function can_backup(field_controller $field, int $instanceid) : bool { + protected function can_backup(field_controller $field, int $instanceid): bool { return $this->can_view($field, $instanceid) || $this->can_edit($field, $instanceid); } @@ -534,7 +534,7 @@ abstract class handler { * @param int $instanceid * @return array */ - public function get_instance_data_for_backup(int $instanceid) : array { + public function get_instance_data_for_backup(int $instanceid): array { $finalfields = []; $data = $this->get_instance_data($instanceid, true); foreach ($data as $d) { @@ -700,7 +700,7 @@ abstract class handler { * * @return array */ - public function get_available_field_types() :array { + public function get_available_field_types(): array { return api::get_available_field_types(); } @@ -712,7 +712,7 @@ abstract class handler { * * @return array */ - public function get_description_text_options() : array { + public function get_description_text_options(): array { global $CFG; require_once($CFG->libdir.'/formslib.php'); return [ @@ -761,7 +761,7 @@ abstract class handler { * * @return field_controller[] */ - public function get_fields() : array { + public function get_fields(): array { $categories = $this->get_categories_with_fields(); $fields = []; foreach ($categories as $category) { @@ -778,7 +778,7 @@ abstract class handler { * @param int $instanceid * @return field_controller[] */ - protected function get_visible_fields(int $instanceid) : array { + protected function get_visible_fields(int $instanceid): array { $handler = $this; return array_filter($this->get_fields(), function($field) use($handler, $instanceid) { @@ -793,7 +793,7 @@ abstract class handler { * @param int $instanceid * @return field_controller[] */ - public function get_editable_fields(int $instanceid) : array { + public function get_editable_fields(int $instanceid): array { $handler = $this; return array_filter($this->get_fields(), function($field) use($handler, $instanceid) { diff --git a/customfield/classes/output/field_data.php b/customfield/classes/output/field_data.php index 76f261d21f1..8f515a975de 100644 --- a/customfield/classes/output/field_data.php +++ b/customfield/classes/output/field_data.php @@ -63,7 +63,7 @@ class field_data implements \renderable, \templatable { * * @return string */ - public function get_type() : string { + public function get_type(): string { return $this->data->get_field()->get('type'); } @@ -72,7 +72,7 @@ class field_data implements \renderable, \templatable { * * @return string */ - public function get_shortname() : string { + public function get_shortname(): string { return $this->data->get_field()->get('shortname'); } @@ -81,7 +81,7 @@ class field_data implements \renderable, \templatable { * * @return string */ - public function get_name() : string { + public function get_name(): string { return $this->data->get_field()->get_formatted_name(); } @@ -90,7 +90,7 @@ class field_data implements \renderable, \templatable { * * @return data_controller */ - public function get_data_controller() : data_controller { + public function get_data_controller(): data_controller { return $this->data; } diff --git a/customfield/classes/privacy/provider.php b/customfield/classes/privacy/provider.php index 4111153913f..979912829c9 100644 --- a/customfield/classes/privacy/provider.php +++ b/customfield/classes/privacy/provider.php @@ -60,7 +60,7 @@ class provider implements * @param collection $collection a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_database_table( 'customfield_data', [ @@ -103,7 +103,7 @@ class provider implements * @return contextlist */ public static function get_customfields_data_contexts(string $component, string $area, - string $itemidstest = 'IS NOT NULL', string $instanceidstest = 'IS NOT NULL', array $params = []) : contextlist { + string $itemidstest = 'IS NOT NULL', string $instanceidstest = 'IS NOT NULL', array $params = []): contextlist { $sql = "SELECT d.contextid FROM {customfield_category} c JOIN {customfield_field} f ON f.categoryid = c.id @@ -130,7 +130,7 @@ class provider implements * @return contextlist */ public static function get_customfields_configuration_contexts(string $component, string $area, - string $itemidstest = 'IS NOT NULL', array $params = []) : contextlist { + string $itemidstest = 'IS NOT NULL', array $params = []): contextlist { $sql = "SELECT c.contextid FROM {customfield_category} c WHERE c.component = :cfcomponent AND c.area = :cfarea AND c.itemid $itemidstest"; @@ -331,7 +331,7 @@ class provider implements * @return array * @throws \coding_exception */ - protected static function get_params(string $component, string $area, array $params) : array { + protected static function get_params(string $component, string $area, array $params): array { if (!empty($params) && (array_keys($params) === range(0, count($params) - 1))) { // Argument $params is not an associative array. throw new \coding_exception('Argument $params must be an associative array!'); diff --git a/customfield/field/checkbox/classes/data_controller.php b/customfield/field/checkbox/classes/data_controller.php index 4d080d7c449..f1a332cfbcc 100644 --- a/customfield/field/checkbox/classes/data_controller.php +++ b/customfield/field/checkbox/classes/data_controller.php @@ -42,7 +42,7 @@ class data_controller extends \core_customfield\data_controller { * Return the name of the field where the information is stored * @return string */ - public function datafield() : string { + public function datafield(): string { return 'intvalue'; } diff --git a/customfield/field/checkbox/classes/field_controller.php b/customfield/field/checkbox/classes/field_controller.php index 6e4f6474798..27af66265f2 100644 --- a/customfield/field/checkbox/classes/field_controller.php +++ b/customfield/field/checkbox/classes/field_controller.php @@ -59,7 +59,7 @@ class field_controller extends \core_customfield\field_controller { * @param array $files * @return array associative array of error messages */ - public function config_form_validation(array $data, $files = array()) : array { + public function config_form_validation(array $data, $files = array()): array { $errors = parent::config_form_validation($data, $files); if ($data['configdata']['uniquevalues']) { diff --git a/customfield/field/checkbox/classes/privacy/provider.php b/customfield/field/checkbox/classes/privacy/provider.php index f892009dcc7..caae770e7c7 100644 --- a/customfield/field/checkbox/classes/privacy/provider.php +++ b/customfield/field/checkbox/classes/privacy/provider.php @@ -43,7 +43,7 @@ class provider implements \core_privacy\local\metadata\null_provider, customfiel * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/customfield/field/checkbox/tests/plugin_test.php b/customfield/field/checkbox/tests/plugin_test.php index 23be0555258..5453eded900 100644 --- a/customfield/field/checkbox/tests/plugin_test.php +++ b/customfield/field/checkbox/tests/plugin_test.php @@ -68,7 +68,7 @@ class plugin_test extends \advanced_testcase { * Get generator * @return core_customfield_generator */ - protected function get_generator() : core_customfield_generator { + protected function get_generator(): core_customfield_generator { return $this->getDataGenerator()->get_plugin_generator('core_customfield'); } diff --git a/customfield/field/date/classes/data_controller.php b/customfield/field/date/classes/data_controller.php index 98115e46631..70b3809b63d 100644 --- a/customfield/field/date/classes/data_controller.php +++ b/customfield/field/date/classes/data_controller.php @@ -41,7 +41,7 @@ class data_controller extends \core_customfield\data_controller { * Return the name of the field where the information is stored * @return string */ - public function datafield() : string { + public function datafield(): string { return 'intvalue'; } @@ -90,7 +90,7 @@ class data_controller extends \core_customfield\data_controller { * @param array $files * @return array */ - public function instance_form_validation(array $data, array $files) : array { + public function instance_form_validation(array $data, array $files): array { $errors = parent::instance_form_validation($data, $files); $elementname = $this->get_form_element_name(); diff --git a/customfield/field/date/classes/field_controller.php b/customfield/field/date/classes/field_controller.php index f8fb5adc6e0..af2bf95715c 100644 --- a/customfield/field/date/classes/field_controller.php +++ b/customfield/field/date/classes/field_controller.php @@ -46,7 +46,7 @@ class field_controller extends \core_customfield\field_controller { * @param array $files * @return array associative array of error messages */ - public function config_form_validation(array $data, $files = array()) : array { + public function config_form_validation(array $data, $files = array()): array { $errors = array(); // Make sure the start year is not greater than the end year. diff --git a/customfield/field/date/classes/privacy/provider.php b/customfield/field/date/classes/privacy/provider.php index 74a6358d2f9..b9605a5020b 100644 --- a/customfield/field/date/classes/privacy/provider.php +++ b/customfield/field/date/classes/privacy/provider.php @@ -43,7 +43,7 @@ class provider implements \core_privacy\local\metadata\null_provider, customfiel * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/customfield/field/date/tests/plugin_test.php b/customfield/field/date/tests/plugin_test.php index a2cd087c78c..8b15fb8825d 100644 --- a/customfield/field/date/tests/plugin_test.php +++ b/customfield/field/date/tests/plugin_test.php @@ -65,7 +65,7 @@ class plugin_test extends \advanced_testcase { * Get generator * @return core_customfield_generator */ - protected function get_generator() : core_customfield_generator { + protected function get_generator(): core_customfield_generator { return $this->getDataGenerator()->get_plugin_generator('core_customfield'); } @@ -169,7 +169,7 @@ class plugin_test extends \advanced_testcase { * * @return array */ - public function parse_value_provider() : array { + public function parse_value_provider(): array { return [ // Valid times. ['2019-10-01', strtotime('2019-10-01')], diff --git a/customfield/field/select/classes/data_controller.php b/customfield/field/select/classes/data_controller.php index 73116b72eb0..8f50bcb227c 100644 --- a/customfield/field/select/classes/data_controller.php +++ b/customfield/field/select/classes/data_controller.php @@ -39,7 +39,7 @@ class data_controller extends \core_customfield\data_controller { * Return the name of the field where the information is stored * @return string */ - public function datafield() : string { + public function datafield(): string { return 'intvalue'; } @@ -93,7 +93,7 @@ class data_controller extends \core_customfield\data_controller { * @param array $files * @return array */ - public function instance_form_validation(array $data, array $files) : array { + public function instance_form_validation(array $data, array $files): array { $errors = parent::instance_form_validation($data, $files); if ($this->get_field()->get_configdata_property('required')) { // Standard required rule does not work on select element. diff --git a/customfield/field/select/classes/field_controller.php b/customfield/field/select/classes/field_controller.php index c2dca2ee8e8..3b18762c07e 100644 --- a/customfield/field/select/classes/field_controller.php +++ b/customfield/field/select/classes/field_controller.php @@ -77,7 +77,7 @@ class field_controller extends \core_customfield\field_controller { * @param array $files * @return array associative array of error messages */ - public function config_form_validation(array $data, $files = array()) : array { + public function config_form_validation(array $data, $files = array()): array { $options = preg_split("/\s*\n\s*/", trim($data['configdata']['options'])); $errors = []; if (!$options || count($options) < 2) { diff --git a/customfield/field/select/classes/privacy/provider.php b/customfield/field/select/classes/privacy/provider.php index e1c55473b79..cde7d95994b 100644 --- a/customfield/field/select/classes/privacy/provider.php +++ b/customfield/field/select/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements \core_privacy\local\metadata\null_provider, customfiel * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/customfield/field/select/tests/plugin_test.php b/customfield/field/select/tests/plugin_test.php index 97194efbeec..77fdf2950af 100644 --- a/customfield/field/select/tests/plugin_test.php +++ b/customfield/field/select/tests/plugin_test.php @@ -69,7 +69,7 @@ class plugin_test extends \advanced_testcase { * Get generator * @return core_customfield_generator */ - protected function get_generator() : core_customfield_generator { + protected function get_generator(): core_customfield_generator { return $this->getDataGenerator()->get_plugin_generator('core_customfield'); } @@ -155,7 +155,7 @@ class plugin_test extends \advanced_testcase { * * @return array */ - public function parse_value_provider() : array { + public function parse_value_provider(): array { return [ ['Red', 1], ['Blue', 2], diff --git a/customfield/field/text/classes/data_controller.php b/customfield/field/text/classes/data_controller.php index 5d1562b947d..d3ff817af61 100644 --- a/customfield/field/text/classes/data_controller.php +++ b/customfield/field/text/classes/data_controller.php @@ -41,7 +41,7 @@ class data_controller extends \core_customfield\data_controller { * Return the name of the field where the information is stored * @return string */ - public function datafield() : string { + public function datafield(): string { return 'charvalue'; } @@ -72,7 +72,7 @@ class data_controller extends \core_customfield\data_controller { * @param array $files * @return array */ - public function instance_form_validation(array $data, array $files) : array { + public function instance_form_validation(array $data, array $files): array { $errors = parent::instance_form_validation($data, $files); $maxlength = $this->get_field()->get_configdata_property('maxlength'); diff --git a/customfield/field/text/classes/field_controller.php b/customfield/field/text/classes/field_controller.php index 0a71d051539..460ba880515 100644 --- a/customfield/field/text/classes/field_controller.php +++ b/customfield/field/text/classes/field_controller.php @@ -95,7 +95,7 @@ class field_controller extends \core_customfield\field_controller { * @param array $files * @return array associative array of error messages */ - public function config_form_validation(array $data, $files = array()) : array { + public function config_form_validation(array $data, $files = array()): array { global $CFG; $errors = parent::config_form_validation($data, $files); diff --git a/customfield/field/text/classes/privacy/provider.php b/customfield/field/text/classes/privacy/provider.php index 59371459fd8..16cbc53df44 100644 --- a/customfield/field/text/classes/privacy/provider.php +++ b/customfield/field/text/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements \core_privacy\local\metadata\null_provider, customfiel * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/customfield/field/text/tests/plugin_test.php b/customfield/field/text/tests/plugin_test.php index dc686ad0f86..837c23da7b6 100644 --- a/customfield/field/text/tests/plugin_test.php +++ b/customfield/field/text/tests/plugin_test.php @@ -74,7 +74,7 @@ class plugin_test extends \advanced_testcase { * Get generator * @return core_customfield_generator */ - protected function get_generator() : core_customfield_generator { + protected function get_generator(): core_customfield_generator { return $this->getDataGenerator()->get_plugin_generator('core_customfield'); } diff --git a/customfield/field/textarea/classes/data_controller.php b/customfield/field/textarea/classes/data_controller.php index f3eb5af074e..2e0eee71cfa 100644 --- a/customfield/field/textarea/classes/data_controller.php +++ b/customfield/field/textarea/classes/data_controller.php @@ -41,7 +41,7 @@ class data_controller extends \core_customfield\data_controller { * Return the name of the field where the information is stored * @return string */ - public function datafield() : string { + public function datafield(): string { return 'value'; } @@ -61,7 +61,7 @@ class data_controller extends \core_customfield\data_controller { * * @return string */ - public function get_form_element_name() : string { + public function get_form_element_name(): string { return parent::get_form_element_name() . '_editor'; } diff --git a/customfield/field/textarea/classes/field_controller.php b/customfield/field/textarea/classes/field_controller.php index d0a84b480c7..a3955bd2719 100644 --- a/customfield/field/textarea/classes/field_controller.php +++ b/customfield/field/textarea/classes/field_controller.php @@ -42,7 +42,7 @@ class field_controller extends \core_customfield\field_controller { /** * Before delete bulk actions */ - public function delete() : bool { + public function delete(): bool { global $DB; $fs = get_file_storage(); diff --git a/customfield/field/textarea/classes/privacy/provider.php b/customfield/field/textarea/classes/privacy/provider.php index f8924c90c9c..3458328ca74 100644 --- a/customfield/field/textarea/classes/privacy/provider.php +++ b/customfield/field/textarea/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements \core_privacy\local\metadata\null_provider, customfiel * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/customfield/field/textarea/tests/plugin_test.php b/customfield/field/textarea/tests/plugin_test.php index df27b1175d2..bedef623054 100644 --- a/customfield/field/textarea/tests/plugin_test.php +++ b/customfield/field/textarea/tests/plugin_test.php @@ -73,7 +73,7 @@ class plugin_test extends \advanced_testcase { * Get generator * @return core_customfield_generator */ - protected function get_generator() : core_customfield_generator { + protected function get_generator(): core_customfield_generator { return $this->getDataGenerator()->get_plugin_generator('core_customfield'); } diff --git a/customfield/tests/generator/lib.php b/customfield/tests/generator/lib.php index a72c8caa363..eae8490154f 100644 --- a/customfield/tests/generator/lib.php +++ b/customfield/tests/generator/lib.php @@ -80,7 +80,7 @@ class core_customfield_generator extends component_generator_base { * @param array|stdClass $record * @return field_controller */ - public function create_field($record) : field_controller { + public function create_field($record): field_controller { $this->fieldcount++; $i = $this->fieldcount; $record = (object) $record; @@ -150,7 +150,7 @@ class core_customfield_generator extends component_generator_base { * @param mixed $value * @return \core_customfield\data_controller */ - public function add_instance_data(field_controller $field, int $instanceid, $value) : \core_customfield\data_controller { + public function add_instance_data(field_controller $field, int $instanceid, $value): \core_customfield\data_controller { $data = \core_customfield\data_controller::create(0, (object)['instanceid' => $instanceid], $field); $data->set('contextid', $data->get_context()->id); diff --git a/dataformat/csv/classes/privacy/provider.php b/dataformat/csv/classes/privacy/provider.php index 4f90fa00b44..2b6392c950c 100644 --- a/dataformat/csv/classes/privacy/provider.php +++ b/dataformat/csv/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/dataformat/excel/classes/privacy/provider.php b/dataformat/excel/classes/privacy/provider.php index a688ca8728d..eb967aeb701 100644 --- a/dataformat/excel/classes/privacy/provider.php +++ b/dataformat/excel/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/dataformat/html/classes/privacy/provider.php b/dataformat/html/classes/privacy/provider.php index a024e640bc9..9d8a687ba14 100644 --- a/dataformat/html/classes/privacy/provider.php +++ b/dataformat/html/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/dataformat/json/classes/privacy/provider.php b/dataformat/json/classes/privacy/provider.php index 784f3deec24..e3c0426e6f6 100644 --- a/dataformat/json/classes/privacy/provider.php +++ b/dataformat/json/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/dataformat/ods/classes/privacy/provider.php b/dataformat/ods/classes/privacy/provider.php index 0c2a612c5e4..ec4a37dcfb8 100644 --- a/dataformat/ods/classes/privacy/provider.php +++ b/dataformat/ods/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/dataformat/pdf/classes/privacy/provider.php b/dataformat/pdf/classes/privacy/provider.php index 770142b1dcf..04b6180dab9 100644 --- a/dataformat/pdf/classes/privacy/provider.php +++ b/dataformat/pdf/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/enrol/category/classes/privacy/provider.php b/enrol/category/classes/privacy/provider.php index 47ced3ec322..55c369faaa9 100644 --- a/enrol/category/classes/privacy/provider.php +++ b/enrol/category/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/enrol/classes/privacy/provider.php b/enrol/classes/privacy/provider.php index 8deac388afa..d19f68a7108 100644 --- a/enrol/classes/privacy/provider.php +++ b/enrol/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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( 'user_enrolments', [ @@ -74,7 +74,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_enrolments} ue JOIN {enrol} e diff --git a/enrol/cohort/classes/privacy/provider.php b/enrol/cohort/classes/privacy/provider.php index caed9b0b71e..97215d6dce6 100644 --- a/enrol/cohort/classes/privacy/provider.php +++ b/enrol/cohort/classes/privacy/provider.php @@ -55,7 +55,7 @@ class provider implements * @param collection $collection The initialised item 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_subsystem_link('core_group', [], 'privacy:metadata:core_group'); return $collection; @@ -67,7 +67,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return \core_group\privacy\provider::get_contexts_for_group_member($userid, 'enrol_cohort'); } diff --git a/enrol/cohort/lib.php b/enrol/cohort/lib.php index 685377f913c..07924f0a9ce 100644 --- a/enrol/cohort/lib.php +++ b/enrol/cohort/lib.php @@ -512,7 +512,7 @@ class enrol_cohort_plugin extends enrol_plugin { * @param int|null $courseid Course ID. * @return array Errors */ - public function validate_enrol_plugin_data(array $enrolmentdata, ?int $courseid = null) : array { + public function validate_enrol_plugin_data(array $enrolmentdata, ?int $courseid = null): array { global $DB; $errors = []; @@ -591,7 +591,7 @@ class enrol_cohort_plugin extends enrol_plugin { * @param int $courseid Course ID. * @return array Updated enrolment data with custom fields info. */ - public function fill_enrol_custom_fields(array $enrolmentdata, int $courseid) : array { + public function fill_enrol_custom_fields(array $enrolmentdata, int $courseid): array { global $DB; if (isset($enrolmentdata['cohortidnumber'])) { @@ -619,7 +619,7 @@ class enrol_cohort_plugin extends enrol_plugin { * @param int|null $courseid Course ID. * @return lang_string|null Error */ - public function validate_plugin_data_context(array $enrolmentdata, ?int $courseid = null) : ?lang_string { + public function validate_plugin_data_context(array $enrolmentdata, ?int $courseid = null): ?lang_string { if (isset($enrolmentdata['customint1'])) { $cohortid = $enrolmentdata['customint1']; $coursecontext = \context_course::instance($courseid); @@ -667,7 +667,7 @@ class enrol_cohort_plugin extends enrol_plugin { * @param int $courseid Course ID. * @return stdClass|null Matching instance */ - public function find_instance(array $enrolmentdata, int $courseid) : ?stdClass { + public function find_instance(array $enrolmentdata, int $courseid): ?stdClass { global $DB; $instances = enrol_get_instances($courseid, false); diff --git a/enrol/database/classes/privacy/provider.php b/enrol/database/classes/privacy/provider.php index eb0c3cd9f2d..d0f896764a3 100644 --- a/enrol/database/classes/privacy/provider.php +++ b/enrol/database/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/enrol/flatfile/classes/privacy/provider.php b/enrol/flatfile/classes/privacy/provider.php index f83f5678c20..66187f7bf07 100644 --- a/enrol/flatfile/classes/privacy/provider.php +++ b/enrol/flatfile/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @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 { return $collection->add_database_table('enrol_flatfile', [ 'action' => 'privacy:metadata:enrol_flatfile:action', 'roleid' => 'privacy:metadata:enrol_flatfile:roleid', @@ -71,7 +71,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT c.id FROM {enrol_flatfile} ef JOIN {context} c ON c.contextlevel = ? AND c.instanceid = ef.courseid diff --git a/enrol/guest/classes/privacy/provider.php b/enrol/guest/classes/privacy/provider.php index cf0391992ce..2e6ef498c85 100644 --- a/enrol/guest/classes/privacy/provider.php +++ b/enrol/guest/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/enrol/guest/lib.php b/enrol/guest/lib.php index ea76a3d2aab..66e2465e845 100644 --- a/enrol/guest/lib.php +++ b/enrol/guest/lib.php @@ -505,7 +505,7 @@ class enrol_guest_plugin extends enrol_plugin { * @param int $courseid Course ID. * @return stdClass|null Matching instance */ - public function find_instance(array $enrolmentdata, int $courseid) : ?stdClass { + public function find_instance(array $enrolmentdata, int $courseid): ?stdClass { $instances = enrol_get_instances($courseid, false); $instance = null; diff --git a/enrol/imsenterprise/classes/privacy/provider.php b/enrol/imsenterprise/classes/privacy/provider.php index ad24aaccd5c..25b35797589 100644 --- a/enrol/imsenterprise/classes/privacy/provider.php +++ b/enrol/imsenterprise/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/enrol/ldap/classes/privacy/provider.php b/enrol/ldap/classes/privacy/provider.php index 2354006993d..12302bc830f 100644 --- a/enrol/ldap/classes/privacy/provider.php +++ b/enrol/ldap/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/enrol/lti/classes/privacy/provider.php b/enrol/lti/classes/privacy/provider.php index 83f284797a3..ba5efe694d0 100644 --- a/enrol/lti/classes/privacy/provider.php +++ b/enrol/lti/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @param collection $items a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { $items->add_database_table( 'enrol_lti_users', [ @@ -72,7 +72,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); $sql = "SELECT DISTINCT ctx.id diff --git a/enrol/manual/classes/privacy/provider.php b/enrol/manual/classes/privacy/provider.php index 20d6f561fc6..1aa46ef6a43 100644 --- a/enrol/manual/classes/privacy/provider.php +++ b/enrol/manual/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/enrol/manual/lib.php b/enrol/manual/lib.php index bbbcb1874e0..89e935c366b 100644 --- a/enrol/manual/lib.php +++ b/enrol/manual/lib.php @@ -662,7 +662,7 @@ class enrol_manual_plugin extends enrol_plugin { * @param int $courseid Course ID. * @return stdClass|null Matching instance */ - public function find_instance(array $enrolmentdata, int $courseid) : ?stdClass { + public function find_instance(array $enrolmentdata, int $courseid): ?stdClass { $instances = enrol_get_instances($courseid, false); $instance = null; diff --git a/enrol/meta/classes/privacy/provider.php b/enrol/meta/classes/privacy/provider.php index b2c9a767d29..b0d2d7a567e 100644 --- a/enrol/meta/classes/privacy/provider.php +++ b/enrol/meta/classes/privacy/provider.php @@ -55,7 +55,7 @@ class provider implements * @param collection $collection The initialised item 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_subsystem_link('core_group', [], 'privacy:metadata:core_group'); return $collection; @@ -67,7 +67,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return \core_group\privacy\provider::get_contexts_for_group_member($userid, 'enrol_meta'); } diff --git a/enrol/meta/lib.php b/enrol/meta/lib.php index cb0d7ac902c..f39b62b2a6a 100644 --- a/enrol/meta/lib.php +++ b/enrol/meta/lib.php @@ -490,7 +490,7 @@ class enrol_meta_plugin extends enrol_plugin { * @param int $courseid Course ID. * @return stdClass|null Matching instance */ - public function find_instance(array $enrolmentdata, int $courseid) : ?stdClass { + public function find_instance(array $enrolmentdata, int $courseid): ?stdClass { global $DB; $instances = enrol_get_instances($courseid, false); diff --git a/enrol/mnet/classes/privacy/provider.php b/enrol/mnet/classes/privacy/provider.php index 7af9084c65c..edda668b304 100644 --- a/enrol/mnet/classes/privacy/provider.php +++ b/enrol/mnet/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/enrol/paypal/classes/privacy/provider.php b/enrol/paypal/classes/privacy/provider.php index 5a4beb46996..6931c68ff08 100644 --- a/enrol/paypal/classes/privacy/provider.php +++ b/enrol/paypal/classes/privacy/provider.php @@ -56,7 +56,7 @@ class provider implements * @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_external_location_link( 'paypal.com', [ @@ -106,7 +106,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // Values of ep.receiver_email and ep.business are already normalised to lowercase characters by PayPal, diff --git a/enrol/self/classes/privacy/provider.php b/enrol/self/classes/privacy/provider.php index 53fe8227c09..2e09ca21f09 100644 --- a/enrol/self/classes/privacy/provider.php +++ b/enrol/self/classes/privacy/provider.php @@ -35,7 +35,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'; } } \ No newline at end of file diff --git a/enrol/self/lib.php b/enrol/self/lib.php index b3bb22c1c4d..d583479b0c6 100644 --- a/enrol/self/lib.php +++ b/enrol/self/lib.php @@ -1096,7 +1096,7 @@ class enrol_self_plugin extends enrol_plugin { * @param int $courseid Course ID. * @return stdClass|null Matching instance */ - public function find_instance(array $enrolmentdata, int $courseid) : ?stdClass { + public function find_instance(array $enrolmentdata, int $courseid): ?stdClass { $instances = enrol_get_instances($courseid, false); $instance = null; diff --git a/enrol/tests/externallib_test.php b/enrol/tests/externallib_test.php index 0a13b95ab5f..d5ebb5dce87 100644 --- a/enrol/tests/externallib_test.php +++ b/enrol/tests/externallib_test.php @@ -1041,7 +1041,7 @@ class externallib_test extends externallib_advanced_testcase { /** * Test get_enrolled_users_with_capability */ - public function test_get_enrolled_users_with_capability_with_parameters () { + public function test_get_enrolled_users_with_capability_with_parameters() { $capability = 'moodle/course:viewparticipants'; $data = $this->get_enrolled_users_with_capability_setup($capability); diff --git a/favourites/classes/local/repository/favourite_repository.php b/favourites/classes/local/repository/favourite_repository.php index f65461a583e..14c9d928760 100644 --- a/favourites/classes/local/repository/favourite_repository.php +++ b/favourites/classes/local/repository/favourite_repository.php @@ -45,7 +45,7 @@ class favourite_repository implements favourite_repository_interface { * @param \stdClass $record the record we wish to hydrate. * @return favourite the favourite record. */ - protected function get_favourite_from_record(\stdClass $record) : favourite { + protected function get_favourite_from_record(\stdClass $record): favourite { $favourite = new favourite( $record->component, $record->itemtype, @@ -121,7 +121,7 @@ class favourite_repository implements favourite_repository_interface { * @throws \dml_exception if any database errors are encountered. * @throws \moodle_exception if the favourite has missing or invalid properties. */ - public function add(favourite $favourite) : favourite { + public function add(favourite $favourite): favourite { global $DB; $this->validate($favourite); $favourite = (array)$favourite; @@ -140,7 +140,7 @@ class favourite_repository implements favourite_repository_interface { * @throws \dml_exception if any database errors are encountered. * @throws \moodle_exception if any of the favourites have missing or invalid properties. */ - public function add_all(array $items) : array { + public function add_all(array $items): array { global $DB; $time = time(); foreach ($items as $item) { @@ -162,7 +162,7 @@ class favourite_repository implements favourite_repository_interface { * @return favourite the favourite. * @throws \dml_exception if any database errors are encountered. */ - public function find(int $id) : favourite { + public function find(int $id): favourite { global $DB; $record = $DB->get_record($this->favouritetable, ['id' => $id], '*', MUST_EXIST); return $this->get_favourite_from_record($record); @@ -176,7 +176,7 @@ class favourite_repository implements favourite_repository_interface { * @return array the list of all favourites stored within this repository. * @throws \dml_exception if any database errors are encountered. */ - public function find_all(int $limitfrom = 0, int $limitnum = 0) : array { + public function find_all(int $limitfrom = 0, int $limitnum = 0): array { global $DB; $records = $DB->get_records($this->favouritetable, null, '', '*', $limitfrom, $limitnum); return $this->get_list_of_favourites_from_records($records); @@ -191,7 +191,7 @@ class favourite_repository implements favourite_repository_interface { * @return array the list of favourites matching the criteria. * @throws \dml_exception if any database errors are encountered. */ - public function find_by(array $criteria, int $limitfrom = 0, int $limitnum = 0) : array { + public function find_by(array $criteria, int $limitfrom = 0, int $limitnum = 0): array { global $DB; $conditions = []; $params = []; @@ -225,7 +225,7 @@ class favourite_repository implements favourite_repository_interface { * @return favourite the favourite. * @throws \dml_exception if any database errors are encountered or if the record could not be found. */ - public function find_favourite(int $userid, string $component, string $itemtype, int $itemid, int $contextid) : favourite { + public function find_favourite(int $userid, string $component, string $itemtype, int $itemid, int $contextid): favourite { global $DB; // Favourites model: We know that only one favourite can exist based on these properties. $record = $DB->get_record($this->favouritetable, [ @@ -245,7 +245,7 @@ class favourite_repository implements favourite_repository_interface { * @return bool true if the favourite exists, false otherwise. * @throws \dml_exception if any database errors are encountered. */ - public function exists(int $id) : bool { + public function exists(int $id): bool { global $DB; return $DB->record_exists($this->favouritetable, ['id' => $id]); } @@ -257,7 +257,7 @@ class favourite_repository implements favourite_repository_interface { * @return bool true if the favourite exists, false otherwise. * @throws \dml_exception if any database errors are encountered. */ - public function exists_by(array $criteria) : bool { + public function exists_by(array $criteria): bool { global $DB; return $DB->record_exists($this->favouritetable, $criteria); } @@ -269,7 +269,7 @@ class favourite_repository implements favourite_repository_interface { * @return favourite the updated favourite. * @throws \dml_exception if any database errors are encountered. */ - public function update(favourite $favourite) : favourite { + public function update(favourite $favourite): favourite { global $DB; $time = time(); $favourite->timemodified = $time; @@ -305,7 +305,7 @@ class favourite_repository implements favourite_repository_interface { * @return int the total number of items. * @throws \dml_exception if any database errors are encountered. */ - public function count() : int { + public function count(): int { global $DB; return $DB->count_records($this->favouritetable); } @@ -317,7 +317,7 @@ class favourite_repository implements favourite_repository_interface { * @return int the number of favourites matching the criteria. * @throws \dml_exception if any database errors are encountered. */ - public function count_by(array $criteria) : int { + public function count_by(array $criteria): int { global $DB; return $DB->count_records($this->favouritetable, $criteria); } diff --git a/favourites/classes/local/repository/favourite_repository_interface.php b/favourites/classes/local/repository/favourite_repository_interface.php index e0d36c16fe0..6b3d8ecbc88 100644 --- a/favourites/classes/local/repository/favourite_repository_interface.php +++ b/favourites/classes/local/repository/favourite_repository_interface.php @@ -35,7 +35,7 @@ interface favourite_repository_interface { * @param favourite $item the item to add. * @return favourite the item which was added. */ - public function add(favourite $item) : favourite; + public function add(favourite $item): favourite; /** * Add all the items in the list to this repository. @@ -43,7 +43,7 @@ interface favourite_repository_interface { * @param array $items the list of items to add. * @return array the list of items added to this repository. */ - public function add_all(array $items) : array; + public function add_all(array $items): array; /** * Find an item in this repository based on its id. @@ -51,7 +51,7 @@ interface favourite_repository_interface { * @param int $id the id of the item. * @return favourite the item. */ - public function find(int $id) : favourite; + public function find(int $id): favourite; /** * Find all items in this repository. @@ -60,7 +60,7 @@ interface favourite_repository_interface { * @param int $limitnum optional pagination control for returning a subset comprising this many records. * @return array list of all items in this repository. */ - public function find_all(int $limitfrom = 0, int $limitnum = 0) : array; + public function find_all(int $limitfrom = 0, int $limitnum = 0): array; /** * Find all items with attributes matching certain values. @@ -70,7 +70,7 @@ interface favourite_repository_interface { * @param int $limitnum optional pagination control for returning a subset comprising this many records. * @return array the list of items matching the criteria. */ - public function find_by(array $criteria, int $limitfrom = 0, int $limitnum = 0) : array; + public function find_by(array $criteria, int $limitfrom = 0, int $limitnum = 0): array; /** * Check whether an item exists in this repository, based on its id. @@ -78,7 +78,7 @@ interface favourite_repository_interface { * @param int $id the id to search for. * @return bool true if the item could be found, false otherwise. */ - public function exists(int $id) : bool; + public function exists(int $id): bool; /** * Check whether an item exists in this repository, based on the specified criteria. @@ -86,14 +86,14 @@ interface favourite_repository_interface { * @param array $criteria the list of key/value criteria pairs. * @return bool true if the favourite exists, false otherwise. */ - public function exists_by(array $criteria) : bool; + public function exists_by(array $criteria): bool; /** * Return the total number of items in this repository. * * @return int the total number of items. */ - public function count() : int; + public function count(): int; /** * Return the number of favourites matching the specified criteria. @@ -101,7 +101,7 @@ interface favourite_repository_interface { * @param array $criteria the list of key/value criteria pairs. * @return int the number of favourites matching the criteria. */ - public function count_by(array $criteria) : int; + public function count_by(array $criteria): int; /** * Update an item within this repository. @@ -109,7 +109,7 @@ interface favourite_repository_interface { * @param favourite $item the item to update. * @return favourite the updated item. */ - public function update(favourite $item) : favourite; + public function update(favourite $item): favourite; /** * Delete an item by id. @@ -137,5 +137,5 @@ interface favourite_repository_interface { * @param int $contextid the contextid of the item which was favourited. * @return favourite the favourite. */ - public function find_favourite(int $userid, string $component, string $itemtype, int $itemid, int $contextid) : favourite; + public function find_favourite(int $userid, string $component, string $itemtype, int $itemid, int $contextid): favourite; } diff --git a/favourites/classes/local/service/user_favourite_service.php b/favourites/classes/local/service/user_favourite_service.php index 66ab2621050..ee8a51fbd58 100644 --- a/favourites/classes/local/service/user_favourite_service.php +++ b/favourites/classes/local/service/user_favourite_service.php @@ -69,7 +69,7 @@ class user_favourite_service { * @throws \moodle_exception if the component name is invalid, or if the repository encounters any errors. */ public function create_favourite(string $component, string $itemtype, int $itemid, \context $context, - int $ordering = null) : favourite { + int $ordering = null): favourite { // Access: Any component can ask to favourite something, we can't verify access to that 'something' here though. // Validate the component name. @@ -95,7 +95,7 @@ class user_favourite_service { * @return array the list of favourites found. * @throws \moodle_exception if the component name is invalid, or if the repository encounters any errors. */ - public function find_favourites_by_type(string $component, string $itemtype, int $limitfrom = 0, int $limitnum = 0) : array { + public function find_favourites_by_type(string $component, string $itemtype, int $limitfrom = 0, int $limitnum = 0): array { if (!in_array($component, \core_component::get_component_names())) { throw new \moodle_exception("Invalid component name '$component'"); } @@ -123,7 +123,7 @@ class user_favourite_service { * @return array the list of favourites found. * @throws \moodle_exception if the component name is invalid, or if the repository encounters any errors. */ - public function find_all_favourites(string $component, array $itemtypes = [], int $limitfrom = 0, int $limitnum = 0) : array { + public function find_all_favourites(string $component, array $itemtypes = [], int $limitfrom = 0, int $limitnum = 0): array { if (!in_array($component, \core_component::get_component_names())) { throw new \moodle_exception("Invalid component name '$component'"); } @@ -172,7 +172,7 @@ class user_favourite_service { * @param string $joinitemid the table and column identifier which the itemid is joined to. E.g. conversation.id. * @return array the list of sql and params, in the format [$sql, $params]. */ - public function get_join_sql_by_type(string $component, string $itemtype, string $tablealias, string $joinitemid) : array { + public function get_join_sql_by_type(string $component, string $itemtype, string $tablealias, string $joinitemid): array { $sql = " LEFT JOIN {favourite} {$tablealias} ON {$tablealias}.component = :favouritecomponent AND {$tablealias}.itemtype = :favouriteitemtype @@ -222,7 +222,7 @@ class user_favourite_service { * @param \context $context the context of the item which was favourited. * @return bool true if the item is favourited, false otherwise. */ - public function favourite_exists(string $component, string $itemtype, int $itemid, \context $context) : bool { + public function favourite_exists(string $component, string $itemtype, int $itemid, \context $context): bool { return $this->repo->exists_by( [ 'userid' => $this->userid, diff --git a/favourites/classes/privacy/provider.php b/favourites/classes/privacy/provider.php index 99757f09c27..c3724c5fb6d 100644 --- a/favourites/classes/privacy/provider.php +++ b/favourites/classes/privacy/provider.php @@ -48,7 +48,7 @@ class provider implements * @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 { return $collection->add_database_table('favourite', [ 'userid' => 'privacy:metadata:favourite:userid', 'component' => 'privacy:metadata:favourite:component', diff --git a/favourites/classes/service_factory.php b/favourites/classes/service_factory.php index c9143b11c43..17f9a256d09 100644 --- a/favourites/classes/service_factory.php +++ b/favourites/classes/service_factory.php @@ -42,7 +42,7 @@ class service_factory { * @param \context_user $context the context of the user to which the service should be scoped. * @return \core_favourites\local\service\user_favourite_service the service object. */ - public static function get_service_for_user_context(\context_user $context) : local\service\user_favourite_service { + public static function get_service_for_user_context(\context_user $context): local\service\user_favourite_service { return new local\service\user_favourite_service($context, new local\repository\favourite_repository()); } @@ -52,7 +52,7 @@ class service_factory { * @param string $component frankenstyle component name. * @return local\service\component_favourite_service the service object. */ - public static function get_service_for_component(string $component) : local\service\component_favourite_service { + public static function get_service_for_component(string $component): local\service\component_favourite_service { return new local\service\component_favourite_service($component, new local\repository\favourite_repository()); } } diff --git a/files/classes/external/delete/draft.php b/files/classes/external/delete/draft.php index 3f77b3e5ef8..df317e81951 100644 --- a/files/classes/external/delete/draft.php +++ b/files/classes/external/delete/draft.php @@ -52,7 +52,7 @@ class draft extends external_api { * @return external_function_parameters * @since Moodle 3.10 */ - public static function execute_parameters() : external_function_parameters { + public static function execute_parameters(): external_function_parameters { return new external_function_parameters ( [ 'draftitemid' => new external_value(PARAM_INT, 'Item id of the draft file area'), @@ -76,7 +76,7 @@ class draft extends external_api { * @return array of warnings and parent paths of the files deleted * @since Moodle 3.10 */ - public static function execute(int $draftitemid, array $files) : array { + public static function execute(int $draftitemid, array $files): array { global $CFG, $USER; require_once($CFG->dirroot . '/repository/lib.php'); @@ -103,7 +103,7 @@ class draft extends external_api { * @return external_single_structure * @since Moodle 3.10 */ - public static function execute_returns() : external_single_structure { + public static function execute_returns(): external_single_structure { return new external_single_structure( [ 'parentpaths' => new external_multiple_structure( diff --git a/files/classes/external/get/unused_draft.php b/files/classes/external/get/unused_draft.php index 6344af20555..ca1a84b40c4 100644 --- a/files/classes/external/get/unused_draft.php +++ b/files/classes/external/get/unused_draft.php @@ -51,7 +51,7 @@ class unused_draft extends external_api { * @return external_function_parameters * @since Moodle 3.11 */ - public static function execute_parameters() : external_function_parameters { + public static function execute_parameters(): external_function_parameters { return new external_function_parameters ([]); } @@ -61,7 +61,7 @@ class unused_draft extends external_api { * @return array of information containing the draft item area and possible warnings. * @since Moodle 3.11 */ - public static function execute() : array { + public static function execute(): array { global $USER; $usercontext = context_user::instance($USER->id); @@ -83,7 +83,7 @@ class unused_draft extends external_api { * @return external_single_structure * @since Moodle 3.11 */ - public static function execute_returns() : external_single_structure { + public static function execute_returns(): external_single_structure { return new external_single_structure( [ 'component' => new external_value(PARAM_COMPONENT, 'File area component.'), diff --git a/files/classes/privacy/provider.php b/files/classes/privacy/provider.php index 44c8694da89..1efb3251ec2 100644 --- a/files/classes/privacy/provider.php +++ b/files/classes/privacy/provider.php @@ -57,7 +57,7 @@ class provider implements * @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('files', [ 'contenthash' => 'privacy:metadata:files:contenthash', @@ -92,7 +92,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_private_key} k JOIN {user} u ON k.userid = u.id diff --git a/files/converter/classes/privacy/provider.php b/files/converter/classes/privacy/provider.php index 7e37956be4b..3995fe30d5d 100644 --- a/files/converter/classes/privacy/provider.php +++ b/files/converter/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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_plugintype_link('fileconverter', [], 'privacy:metadata:plugintypefileconverter'); return $collection; } @@ -62,7 +62,7 @@ class provider implements * @param int $userid The user to search. * @return \contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { // We cannot associate files with a particular user as it would require to know all the details about // the source file, which only the component owning it knows about. And, the 'usermodified' attribute // of the conversion class is not an identifier of data ownership, merely that this user was logged in diff --git a/files/converter/googledrive/classes/privacy/provider.php b/files/converter/googledrive/classes/privacy/provider.php index ce93f056b2c..eaac565facf 100644 --- a/files/converter/googledrive/classes/privacy/provider.php +++ b/files/converter/googledrive/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_external_location_link('googledrive', [ 'params' => 'privacy:metadata:fileconverter_googledrive:params', 'filecontent' => 'privacy:metadata:fileconverter_googledrive:filecontent', @@ -65,7 +65,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); return $contextlist; } diff --git a/files/converter/unoconv/classes/privacy/provider.php b/files/converter/unoconv/classes/privacy/provider.php index a308240f912..2a94a6c40d9 100644 --- a/files/converter/unoconv/classes/privacy/provider.php +++ b/files/converter/unoconv/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/files/renderer.php b/files/renderer.php index de35b24bc78..48c6bbef315 100644 --- a/files/renderer.php +++ b/files/renderer.php @@ -534,7 +534,7 @@ class core_files_renderer extends plugin_renderer_base { * * @return \stdClass $iconcontext the context for rendering license help info. */ - protected function create_license_help_icon_context() : stdClass { + protected function create_license_help_icon_context(): stdClass { $licensecontext = new stdClass(); $licenses = []; diff --git a/files/tests/converter_test.php b/files/tests/converter_test.php index e73361e9caa..d54d4b171ae 100644 --- a/files/tests/converter_test.php +++ b/files/tests/converter_test.php @@ -786,7 +786,7 @@ class core_file_converter_requirements_base implements \core_files\converter_int * * @return string */ - public function get_supported_conversions() { + public function get_supported_conversions() { return []; } diff --git a/filter/activitynames/classes/privacy/provider.php b/filter/activitynames/classes/privacy/provider.php index 1983f142750..949426050ce 100644 --- a/filter/activitynames/classes/privacy/provider.php +++ b/filter/activitynames/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/algebra/classes/privacy/provider.php b/filter/algebra/classes/privacy/provider.php index 54071f70232..64936b45678 100644 --- a/filter/algebra/classes/privacy/provider.php +++ b/filter/algebra/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/classes/privacy/provider.php b/filter/classes/privacy/provider.php index d19d9e6799b..cd3132c8722 100644 --- a/filter/classes/privacy/provider.php +++ b/filter/classes/privacy/provider.php @@ -40,7 +40,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:reason'; } } diff --git a/filter/codehighlighter/classes/privacy/provider.php b/filter/codehighlighter/classes/privacy/provider.php index bbde4e3012e..6847d84bc33 100644 --- a/filter/codehighlighter/classes/privacy/provider.php +++ b/filter/codehighlighter/classes/privacy/provider.php @@ -30,7 +30,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'; } } diff --git a/filter/data/classes/privacy/provider.php b/filter/data/classes/privacy/provider.php index ad935200933..c781e1df9cc 100644 --- a/filter/data/classes/privacy/provider.php +++ b/filter/data/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/emailprotect/classes/privacy/provider.php b/filter/emailprotect/classes/privacy/provider.php index effde515c13..0e8ba8fe3be 100644 --- a/filter/emailprotect/classes/privacy/provider.php +++ b/filter/emailprotect/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/emoticon/classes/privacy/provider.php b/filter/emoticon/classes/privacy/provider.php index 57b33c5a973..9b74c29e912 100644 --- a/filter/emoticon/classes/privacy/provider.php +++ b/filter/emoticon/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/glossary/classes/privacy/provider.php b/filter/glossary/classes/privacy/provider.php index 3bb71e51040..c969d6bd2a0 100644 --- a/filter/glossary/classes/privacy/provider.php +++ b/filter/glossary/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/mathjaxloader/classes/privacy/provider.php b/filter/mathjaxloader/classes/privacy/provider.php index 59f973cc493..25103777573 100644 --- a/filter/mathjaxloader/classes/privacy/provider.php +++ b/filter/mathjaxloader/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/mediaplugin/classes/privacy/provider.php b/filter/mediaplugin/classes/privacy/provider.php index 3dd71af68e3..a3da35fe151 100644 --- a/filter/mediaplugin/classes/privacy/provider.php +++ b/filter/mediaplugin/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/multilang/classes/privacy/provider.php b/filter/multilang/classes/privacy/provider.php index 570467b9614..b764ea017f9 100644 --- a/filter/multilang/classes/privacy/provider.php +++ b/filter/multilang/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/tex/classes/privacy/provider.php b/filter/tex/classes/privacy/provider.php index e090cd39e68..544960fccdd 100644 --- a/filter/tex/classes/privacy/provider.php +++ b/filter/tex/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/tex/latex.php b/filter/tex/latex.php index 9a6b3294df9..7c6b3665b05 100644 --- a/filter/tex/latex.php +++ b/filter/tex/latex.php @@ -73,7 +73,7 @@ * @param file $log valid open file handle - log info will be written to this file * @return return code from execution of command */ - function execute( $command, $log=null ) { + function execute($command, $log=null ) { $output = array(); exec( $command, $output, $return_code ); if ($log) { @@ -95,7 +95,7 @@ * @param file $log valid open file handle for optional logging (debugging only) * @return bool true if successful */ - function render( $formula, $filename, $fontsize=12, $density=240, $background='', $log=null ) { + function render($formula, $filename, $fontsize=12, $density=240, $background='', $log=null ) { global $CFG; diff --git a/filter/tex/tests/lib_test.php b/filter/tex/tests/lib_test.php index cc19e2a2929..3159386ed53 100644 --- a/filter/tex/tests/lib_test.php +++ b/filter/tex/tests/lib_test.php @@ -44,7 +44,7 @@ class lib_test extends advanced_testcase { * * @return array */ - public function filter_tex_sanitize_formula_provider() : array { + public function filter_tex_sanitize_formula_provider(): array { return [ ['x\ =\ \frac{\sqrt{144}}{2}\ \times\ (y\ +\ 12)', 'x\ =\ \frac{\sqrt{144}}{2}\ \times\ (y\ +\ 12)'], ['\usepackage[latin1]{inputenc}', '\usepackage[latin1]{inputenc}'], diff --git a/filter/tidy/classes/privacy/provider.php b/filter/tidy/classes/privacy/provider.php index 518f25d955c..7ae9e969915 100644 --- a/filter/tidy/classes/privacy/provider.php +++ b/filter/tidy/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/filter/urltolink/classes/privacy/provider.php b/filter/urltolink/classes/privacy/provider.php index bb63073803b..2e1fd54551d 100644 --- a/filter/urltolink/classes/privacy/provider.php +++ b/filter/urltolink/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/classes/privacy/provider.php b/grade/classes/privacy/provider.php index 070af6fde0a..855030f5458 100644 --- a/grade/classes/privacy/provider.php +++ b/grade/classes/privacy/provider.php @@ -60,7 +60,7 @@ class provider implements * @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 { // Tables without 'real' user information. $collection->add_database_table('grade_outcomes', [ @@ -141,7 +141,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $contextlist = new \core_privacy\local\request\contextlist(); // Add where we modified outcomes. diff --git a/grade/export/key_form.php b/grade/export/key_form.php index e30a3a57897..eee1db137a4 100644 --- a/grade/export/key_form.php +++ b/grade/export/key_form.php @@ -32,7 +32,7 @@ require_once($CFG->dirroot.'/lib/formslib.php'); class key_form extends moodleform { // Define the form - function definition () { + function definition() { global $USER, $CFG, $COURSE; $mform =& $this->_form; diff --git a/grade/export/ods/classes/privacy/provider.php b/grade/export/ods/classes/privacy/provider.php index 17688ff39ba..912b16ec3e0 100644 --- a/grade/export/ods/classes/privacy/provider.php +++ b/grade/export/ods/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/export/txt/classes/privacy/provider.php b/grade/export/txt/classes/privacy/provider.php index 8db03c566be..489992990dc 100644 --- a/grade/export/txt/classes/privacy/provider.php +++ b/grade/export/txt/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/export/xls/classes/privacy/provider.php b/grade/export/xls/classes/privacy/provider.php index dbb9b960229..939ed64f898 100644 --- a/grade/export/xls/classes/privacy/provider.php +++ b/grade/export/xls/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/export/xml/classes/privacy/provider.php b/grade/export/xml/classes/privacy/provider.php index 6c62d3926fa..a26dc4c6bd8 100644 --- a/grade/export/xml/classes/privacy/provider.php +++ b/grade/export/xml/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/grading/classes/privacy/provider.php b/grade/grading/classes/privacy/provider.php index 646c050af9b..d3194cf0d15 100644 --- a/grade/grading/classes/privacy/provider.php +++ b/grade/grading/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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('grading_definitions', [ 'method' => 'privacy:metadata:grading_definitions:method', 'areaid' => 'privacy:metadata:grading_definitions:areaid', @@ -88,7 +88,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); $sql = "SELECT c.id diff --git a/grade/grading/form/guide/classes/privacy/provider.php b/grade/grading/form/guide/classes/privacy/provider.php index 34a7aaa4e2f..b24827286ff 100644 --- a/grade/grading/form/guide/classes/privacy/provider.php +++ b/grade/grading/form/guide/classes/privacy/provider.php @@ -47,7 +47,7 @@ class provider implements * @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('gradingform_guide_fillings', [ 'instanceid' => 'privacy:metadata:instanceid', 'criterionid' => 'privacy:metadata:criterionid', diff --git a/grade/grading/form/guide/tests/grades/grader/gradingpanel/external/fetch_test.php b/grade/grading/form/guide/tests/grades/grader/gradingpanel/external/fetch_test.php index 8a7c505d408..42468f7c99e 100644 --- a/grade/grading/form/guide/tests/grades/grader/gradingpanel/external/fetch_test.php +++ b/grade/grading/form/guide/tests/grades/grader/gradingpanel/external/fetch_test.php @@ -216,7 +216,7 @@ class fetch_test extends advanced_testcase { /** * Executes and performs all the assertions of the fetch method with the given parameters. */ - private function execute_and_assert_fetch ($forum, $controller, $definition, $fetcheruser, $grader, $gradeduser) { + private function execute_and_assert_fetch($forum, $controller, $definition, $fetcheruser, $grader, $gradeduser) { $generator = \testing_util::get_data_generator(); $guidegenerator = $generator->get_plugin_generator('gradingform_guide'); diff --git a/grade/grading/form/rubric/classes/privacy/provider.php b/grade/grading/form/rubric/classes/privacy/provider.php index 07397449614..e82b8acbef0 100644 --- a/grade/grading/form/rubric/classes/privacy/provider.php +++ b/grade/grading/form/rubric/classes/privacy/provider.php @@ -44,7 +44,7 @@ class provider implements * @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('gradingform_rubric_fillings', [ 'instanceid' => 'privacy:metadata:instanceid', 'criterionid' => 'privacy:metadata:criterionid', diff --git a/grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/fetch_test.php b/grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/fetch_test.php index 9aa29de6607..491b91ea9e9 100644 --- a/grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/fetch_test.php +++ b/grade/grading/form/rubric/tests/grades/grader/gradingpanel/external/fetch_test.php @@ -224,7 +224,7 @@ class fetch_test extends advanced_testcase { /** * Executes and performs all the assertions of the fetch method with the given parameters. */ - private function execute_and_assert_fetch ($forum, $controller, $definition, $fetcheruser, $grader, $gradeduser) { + private function execute_and_assert_fetch($forum, $controller, $definition, $fetcheruser, $grader, $gradeduser) { $generator = \testing_util::get_data_generator(); $rubricgenerator = $generator->get_plugin_generator('gradingform_rubric'); diff --git a/grade/import/csv/classes/privacy/provider.php b/grade/import/csv/classes/privacy/provider.php index 8b230fc1701..9e75f0de34b 100644 --- a/grade/import/csv/classes/privacy/provider.php +++ b/grade/import/csv/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/import/csv/tests/load_data_test.php b/grade/import/csv/tests/load_data_test.php index 4b20f4fb543..20188b8f421 100644 --- a/grade/import/csv/tests/load_data_test.php +++ b/grade/import/csv/tests/load_data_test.php @@ -513,7 +513,7 @@ Bobby,Bunce,,"Moodle HQ","Rock on!",student5@example.com,75.00,,75.00,{exportdat /* * Test importing csv data into the gradebook using "Last downloaded from this course" column and force import option. */ - public function test_force_import_option () { + public function test_force_import_option() { // Need to add users into the system. $user = new \stdClass(); diff --git a/grade/import/direct/classes/privacy/provider.php b/grade/import/direct/classes/privacy/provider.php index 8136bec6926..49b46a4cb73 100644 --- a/grade/import/direct/classes/privacy/provider.php +++ b/grade/import/direct/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/import/grade_import_form.php b/grade/import/grade_import_form.php index c1ffad6880a..ffb10feaee2 100644 --- a/grade/import/grade_import_form.php +++ b/grade/import/grade_import_form.php @@ -23,7 +23,7 @@ require_once $CFG->libdir.'/formslib.php'; require_once($CFG->libdir.'/gradelib.php'); class grade_import_form extends moodleform { - function definition (){ + function definition(){ global $COURSE; $mform =& $this->_form; @@ -86,7 +86,7 @@ class grade_import_form extends moodleform { class grade_import_mapping_form extends moodleform { - function definition () { + function definition() { global $CFG, $COURSE; $mform =& $this->_form; diff --git a/grade/import/key_form.php b/grade/import/key_form.php index afda8581a3b..5358184471d 100644 --- a/grade/import/key_form.php +++ b/grade/import/key_form.php @@ -32,7 +32,7 @@ require_once($CFG->dirroot.'/lib/formslib.php'); class key_form extends moodleform { // Define the form - function definition () { + function definition() { global $USER, $CFG, $COURSE; $mform =& $this->_form; diff --git a/grade/import/xml/classes/privacy/provider.php b/grade/import/xml/classes/privacy/provider.php index 54f4e465047..56f971c774d 100644 --- a/grade/import/xml/classes/privacy/provider.php +++ b/grade/import/xml/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/import/xml/grade_import_form.php b/grade/import/xml/grade_import_form.php index daa9fed20d3..00e54101667 100644 --- a/grade/import/xml/grade_import_form.php +++ b/grade/import/xml/grade_import_form.php @@ -22,7 +22,7 @@ if (!defined('MOODLE_INTERNAL')) { require_once $CFG->libdir.'/formslib.php'; class grade_import_form extends moodleform { - function definition () { + function definition() { global $COURSE, $USER, $CFG, $DB; $mform =& $this->_form; diff --git a/grade/lib.php b/grade/lib.php index ec04b74cd42..26706f2dc61 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -1606,7 +1606,7 @@ class grade_structure { * @param grade_grade $grade A grade_grade object * @return string */ - public function get_grade_action_menu(grade_grade $grade) : string { + public function get_grade_action_menu(grade_grade $grade): string { global $OUTPUT; $menuitems = []; diff --git a/grade/renderer.php b/grade/renderer.php index 861813d2881..202843e24a2 100644 --- a/grade/renderer.php +++ b/grade/renderer.php @@ -158,7 +158,7 @@ class core_grades_renderer extends plugin_renderer_base { * @param bool $showbuttons Whether to display buttons (message, add to contacts) within the heading. * @return string The raw HTML to render. */ - public function user_heading(stdClass $user, int $courseid, bool $showbuttons = true) : string { + public function user_heading(stdClass $user, int $courseid, bool $showbuttons = true): string { global $USER; $headingdata = [ diff --git a/grade/report/grader/classes/privacy/provider.php b/grade/report/grader/classes/privacy/provider.php index ef0abf87c6d..c7dba4cfe21 100644 --- a/grade/report/grader/classes/privacy/provider.php +++ b/grade/report/grader/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @param collection $itemcollection The initialised item collection to add items to. * @return collection A listing of user data stored through this system. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { // There are several user preferences (shared between different courses). // Show/hide toggles preferences. $items->add_user_preference('grade_report_showaverages', 'privacy:metadata:preference:grade_report_showaverages'); diff --git a/grade/report/grader/lib.php b/grade/report/grader/lib.php index a1fe4ff8e85..3f7923e49d2 100644 --- a/grade/report/grader/lib.php +++ b/grade/report/grader/lib.php @@ -766,7 +766,7 @@ class grade_report_grader extends grade_report { * @param boolean $displayaverages whether to display average rows in the table * @return array Array of html_table_row objects */ - public function get_right_rows(bool $displayaverages) : array { + public function get_right_rows(bool $displayaverages): array { global $CFG, $USER, $OUTPUT, $DB, $PAGE; $rows = []; diff --git a/grade/report/grader/tests/behat/behat_gradereport_grader.php b/grade/report/grader/tests/behat/behat_gradereport_grader.php index 59f9c40f87f..46acb8c3fc1 100644 --- a/grade/report/grader/tests/behat/behat_gradereport_grader.php +++ b/grade/report/grader/tests/behat/behat_gradereport_grader.php @@ -113,7 +113,7 @@ class behat_gradereport_grader extends behat_base { * @param string $student * @return string */ - protected function get_user_selector(string $student) : string { + protected function get_user_selector(string $student): string { $userid = $this->get_user_id($student); return "//table[@id='user-grades']//*[@data-type='user'][@data-id='" . $userid . "']"; diff --git a/grade/report/history/classes/privacy/provider.php b/grade/report/history/classes/privacy/provider.php index 0aec74f2c66..d97ab6160a4 100644 --- a/grade/report/history/classes/privacy/provider.php +++ b/grade/report/history/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/report/outcomes/classes/privacy/provider.php b/grade/report/outcomes/classes/privacy/provider.php index c5c096303ec..ac3f3d49928 100644 --- a/grade/report/outcomes/classes/privacy/provider.php +++ b/grade/report/outcomes/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/report/overview/classes/privacy/provider.php b/grade/report/overview/classes/privacy/provider.php index 407f059fb65..e3073931abf 100644 --- a/grade/report/overview/classes/privacy/provider.php +++ b/grade/report/overview/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/report/singleview/classes/privacy/provider.php b/grade/report/singleview/classes/privacy/provider.php index ba123677f6a..4ec98fc7673 100644 --- a/grade/report/singleview/classes/privacy/provider.php +++ b/grade/report/singleview/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/grade/report/singleview/classes/report/singleview.php b/grade/report/singleview/classes/report/singleview.php index 96449f6bc8c..1d6f79e04ce 100644 --- a/grade/report/singleview/classes/report/singleview.php +++ b/grade/report/singleview/classes/report/singleview.php @@ -178,7 +178,7 @@ class singleview extends grade_report { * @param renderer_base $output * @return string HTML to display */ - public function bulk_actions_menu(renderer_base $output) : string { + public function bulk_actions_menu(renderer_base $output): string { $options = [ 'overrideallgrades' => get_string('overrideallgrades', 'gradereport_singleview'), 'overridenonegrades' => get_string('overridenonegrades', 'gradereport_singleview'), diff --git a/grade/report/summary/classes/privacy/provider.php b/grade/report/summary/classes/privacy/provider.php index bf75a42b45e..5a248f328c5 100644 --- a/grade/report/summary/classes/privacy/provider.php +++ b/grade/report/summary/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/grade/report/user/classes/privacy/provider.php b/grade/report/user/classes/privacy/provider.php index 669be2dc2c6..e47a9f6af87 100644 --- a/grade/report/user/classes/privacy/provider.php +++ b/grade/report/user/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @param collection $itemcollection The initialised item collection to add items to. * @return collection A listing of user data stored through this system. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { // User preferences (shared between different courses). $items->add_user_preference('gradereport_user_view_user', 'privacy:metadata:preference:gradereport_user_view_user'); diff --git a/grade/report/user/classes/report/user.php b/grade/report/user/classes/report/user.php index 8013a593097..3e4075f7762 100644 --- a/grade/report/user/classes/report/user.php +++ b/grade/report/user/classes/report/user.php @@ -475,7 +475,7 @@ class user extends grade_report { * * @return bool */ - public function fill_table():bool { + public function fill_table(): bool { $this->fill_table_recursive($this->gtree->top_element); return true; } diff --git a/grade/tests/export_test.php b/grade/tests/export_test.php index f52c606ea8d..cac5153d783 100644 --- a/grade/tests/export_test.php +++ b/grade/tests/export_test.php @@ -127,7 +127,7 @@ class export_test extends \advanced_testcase { * * @return array */ - public function format_feedback_provider() : array { + public function format_feedback_provider(): array { return [ 'Basic string (PLAIN)' => [ 'This is an example string', diff --git a/grade/tests/grades/grader/gradingpanel/point/external/fetch_test.php b/grade/tests/grades/grader/gradingpanel/point/external/fetch_test.php index 4d59087527c..775432aee09 100644 --- a/grade/tests/grades/grader/gradingpanel/point/external/fetch_test.php +++ b/grade/tests/grades/grader/gradingpanel/point/external/fetch_test.php @@ -190,7 +190,7 @@ class fetch_test extends advanced_testcase { /** * Executes the fetch method with the given users and returns the result. */ - private function execute_and_assert_fetch ($forum, $fetcheruser, $grader, $gradeduser) { + private function execute_and_assert_fetch($forum, $fetcheruser, $grader, $gradeduser) { $this->setUser($grader); $gradeitem = component_gradeitem::instance('mod_forum', $forum->get_context(), 'forum'); diff --git a/grade/tests/grades/grader/gradingpanel/scale/external/fetch_test.php b/grade/tests/grades/grader/gradingpanel/scale/external/fetch_test.php index 3f16d12ab67..b66e9a5b5e0 100644 --- a/grade/tests/grades/grader/gradingpanel/scale/external/fetch_test.php +++ b/grade/tests/grades/grader/gradingpanel/scale/external/fetch_test.php @@ -232,7 +232,7 @@ class fetch_test extends advanced_testcase { /** * Executes the fetch method with the given users and returns the result. */ - private function execute_and_assert_fetch ($forum, $options, $scale, $fetcheruser, $grader, $gradeduser) { + private function execute_and_assert_fetch($forum, $options, $scale, $fetcheruser, $grader, $gradeduser) { $this->setUser($grader); diff --git a/grade/tests/lib_test.php b/grade/tests/lib_test.php index 19417763c5b..f24e9af25fe 100644 --- a/grade/tests/lib_test.php +++ b/grade/tests/lib_test.php @@ -457,7 +457,7 @@ class lib_test extends \advanced_testcase { * * @return array of testing scenarios */ - public function ungraded_counts_hidden_grades_data() : array { + public function ungraded_counts_hidden_grades_data(): array { return [ 'nohidden' => [ 'hidden' => false, @@ -878,7 +878,7 @@ class lib_test extends \advanced_testcase { * * @return array of testing scenarios */ - public function calculate_average_data() : array { + public function calculate_average_data(): array { return [ 'Non-empty grades' => [ 'meanselection' => 1, diff --git a/group/classes/privacy/provider.php b/group/classes/privacy/provider.php index 334b74f62d0..3a55bfa6c83 100644 --- a/group/classes/privacy/provider.php +++ b/group/classes/privacy/provider.php @@ -61,7 +61,7 @@ class provider implements * @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('groups_members', [ 'groupid' => 'privacy:metadata:groups:groupid', 'userid' => 'privacy:metadata:groups:userid', @@ -338,7 +338,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return static::get_contexts_for_group_member($userid, ''); } diff --git a/group/group_form.php b/group/group_form.php index 900bc822ebe..01e1c86bad8 100644 --- a/group/group_form.php +++ b/group/group_form.php @@ -41,7 +41,7 @@ class group_form extends moodleform { /** * Definition of the form */ - function definition () { + function definition() { global $USER, $CFG, $COURSE; $coursecontext = context_course::instance($COURSE->id); diff --git a/group/grouping_form.php b/group/grouping_form.php index 8ffd98db58d..87ba080d2cc 100644 --- a/group/grouping_form.php +++ b/group/grouping_form.php @@ -41,7 +41,7 @@ class grouping_form extends moodleform { /** * Form definition */ - function definition () { + function definition() { global $USER, $CFG, $COURSE; $coursecontext = context_course::instance($COURSE->id); diff --git a/group/tests/lib_test.php b/group/tests/lib_test.php index 6ee7623d00a..0b6645ddd61 100644 --- a/group/tests/lib_test.php +++ b/group/tests/lib_test.php @@ -529,7 +529,7 @@ class lib_test extends \advanced_testcase { $this->assertSame('Updated input for grouping1', $customfield['value']); } - public function test_groups_create_autogroups () { + public function test_groups_create_autogroups() { global $DB; $this->resetAfterTest(); diff --git a/h5p/classes/privacy/provider.php b/h5p/classes/privacy/provider.php index 73f4e31095b..2f10563d116 100644 --- a/h5p/classes/privacy/provider.php +++ b/h5p/classes/privacy/provider.php @@ -39,7 +39,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'; } } diff --git a/h5p/h5plib/v126/classes/privacy/provider.php b/h5p/h5plib/v126/classes/privacy/provider.php index 00b8ad7bdb6..976e1c59f4e 100644 --- a/h5p/h5plib/v126/classes/privacy/provider.php +++ b/h5p/h5plib/v126/classes/privacy/provider.php @@ -30,7 +30,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'; } } diff --git a/h5p/lib.php b/h5p/lib.php index 21f9f96bb08..bd738451631 100644 --- a/h5p/lib.php +++ b/h5p/lib.php @@ -42,7 +42,7 @@ use core_h5p\local\library\autoloader; * @return bool Returns false if we don't find a file. */ function core_h5p_pluginfile($course, $cm, $context, string $filearea, array $args, bool $forcedownload, - array $options = []) : bool { + array $options = []): bool { global $DB; // Require classes from H5P third party library diff --git a/lib/antivirus/clamav/classes/privacy/provider.php b/lib/antivirus/clamav/classes/privacy/provider.php index 61ccf036330..e699b9f4a35 100644 --- a/lib/antivirus/clamav/classes/privacy/provider.php +++ b/lib/antivirus/clamav/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/lib/antivirus/classes/privacy/provider.php b/lib/antivirus/classes/privacy/provider.php index cc30ca97b76..9c5f93568e5 100644 --- a/lib/antivirus/classes/privacy/provider.php +++ b/lib/antivirus/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/authlib.php b/lib/authlib.php index c6f7873f4b0..5a178835b1e 100644 --- a/lib/authlib.php +++ b/lib/authlib.php @@ -773,7 +773,7 @@ class auth_plugin_base { * @param stdClass $user A user object * @return string[] An array of strings with keys subject and message */ - public function get_password_change_info(stdClass $user) : array { + public function get_password_change_info(stdClass $user): array { global $USER; diff --git a/lib/behat/classes/behat_config_util.php b/lib/behat/classes/behat_config_util.php index 205dd2da60f..7a3eb4433bc 100644 --- a/lib/behat/classes/behat_config_util.php +++ b/lib/behat/classes/behat_config_util.php @@ -753,7 +753,7 @@ class behat_config_util { * @param bool $verbose If true, outputs information about installed app version * @return string List of tags or '' if not supporting mobile */ - protected function get_mobile_version_tags($verbose = true) : string { + protected function get_mobile_version_tags($verbose = true): string { global $CFG; if (empty($CFG->behat_ionic_wwwroot)) { @@ -1501,7 +1501,7 @@ class behat_config_util { * @param string $theme theme name. * @return List of contexts */ - protected function get_behat_contexts_for_theme($theme) : array { + protected function get_behat_contexts_for_theme($theme): array { // If we already have this list then just return. This will not change by run. if (!empty($this->themecontexts[$theme])) { return $this->themecontexts[$theme]; diff --git a/lib/behat/classes/behat_session_trait.php b/lib/behat/classes/behat_session_trait.php index 2b60047b7b0..7a5bcf7f0ef 100644 --- a/lib/behat/classes/behat_session_trait.php +++ b/lib/behat/classes/behat_session_trait.php @@ -555,7 +555,7 @@ trait behat_session_trait { * * @return bool True if it's in the app */ - protected function is_in_app() : bool { + protected function is_in_app(): bool { // Cannot be in the app if there's no @app tag on scenario. if (!$this->has_tag('app')) { return false; @@ -732,7 +732,7 @@ trait behat_session_trait { * @param string $tag Tag to check * @return bool True if the tag exists in scenario or feature */ - public function has_tag(string $tag) : bool { + public function has_tag(string $tag): bool { return array_key_exists($tag, behat_hooks::get_tags_for_scenario()); } @@ -1295,7 +1295,7 @@ EOF; * @param int $timeout One of the TIMEOUT constants * @return int Actual timeout (in seconds) */ - protected static function get_real_timeout(int $timeout) : int { + protected static function get_real_timeout(int $timeout): int { global $CFG; if (!empty($CFG->behat_increasetimeout)) { return $timeout * $CFG->behat_increasetimeout; @@ -1311,7 +1311,7 @@ EOF; * * @return int Timeout in seconds */ - public static function get_timeout() : int { + public static function get_timeout(): int { return self::get_real_timeout(6); } @@ -1324,7 +1324,7 @@ EOF; * * @return int Timeout in seconds */ - public static function get_reduced_timeout() : int { + public static function get_reduced_timeout(): int { return self::get_real_timeout(2); } @@ -1335,7 +1335,7 @@ EOF; * * @return int Timeout in seconds */ - public static function get_extended_timeout() : int { + public static function get_extended_timeout(): int { return self::get_real_timeout(10); } diff --git a/lib/classes/analytics/indicator/any_access_after_end.php b/lib/classes/analytics/indicator/any_access_after_end.php index 1cab86399b2..4bb342fe7ee 100644 --- a/lib/classes/analytics/indicator/any_access_after_end.php +++ b/lib/classes/analytics/indicator/any_access_after_end.php @@ -42,7 +42,7 @@ class any_access_after_end extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:accessesafterend'); } diff --git a/lib/classes/analytics/indicator/any_access_before_start.php b/lib/classes/analytics/indicator/any_access_before_start.php index 4b30f559486..862d6534904 100644 --- a/lib/classes/analytics/indicator/any_access_before_start.php +++ b/lib/classes/analytics/indicator/any_access_before_start.php @@ -42,7 +42,7 @@ class any_access_before_start extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:accessesbeforestart'); } diff --git a/lib/classes/analytics/indicator/any_course_access.php b/lib/classes/analytics/indicator/any_course_access.php index b8a59e06f07..2b2e47c057e 100644 --- a/lib/classes/analytics/indicator/any_course_access.php +++ b/lib/classes/analytics/indicator/any_course_access.php @@ -45,7 +45,7 @@ class any_course_access extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:anycourseaccess'); } diff --git a/lib/classes/analytics/indicator/any_write_action.php b/lib/classes/analytics/indicator/any_write_action.php index 7a27d16c2e6..5a4c7778a35 100644 --- a/lib/classes/analytics/indicator/any_write_action.php +++ b/lib/classes/analytics/indicator/any_write_action.php @@ -42,7 +42,7 @@ class any_write_action extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:anywrite'); } diff --git a/lib/classes/analytics/indicator/any_write_action_in_course.php b/lib/classes/analytics/indicator/any_write_action_in_course.php index e9eab4ed49f..f02099e77a9 100644 --- a/lib/classes/analytics/indicator/any_write_action_in_course.php +++ b/lib/classes/analytics/indicator/any_write_action_in_course.php @@ -42,7 +42,7 @@ class any_write_action_in_course extends \core_analytics\local\indicator\binary * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:anywriteincourse'); } diff --git a/lib/classes/analytics/indicator/read_actions.php b/lib/classes/analytics/indicator/read_actions.php index 7b9ac397d3a..9c34089f5c2 100644 --- a/lib/classes/analytics/indicator/read_actions.php +++ b/lib/classes/analytics/indicator/read_actions.php @@ -42,7 +42,7 @@ class read_actions extends \core_analytics\local\indicator\linear { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:readactions'); } diff --git a/lib/classes/analytics/time_splitting/deciles.php b/lib/classes/analytics/time_splitting/deciles.php index 3e21df93349..92c5558476a 100644 --- a/lib/classes/analytics/time_splitting/deciles.php +++ b/lib/classes/analytics/time_splitting/deciles.php @@ -44,7 +44,7 @@ class deciles extends \core_analytics\local\time_splitting\equal_parts { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:deciles'); } diff --git a/lib/classes/analytics/time_splitting/deciles_accum.php b/lib/classes/analytics/time_splitting/deciles_accum.php index b0ffc58cdf7..503a366490a 100644 --- a/lib/classes/analytics/time_splitting/deciles_accum.php +++ b/lib/classes/analytics/time_splitting/deciles_accum.php @@ -44,7 +44,7 @@ class deciles_accum extends \core_analytics\local\time_splitting\accumulative_pa * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:decilesaccum'); } diff --git a/lib/classes/analytics/time_splitting/no_splitting.php b/lib/classes/analytics/time_splitting/no_splitting.php index 0d2e614eb10..9bd551793b6 100644 --- a/lib/classes/analytics/time_splitting/no_splitting.php +++ b/lib/classes/analytics/time_splitting/no_splitting.php @@ -48,7 +48,7 @@ class no_splitting extends \core_analytics\local\time_splitting\base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:nosplitting'); } diff --git a/lib/classes/analytics/time_splitting/one_month_after_start.php b/lib/classes/analytics/time_splitting/one_month_after_start.php index 650c176ab13..cb6d34148f8 100644 --- a/lib/classes/analytics/time_splitting/one_month_after_start.php +++ b/lib/classes/analytics/time_splitting/one_month_after_start.php @@ -40,7 +40,7 @@ class one_month_after_start extends \core_analytics\local\time_splitting\after_s * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:onemonthafterstart'); } diff --git a/lib/classes/analytics/time_splitting/one_week_after_start.php b/lib/classes/analytics/time_splitting/one_week_after_start.php index 595748488b0..279f7f26268 100644 --- a/lib/classes/analytics/time_splitting/one_week_after_start.php +++ b/lib/classes/analytics/time_splitting/one_week_after_start.php @@ -40,7 +40,7 @@ class one_week_after_start extends \core_analytics\local\time_splitting\after_st * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:oneweekafterstart'); } diff --git a/lib/classes/analytics/time_splitting/past_3_days.php b/lib/classes/analytics/time_splitting/past_3_days.php index a63a38a1417..75921d27da3 100644 --- a/lib/classes/analytics/time_splitting/past_3_days.php +++ b/lib/classes/analytics/time_splitting/past_3_days.php @@ -40,7 +40,7 @@ class past_3_days extends \core_analytics\local\time_splitting\past_periodic { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:past3days'); } diff --git a/lib/classes/analytics/time_splitting/past_month.php b/lib/classes/analytics/time_splitting/past_month.php index 3d73569eaf5..d37776b672e 100644 --- a/lib/classes/analytics/time_splitting/past_month.php +++ b/lib/classes/analytics/time_splitting/past_month.php @@ -40,7 +40,7 @@ class past_month extends \core_analytics\local\time_splitting\past_periodic { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:pastmonth'); } diff --git a/lib/classes/analytics/time_splitting/past_week.php b/lib/classes/analytics/time_splitting/past_week.php index 438e5ac0e0a..3c202814549 100644 --- a/lib/classes/analytics/time_splitting/past_week.php +++ b/lib/classes/analytics/time_splitting/past_week.php @@ -39,7 +39,7 @@ class past_week extends \core_analytics\local\time_splitting\past_periodic { * The time splitting method name. * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:pastweek'); } diff --git a/lib/classes/analytics/time_splitting/quarters.php b/lib/classes/analytics/time_splitting/quarters.php index 9245f2b9d7a..157b396b3b7 100644 --- a/lib/classes/analytics/time_splitting/quarters.php +++ b/lib/classes/analytics/time_splitting/quarters.php @@ -44,7 +44,7 @@ class quarters extends \core_analytics\local\time_splitting\equal_parts { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:quarters'); } diff --git a/lib/classes/analytics/time_splitting/quarters_accum.php b/lib/classes/analytics/time_splitting/quarters_accum.php index 475c92ddf9b..7756f6f2927 100644 --- a/lib/classes/analytics/time_splitting/quarters_accum.php +++ b/lib/classes/analytics/time_splitting/quarters_accum.php @@ -44,7 +44,7 @@ class quarters_accum extends \core_analytics\local\time_splitting\accumulative_p * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:quartersaccum'); } diff --git a/lib/classes/analytics/time_splitting/single_range.php b/lib/classes/analytics/time_splitting/single_range.php index 55373b752cd..b51d8074105 100644 --- a/lib/classes/analytics/time_splitting/single_range.php +++ b/lib/classes/analytics/time_splitting/single_range.php @@ -45,7 +45,7 @@ class single_range extends \core_analytics\local\time_splitting\base * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:singlerange'); } diff --git a/lib/classes/analytics/time_splitting/ten_percent_after_start.php b/lib/classes/analytics/time_splitting/ten_percent_after_start.php index a8b5642a6f4..4fbd9adbc8d 100644 --- a/lib/classes/analytics/time_splitting/ten_percent_after_start.php +++ b/lib/classes/analytics/time_splitting/ten_percent_after_start.php @@ -40,7 +40,7 @@ class ten_percent_after_start extends \core_analytics\local\time_splitting\after * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:tenpercentafterstart'); } diff --git a/lib/classes/analytics/time_splitting/upcoming_3_days.php b/lib/classes/analytics/time_splitting/upcoming_3_days.php index bb86d056649..df33f605348 100644 --- a/lib/classes/analytics/time_splitting/upcoming_3_days.php +++ b/lib/classes/analytics/time_splitting/upcoming_3_days.php @@ -39,7 +39,7 @@ class upcoming_3_days extends \core_analytics\local\time_splitting\upcoming_peri * The time splitting method name. * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:upcoming3days'); } diff --git a/lib/classes/analytics/time_splitting/upcoming_fortnight.php b/lib/classes/analytics/time_splitting/upcoming_fortnight.php index 0b6aeb7bf92..793f5dcb6db 100644 --- a/lib/classes/analytics/time_splitting/upcoming_fortnight.php +++ b/lib/classes/analytics/time_splitting/upcoming_fortnight.php @@ -39,7 +39,7 @@ class upcoming_fortnight extends \core_analytics\local\time_splitting\upcoming_p * The time splitting method name. * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:upcomingfortnight'); } diff --git a/lib/classes/analytics/time_splitting/upcoming_week.php b/lib/classes/analytics/time_splitting/upcoming_week.php index e8fbd4ea506..6106373510d 100644 --- a/lib/classes/analytics/time_splitting/upcoming_week.php +++ b/lib/classes/analytics/time_splitting/upcoming_week.php @@ -39,7 +39,7 @@ class upcoming_week extends \core_analytics\local\time_splitting\upcoming_period * The time splitting method name. * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('timesplitting:upcomingweek'); } diff --git a/lib/classes/antivirus/quarantine.php b/lib/classes/antivirus/quarantine.php index e3136ffa8a0..3073d765b13 100644 --- a/lib/classes/antivirus/quarantine.php +++ b/lib/classes/antivirus/quarantine.php @@ -66,7 +66,7 @@ class quarantine { * @return string|null the name of the newly created quarantined file. * @throws \dml_exception */ - public static function quarantine_file(string $file, string $filename, string $incidentdetails, string $notice) : ?string { + public static function quarantine_file(string $file, string $filename, string $incidentdetails, string $notice): ?string { if (!self::is_quarantine_enabled()) { return null; } @@ -97,7 +97,7 @@ class quarantine { * @return string|null the name of the newly created quarantined file. * @throws \dml_exception */ - public static function quarantine_data(string $data, string $filename, string $incidentdetails, string $notice) : ?string { + public static function quarantine_data(string $data, string $filename, string $incidentdetails, string $notice): ?string { if (!self::is_quarantine_enabled()) { return null; } @@ -124,7 +124,7 @@ class quarantine { * @return bool * @throws \dml_exception */ - public static function is_quarantine_enabled() : bool { + public static function is_quarantine_enabled(): bool { return !empty(get_config("antivirus", "enablequarantine")); } @@ -133,7 +133,7 @@ class quarantine { * * @return string path of quarantine folder */ - private static function get_quarantine_folder() : string { + private static function get_quarantine_folder(): string { global $CFG; $quarantinefolder = $CFG->dataroot . DIRECTORY_SEPARATOR . self::DEFAULT_QUARANTINE_FOLDER; if (!file_exists($quarantinefolder)) { @@ -148,7 +148,7 @@ class quarantine { * @param string $filename the filename to check. * @return boolean whether file exists. */ - public static function quarantined_file_exists(string $filename) : bool { + public static function quarantined_file_exists(string $filename): bool { $folder = self::get_quarantine_folder(); return file_exists($folder . $filename); } @@ -238,7 +238,7 @@ class quarantine { * * @return array list of quarantined files. */ - public static function get_quarantined_files() : array { + public static function get_quarantined_files(): array { $files = new \DirectoryIterator(self::get_quarantine_folder()); $filestosort = []; diff --git a/lib/classes/antivirus/scanner.php b/lib/classes/antivirus/scanner.php index e36ba57fd29..80559944d9e 100644 --- a/lib/classes/antivirus/scanner.php +++ b/lib/classes/antivirus/scanner.php @@ -235,7 +235,7 @@ abstract class scanner { * * @return array */ - public function get_messages() : array { + public function get_messages(): array { return $this->messages; } diff --git a/lib/classes/check/manager.php b/lib/classes/check/manager.php index 14f4a83ec70..e855c4c2238 100644 --- a/lib/classes/check/manager.php +++ b/lib/classes/check/manager.php @@ -62,7 +62,7 @@ class manager { * * @return array of check objects */ - static public function get_performance_checks() : array { + static public function get_performance_checks(): array { $checks = [ new performance\designermode(), new performance\cachejs(), diff --git a/lib/classes/context_helper.php b/lib/classes/context_helper.php index 30a87368728..d60b39c5b3e 100644 --- a/lib/classes/context_helper.php +++ b/lib/classes/context_helper.php @@ -51,7 +51,7 @@ abstract class context_helper extends context { /** * Initialise context levels, call before using self::$alllevels. */ - private static function init_levels():void { + private static function init_levels(): void { global $CFG; if (isset(self::$alllevels)) { diff --git a/lib/classes/date.php b/lib/classes/date.php index 01b8ac0b664..6c97e05f45a 100644 --- a/lib/classes/date.php +++ b/lib/classes/date.php @@ -710,7 +710,7 @@ class core_date { * @return string * @author BohwaZ */ - public static function strftime(string $format, $timestamp = null, ?string $locale = null) : string { + public static function strftime(string $format, $timestamp = null, ?string $locale = null): string { // Moodle-specific modification. For the IntlDateFormatter we need to use unix-style locale // from the string 'locale' even for Windows, so we can neither use moodle_getlocale(). // nor rely on the setlocale() use below. We also ignore $CFG->locale because it can use diff --git a/lib/classes/dml/table.php b/lib/classes/dml/table.php index 3cf86d01b0e..c0fa8603dba 100644 --- a/lib/classes/dml/table.php +++ b/lib/classes/dml/table.php @@ -68,7 +68,7 @@ class table { * * @return string */ - public function get_from_sql() : string { + public function get_from_sql(): string { return "{{$this->tablename}} {$this->tablealias}"; } @@ -77,7 +77,7 @@ class table { * * @return array The list of columns in a table. The array key is the column name with an applied prefix. */ - protected function get_fieldlist() : array { + protected function get_fieldlist(): array { global $DB; if (null === $this->fields) { @@ -99,7 +99,7 @@ class table { * * @return string The SQL to use in the SELECT */ - public function get_field_select() : string { + public function get_field_select(): string { $fieldlist = $this->get_fieldlist(); return implode(', ', array_map(function($fieldname, $fieldalias) { @@ -115,7 +115,7 @@ class table { * @param stdClass $result The result retrieved from the database with fields to be extracted * @return stdClass The extracted result */ - public function extract_from_result(stdClass $result) : stdClass { + public function extract_from_result(stdClass $result): stdClass { $record = new stdClass(); $fieldlist = $this->get_fieldlist(); diff --git a/lib/classes/event/message_deleted.php b/lib/classes/event/message_deleted.php index ab38448b1db..bb9dcf2e9e1 100644 --- a/lib/classes/event/message_deleted.php +++ b/lib/classes/event/message_deleted.php @@ -51,7 +51,7 @@ class message_deleted extends base { * @param int $muaid The id in the message_user_actions table. * @return message_deleted */ - public static function create_from_ids(int $userid, int $userdeleting, int $messageid, int $muaid) : message_deleted { + public static function create_from_ids(int $userid, int $userdeleting, int $messageid, int $muaid): message_deleted { // We set the userid to the user who deleted the message, nothing to do // with whether or not they sent or received the message. $event = self::create(array( diff --git a/lib/classes/local/guzzle/cache_item.php b/lib/classes/local/guzzle/cache_item.php index 23ef6d875d4..ccfc4f2ab6c 100644 --- a/lib/classes/local/guzzle/cache_item.php +++ b/lib/classes/local/guzzle/cache_item.php @@ -114,7 +114,7 @@ class cache_item { * * @return bool True if the request resulted in a cache hit. False otherwise. */ - public function is_hit():bool { + public function is_hit(): bool { if (!$this->ishit) { return false; } diff --git a/lib/classes/message/manager.php b/lib/classes/message/manager.php index ba0a9d4807c..fc6001a8835 100644 --- a/lib/classes/message/manager.php +++ b/lib/classes/message/manager.php @@ -64,7 +64,7 @@ class manager { * @param \stdClass $savemessage * @return int */ - public static function send_message_to_conversation(message $eventdata, \stdClass $savemessage) : int { + public static function send_message_to_conversation(message $eventdata, \stdClass $savemessage): int { global $DB, $CFG, $SITE; if (empty($eventdata->convid)) { diff --git a/lib/classes/output/mustache_template_source_loader.php b/lib/classes/output/mustache_template_source_loader.php index 471bc0c6feb..b71dc4f5c63 100644 --- a/lib/classes/output/mustache_template_source_loader.php +++ b/lib/classes/output/mustache_template_source_loader.php @@ -69,7 +69,7 @@ class mustache_template_source_loader { * @param string $templatestr * @return string */ - protected function strip_template_comments($templatestr) : string { + protected function strip_template_comments($templatestr): string { return preg_replace('/(?={{!)(.*)(}})/sU', '', $templatestr); } @@ -87,7 +87,7 @@ class mustache_template_source_loader { string $name, string $themename, bool $includecomments = false - ) : string { + ): string { global $CFG; // Get the template source from the callback. $source = ($this->gettemplatesource)($component, $name, $themename); @@ -152,7 +152,7 @@ class mustache_template_source_loader { array $seentemplates = [], array $seenstrings = [], string $lang = null - ) : array { + ): array { // Initialise the return values. $templates = []; $strings = []; @@ -286,7 +286,7 @@ class mustache_template_source_loader { * @param string $source The template source * @return array */ - protected function scan_template_source_for_dependencies(string $source) : array { + protected function scan_template_source_for_dependencies(string $source): array { $tokenizer = new Mustache_Tokenizer(); $tokens = $tokenizer->scan($source); $templates = []; diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index dfd5943b586..0d072f55af3 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -909,7 +909,7 @@ class core_plugin_manager { * @param int $branch the moodle branch to check support for * @return string */ - public function check_explicitly_supported($plugin, $branch) : string { + public function check_explicitly_supported($plugin, $branch): string { // Check for correctly formed supported. if (isset($plugin->pluginsupported)) { // Broken apart for readability. diff --git a/lib/classes/plugininfo/base.php b/lib/classes/plugininfo/base.php index 0ce1b971f5b..591d330dbd8 100644 --- a/lib/classes/plugininfo/base.php +++ b/lib/classes/plugininfo/base.php @@ -428,7 +428,7 @@ abstract class base { * @param int $branch the moodle branch number * @return bool true if not incompatible with moodle branch */ - public function is_core_compatible_satisfied(int $branch) : bool { + public function is_core_compatible_satisfied(int $branch): bool { if (!empty($this->pluginincompatible) && ($branch >= $this->pluginincompatible)) { return false; } else { diff --git a/lib/classes/privacy/provider.php b/lib/classes/privacy/provider.php index 48b1e8a0b11..7f9de0f851b 100644 --- a/lib/classes/privacy/provider.php +++ b/lib/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @param collection $collection A list of information about this component * @return collection The collection object filled out with information about this component. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { // Except for moodlenet_share_progress, these tables are really data about site configuration and not user data. // The config_log includes information about which user performed a configuration change. @@ -151,7 +151,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // MoodleNet share progress uses the user context. diff --git a/lib/classes/report_helper.php b/lib/classes/report_helper.php index d84e0a0f144..e8cb401459c 100644 --- a/lib/classes/report_helper.php +++ b/lib/classes/report_helper.php @@ -40,7 +40,7 @@ class report_helper { * @param string $pluginname The report plugin where the header is modified * @return void */ - public static function print_report_selector(string $pluginname):void { + public static function print_report_selector(string $pluginname): void { global $OUTPUT, $PAGE; if ($reportnode = $PAGE->settingsnav->find('coursereports', \navigation_node::TYPE_CONTAINER)) { @@ -98,7 +98,7 @@ class report_helper { * @param moodle_url $url The moodle url * @return void */ - public static function save_selected_report(int $id, moodle_url $url):void { + public static function save_selected_report(int $id, moodle_url $url): void { global $USER; debugging('save_selected_report() has been deprecated because it is no longer used and will be '. diff --git a/lib/classes/session/manager.php b/lib/classes/session/manager.php index 433273889c5..90a1b712cf6 100644 --- a/lib/classes/session/manager.php +++ b/lib/classes/session/manager.php @@ -1454,7 +1454,7 @@ class manager { * @param array $current * @return array */ - private static function array_session_diff(array $previous, array $current) : array { + private static function array_session_diff(array $previous, array $current): array { // To use array_udiff_uassoc, the first array must have the most keys; this ensures every key is checked. // To do this, we first need to sort them by the length of their keys. $arrays = [$current, $previous]; diff --git a/lib/classes/session/memcached.php b/lib/classes/session/memcached.php index 58307a3e217..7b76be86e5c 100644 --- a/lib/classes/session/memcached.php +++ b/lib/classes/session/memcached.php @@ -281,7 +281,7 @@ class memcached extends handler { * @param string $str save_path value containing memcached connection string * @return array[] */ - protected static function connection_string_to_memcache_servers(string $str) : array { + protected static function connection_string_to_memcache_servers(string $str): array { $servers = []; $parts = explode(',', $str); foreach ($parts as $part) { diff --git a/lib/classes/task/database_logger.php b/lib/classes/task/database_logger.php index d1978fd2423..2b0b9d50919 100644 --- a/lib/classes/task/database_logger.php +++ b/lib/classes/task/database_logger.php @@ -44,7 +44,7 @@ class database_logger implements task_logger { * * @return bool */ - public static function is_configured() : bool { + public static function is_configured(): bool { return true; } @@ -91,7 +91,7 @@ class database_logger implements task_logger { * * @return bool */ - public static function has_log_report() : bool { + public static function has_log_report(): bool { return true; } @@ -101,7 +101,7 @@ class database_logger implements task_logger { * @param string $classname The task class to fetch for * @return \moodle_url */ - public static function get_url_for_task_class(string $classname) : \moodle_url { + public static function get_url_for_task_class(string $classname): \moodle_url { global $CFG; return new \moodle_url("/{$CFG->admin}/tasklogs.php", [ diff --git a/lib/classes/task/logmanager.php b/lib/classes/task/logmanager.php index b0efd994e91..7f43282bbad 100644 --- a/lib/classes/task/logmanager.php +++ b/lib/classes/task/logmanager.php @@ -145,7 +145,7 @@ class logmanager { * * @return bool */ - protected static function should_log() : bool { + protected static function should_log(): bool { global $CFG; // Respect the config setting. @@ -166,7 +166,7 @@ class logmanager { * * @return string */ - public static function get_logger_classname() : string { + public static function get_logger_classname(): string { global $CFG; if (!empty($CFG->task_log_class)) { @@ -183,7 +183,7 @@ class logmanager { * * @return bool */ - public static function has_log_report() : bool { + public static function has_log_report(): bool { $loggerclass = self::get_logger_classname(); return $loggerclass::has_log_report(); @@ -192,7 +192,7 @@ class logmanager { /** * Whether to use the standard settings form. */ - public static function uses_standard_settings() : bool { + public static function uses_standard_settings(): bool { $classname = self::get_logger_classname(); if (!class_exists($classname)) { return false; @@ -211,7 +211,7 @@ class logmanager { * @param string $classname The task class to fetch for * @return \moodle_url */ - public static function get_url_for_task_class(string $classname) : \moodle_url { + public static function get_url_for_task_class(string $classname): \moodle_url { $loggerclass = self::get_logger_classname(); return $loggerclass::get_url_for_task_class($classname); @@ -222,7 +222,7 @@ class logmanager { * * @return bool */ - protected static function is_current_output_buffer() : bool { + protected static function is_current_output_buffer(): bool { if (empty(self::$taskloginfo)) { return false; } @@ -239,7 +239,7 @@ class logmanager { * * @return bool */ - protected static function is_capturing() : bool { + protected static function is_capturing(): bool { $buffers = ob_get_status(true); foreach ($buffers as $ob) { if ('core\\task\\logmanager::add_line' == $ob['name']) { @@ -330,7 +330,7 @@ class logmanager { * @param string $log * @return string */ - public static function add_line(string $log) : string { + public static function add_line(string $log): string { if (empty(self::$taskloginfo)) { return $log; } diff --git a/lib/classes/task/manager.php b/lib/classes/task/manager.php index d839eedac75..349e1bc983e 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -212,7 +212,7 @@ class manager { * @param \core\task\adhoc_task $task - The new adhoc task information to store. * @since Moodle 3.7 */ - public static function reschedule_or_queue_adhoc_task(adhoc_task $task) : void { + public static function reschedule_or_queue_adhoc_task(adhoc_task $task): void { global $DB; if ($existingrecord = self::get_queued_adhoc_task_record($task)) { @@ -1523,7 +1523,7 @@ class manager { * * @return bool */ - public static function is_runnable():bool { + public static function is_runnable(): bool { return self::find_php_cli_path() !== false; } diff --git a/lib/classes/task/task_logger.php b/lib/classes/task/task_logger.php index d9118b69e89..21ba920926e 100644 --- a/lib/classes/task/task_logger.php +++ b/lib/classes/task/task_logger.php @@ -38,7 +38,7 @@ interface task_logger { * * @return bool */ - public static function is_configured() : bool; + public static function is_configured(): bool; /** * Store the log for the specified task. @@ -59,7 +59,7 @@ interface task_logger { * * @return bool */ - public static function has_log_report() : bool; + public static function has_log_report(): bool; /** * Get any URL available for viewing relevant task log reports. @@ -67,5 +67,5 @@ interface task_logger { * @param string $classname The task class to fetch for * @return \moodle_url */ - public static function get_url_for_task_class(string $classname) : \moodle_url; + public static function get_url_for_task_class(string $classname): \moodle_url; } diff --git a/lib/classes/useragent.php b/lib/classes/useragent.php index a223dab4389..1e8cc91ec14 100644 --- a/lib/classes/useragent.php +++ b/lib/classes/useragent.php @@ -1183,7 +1183,7 @@ class core_useragent { * @param string $extension * @return bool */ - public static function supports_media_source_extensions(string $extension) : bool { + public static function supports_media_source_extensions(string $extension): bool { // Not supported in IE below 11.0. if (self::is_ie() && !self::check_ie_version('11.0')) { return false; diff --git a/lib/ddl/mysql_sql_generator.php b/lib/ddl/mysql_sql_generator.php index 3c969501f75..3e12dc1c05e 100644 --- a/lib/ddl/mysql_sql_generator.php +++ b/lib/ddl/mysql_sql_generator.php @@ -540,7 +540,7 @@ class mysql_sql_generator extends sql_generator { * @param xmldb_table $xmldb_table The xmldb_table object instance. * @return array Array of SQL statements to add one comment to the table. */ - function getCommentSQL ($xmldb_table) { + function getCommentSQL($xmldb_table) { $comment = ''; if ($xmldb_table->getComment()) { diff --git a/lib/ddl/oracle_sql_generator.php b/lib/ddl/oracle_sql_generator.php index e5013168f63..ea7d8067414 100644 --- a/lib/ddl/oracle_sql_generator.php +++ b/lib/ddl/oracle_sql_generator.php @@ -344,7 +344,7 @@ class oracle_sql_generator extends sql_generator { * @param xmldb_table $xmldb_table The xmldb_table object instance. * @return array Array of SQL statements to add one comment to the table. */ - function getCommentSQL ($xmldb_table) { + function getCommentSQL($xmldb_table) { $comment = "COMMENT ON TABLE " . $this->getTableName($xmldb_table); $comment.= " IS '" . $this->addslashes(substr($xmldb_table->getComment(), 0, 250)) . "'"; diff --git a/lib/ddl/postgres_sql_generator.php b/lib/ddl/postgres_sql_generator.php index eeb3354a082..74417a904fe 100644 --- a/lib/ddl/postgres_sql_generator.php +++ b/lib/ddl/postgres_sql_generator.php @@ -201,7 +201,7 @@ class postgres_sql_generator extends sql_generator { * @param xmldb_table $xmldb_table The xmldb_table object instance. * @return array Array of SQL statements to add one comment to the table. */ - function getCommentSQL ($xmldb_table) { + function getCommentSQL($xmldb_table) { $comment = "COMMENT ON TABLE " . $this->getTableName($xmldb_table); $comment.= " IS '" . $this->addslashes(substr($xmldb_table->getComment(), 0, 250)) . "'"; diff --git a/lib/ddl/sqlite_sql_generator.php b/lib/ddl/sqlite_sql_generator.php index c0b088cfbbd..cf60b339644 100644 --- a/lib/ddl/sqlite_sql_generator.php +++ b/lib/ddl/sqlite_sql_generator.php @@ -397,7 +397,7 @@ class sqlite_sql_generator extends sql_generator { * @param xmldb_table $xmldb_table The xmldb_table object instance. * @return array Array of SQL statements to add one comment to the table. */ - function getCommentSQL ($xmldb_table) { + function getCommentSQL($xmldb_table) { return array(); } diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index 5559fc64d31..f2382382489 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -719,7 +719,7 @@ class oci_native_moodle_database extends moodle_database { * @param $field string the field where the record is going to be inserted/updated * @param $value mixed the value to be inserted/updated */ - private function oracle_dirty_hack ($table, $field, $value) { + private function oracle_dirty_hack($table, $field, $value) { // General bound parameter, just hack the spaces and pray it will work. if (!$table) { diff --git a/lib/dml/tests/dml_read_slave_test.php b/lib/dml/tests/dml_read_slave_test.php index d0f04e0c09e..9d751462926 100644 --- a/lib/dml/tests/dml_read_slave_test.php +++ b/lib/dml/tests/dml_read_slave_test.php @@ -61,7 +61,7 @@ class dml_read_slave_test extends \base_testcase { ['dbhost' => 'test_ro3', 'dbport' => 3, 'dbuser' => 'test3', 'dbpass' => 'test3'], ], $dbclass = read_slave_moodle_database::class - ) : read_slave_moodle_database { + ): read_slave_moodle_database { $dbhost = 'test_rw'; $dbname = 'test'; $dbuser = 'test'; @@ -84,7 +84,7 @@ class dml_read_slave_test extends \base_testcase { * @param string $handle * @return void */ - private function assert_readonly_handle($handle) : void { + private function assert_readonly_handle($handle): void { $this->assertMatchesRegularExpression('/^test_ro\d:\d:test\d:test\d$/', $handle); } @@ -94,7 +94,7 @@ class dml_read_slave_test extends \base_testcase { * @return array * @dataProvider table_names_provider */ - public function table_names_provider() : array { + public function table_names_provider(): array { return [ [ "SELECT * @@ -140,7 +140,7 @@ class dml_read_slave_test extends \base_testcase { * @return void * @dataProvider table_names_provider */ - public function test_table_names($sql, $tables) : void { + public function test_table_names($sql, $tables): void { $db = new read_slave_moodle_database_table_names(); $this->assertEquals($tables, $db->table_names($db->fix_sql_params($sql)[0])); @@ -152,7 +152,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_read_read_write_read() : void { + public function test_read_read_write_read(): void { $DB = $this->new_db(true); $this->assertEquals(0, $DB->perf_get_reads_slave()); @@ -192,7 +192,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_read_write_write() : void { + public function test_read_write_write(): void { $DB = $this->new_db(); $this->assertEquals(0, $DB->perf_get_reads_slave()); @@ -217,7 +217,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_write_read_read() : void { + public function test_write_read_read(): void { $DB = $this->new_db(); $this->assertEquals(0, $DB->perf_get_reads_slave()); @@ -255,7 +255,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_read_temptable() : void { + public function test_read_temptable(): void { $DB = $this->new_db(); $DB->add_temptable('temptable1'); @@ -274,7 +274,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_read_excluded_tables() : void { + public function test_read_excluded_tables(): void { $DB = $this->new_db(); $this->assertEquals(0, $DB->perf_get_reads_slave()); @@ -457,7 +457,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_read_only_conn_fail() : void { + public function test_read_only_conn_fail(): void { $DB = $this->new_db(false, 'test_ro_fail'); $this->assertEquals(0, $DB->perf_get_reads_slave()); @@ -475,7 +475,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_read_only_conn_first_fail() : void { + public function test_read_only_conn_first_fail(): void { $DB = $this->new_db(false, ['test_ro_fail', 'test_ro_ok']); $this->assertEquals(0, $DB->perf_get_reads_slave()); @@ -510,7 +510,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_lock_db() : void { + public function test_lock_db(): void { $this->with_global_db(function () { global $DB; @@ -544,7 +544,7 @@ class dml_read_slave_test extends \base_testcase { * * @return void */ - public function test_sessions() : void { + public function test_sessions(): void { $this->with_global_db(function () { global $DB, $CFG; diff --git a/lib/dml/tests/dml_table_test.php b/lib/dml/tests/dml_table_test.php index 49da717dddf..16b444aff79 100644 --- a/lib/dml/tests/dml_table_test.php +++ b/lib/dml/tests/dml_table_test.php @@ -35,7 +35,7 @@ class dml_table_test extends \database_driver_testcase { * * @return array */ - public function get_field_select_provider() : array { + public function get_field_select_provider(): array { return [ 'single field' => [ 'tablename' => 'test_table_single', @@ -102,7 +102,7 @@ class dml_table_test extends \database_driver_testcase { * * @return array */ - public function extract_from_result_provider() : array { + public function extract_from_result_provider(): array { return [ 'single table' => [ 'fieldlist' => [ diff --git a/lib/dml/tests/fixtures/read_slave_moodle_database_table_names.php b/lib/dml/tests/fixtures/read_slave_moodle_database_table_names.php index b676b11c33d..c5ec5fff7e8 100644 --- a/lib/dml/tests/fixtures/read_slave_moodle_database_table_names.php +++ b/lib/dml/tests/fixtures/read_slave_moodle_database_table_names.php @@ -48,7 +48,7 @@ class read_slave_moodle_database_table_names extends read_slave_moodle_database * @param string $sql * @return array */ - public function table_names(string $sql) : array { + public function table_names(string $sql): array { return parent::table_names($sql); } } diff --git a/lib/dml/tests/fixtures/test_moodle_database.php b/lib/dml/tests/fixtures/test_moodle_database.php index 0b680e77b87..387defdf74b 100644 --- a/lib/dml/tests/fixtures/test_moodle_database.php +++ b/lib/dml/tests/fixtures/test_moodle_database.php @@ -164,7 +164,7 @@ abstract class test_moodle_database extends \moodle_database { * @param string $table * @return array database_column_info[] of database_column_info objects indexed with column names */ - public function fetch_columns($table) : array { + public function fetch_columns($table): array { return $this->_tables[$table]['columns']; } diff --git a/lib/dml/tests/fixtures/test_sql_generator.php b/lib/dml/tests/fixtures/test_sql_generator.php index 5075ea8bf81..c84c678f5b6 100644 --- a/lib/dml/tests/fixtures/test_sql_generator.php +++ b/lib/dml/tests/fixtures/test_sql_generator.php @@ -83,7 +83,7 @@ class test_sql_generator extends \sql_generator { * @param xmldb_table $xmldbtable The xmldb_table object instance. * @return array Array of SQL statements to add one comment to the table. */ - function getCommentSQL ($xmldbtable) { + function getCommentSQL($xmldbtable) { return []; } diff --git a/lib/editor/atto/classes/privacy/provider.php b/lib/editor/atto/classes/privacy/provider.php index d64802e5615..f00f72aeedf 100644 --- a/lib/editor/atto/classes/privacy/provider.php +++ b/lib/editor/atto/classes/privacy/provider.php @@ -54,7 +54,7 @@ class provider implements * @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 { // There isn't much point giving details about the pageid, etc. $collection->add_database_table('editor_atto_autosave', [ 'userid' => 'privacy:metadata:database:atto_autosave:userid', @@ -71,7 +71,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { // This block doesn't know who information is stored against unless it // is at the user context. $contextlist = new \core_privacy\local\request\contextlist(); diff --git a/lib/editor/atto/plugins/accessibilitychecker/classes/privacy/provider.php b/lib/editor/atto/plugins/accessibilitychecker/classes/privacy/provider.php index 21157db2fe5..08363c35533 100644 --- a/lib/editor/atto/plugins/accessibilitychecker/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/accessibilitychecker/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/accessibilityhelper/classes/privacy/provider.php b/lib/editor/atto/plugins/accessibilityhelper/classes/privacy/provider.php index 5fb9f7cf6de..d04a2cf2dab 100644 --- a/lib/editor/atto/plugins/accessibilityhelper/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/accessibilityhelper/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/align/classes/privacy/provider.php b/lib/editor/atto/plugins/align/classes/privacy/provider.php index 425d3db6b5d..c528965c356 100644 --- a/lib/editor/atto/plugins/align/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/align/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/backcolor/classes/privacy/provider.php b/lib/editor/atto/plugins/backcolor/classes/privacy/provider.php index 2550052ea19..fb2bc0b927a 100644 --- a/lib/editor/atto/plugins/backcolor/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/backcolor/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/bold/classes/privacy/provider.php b/lib/editor/atto/plugins/bold/classes/privacy/provider.php index e43f923a429..f2504984ab9 100644 --- a/lib/editor/atto/plugins/bold/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/bold/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/charmap/classes/privacy/provider.php b/lib/editor/atto/plugins/charmap/classes/privacy/provider.php index 77a6661ea10..8667870103b 100644 --- a/lib/editor/atto/plugins/charmap/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/charmap/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/clear/classes/privacy/provider.php b/lib/editor/atto/plugins/clear/classes/privacy/provider.php index 51444de868a..f1a58c471f7 100644 --- a/lib/editor/atto/plugins/clear/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/clear/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/collapse/classes/privacy/provider.php b/lib/editor/atto/plugins/collapse/classes/privacy/provider.php index 96e28fc6d19..74b37ac80e3 100644 --- a/lib/editor/atto/plugins/collapse/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/collapse/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/emojipicker/classes/privacy/provider.php b/lib/editor/atto/plugins/emojipicker/classes/privacy/provider.php index 308bf19c07b..a88d6213b28 100644 --- a/lib/editor/atto/plugins/emojipicker/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/emojipicker/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/emoticon/classes/privacy/provider.php b/lib/editor/atto/plugins/emoticon/classes/privacy/provider.php index fb8c118dff5..8260c4d3fe2 100644 --- a/lib/editor/atto/plugins/emoticon/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/emoticon/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/equation/classes/privacy/provider.php b/lib/editor/atto/plugins/equation/classes/privacy/provider.php index cc0013c309d..d561a457811 100644 --- a/lib/editor/atto/plugins/equation/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/equation/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/fontcolor/classes/privacy/provider.php b/lib/editor/atto/plugins/fontcolor/classes/privacy/provider.php index e0ab4a1695b..e5acab98396 100644 --- a/lib/editor/atto/plugins/fontcolor/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/fontcolor/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/h5p/classes/privacy/provider.php b/lib/editor/atto/plugins/h5p/classes/privacy/provider.php index e2b5aeba9aa..02fd75886b7 100644 --- a/lib/editor/atto/plugins/h5p/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/h5p/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/html/classes/privacy/provider.php b/lib/editor/atto/plugins/html/classes/privacy/provider.php index a6608e35f90..39f86dd5352 100644 --- a/lib/editor/atto/plugins/html/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/html/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/image/classes/privacy/provider.php b/lib/editor/atto/plugins/image/classes/privacy/provider.php index cb316bed29f..d816dbc8650 100644 --- a/lib/editor/atto/plugins/image/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/image/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/indent/classes/privacy/provider.php b/lib/editor/atto/plugins/indent/classes/privacy/provider.php index eec699b8cfb..189f1562601 100644 --- a/lib/editor/atto/plugins/indent/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/indent/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/italic/classes/privacy/provider.php b/lib/editor/atto/plugins/italic/classes/privacy/provider.php index 0f5b90adbba..679c37b4cca 100644 --- a/lib/editor/atto/plugins/italic/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/italic/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/link/classes/privacy/provider.php b/lib/editor/atto/plugins/link/classes/privacy/provider.php index 6ce529985c1..aaba0c34ce8 100644 --- a/lib/editor/atto/plugins/link/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/link/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/managefiles/classes/privacy/provider.php b/lib/editor/atto/plugins/managefiles/classes/privacy/provider.php index 65be12e51b9..88884c99443 100644 --- a/lib/editor/atto/plugins/managefiles/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/managefiles/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/media/classes/privacy/provider.php b/lib/editor/atto/plugins/media/classes/privacy/provider.php index 9ad589487d1..1a6cb8bf7f3 100644 --- a/lib/editor/atto/plugins/media/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/media/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/noautolink/classes/privacy/provider.php b/lib/editor/atto/plugins/noautolink/classes/privacy/provider.php index 7f8f9cfc79b..9713f815781 100644 --- a/lib/editor/atto/plugins/noautolink/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/noautolink/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/orderedlist/classes/privacy/provider.php b/lib/editor/atto/plugins/orderedlist/classes/privacy/provider.php index 0df799b3999..345db74f162 100644 --- a/lib/editor/atto/plugins/orderedlist/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/orderedlist/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/recordrtc/classes/privacy/provider.php b/lib/editor/atto/plugins/recordrtc/classes/privacy/provider.php index 07aafd28315..af274ca0464 100644 --- a/lib/editor/atto/plugins/recordrtc/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/recordrtc/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/rtl/classes/privacy/provider.php b/lib/editor/atto/plugins/rtl/classes/privacy/provider.php index 18f80c5836c..64adb906bf5 100644 --- a/lib/editor/atto/plugins/rtl/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/rtl/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/strike/classes/privacy/provider.php b/lib/editor/atto/plugins/strike/classes/privacy/provider.php index 22a903b0758..dc2dd6b5230 100644 --- a/lib/editor/atto/plugins/strike/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/strike/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/subscript/classes/privacy/provider.php b/lib/editor/atto/plugins/subscript/classes/privacy/provider.php index 23200d87457..72eae49e118 100644 --- a/lib/editor/atto/plugins/subscript/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/subscript/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/superscript/classes/privacy/provider.php b/lib/editor/atto/plugins/superscript/classes/privacy/provider.php index 2ae92a41e80..562e4a145ca 100644 --- a/lib/editor/atto/plugins/superscript/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/superscript/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/table/classes/privacy/provider.php b/lib/editor/atto/plugins/table/classes/privacy/provider.php index 296a66a8733..2c8399a3a44 100644 --- a/lib/editor/atto/plugins/table/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/table/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/title/classes/privacy/provider.php b/lib/editor/atto/plugins/title/classes/privacy/provider.php index 4dd5d7661db..67f1198f64f 100644 --- a/lib/editor/atto/plugins/title/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/title/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/underline/classes/privacy/provider.php b/lib/editor/atto/plugins/underline/classes/privacy/provider.php index b74f896951e..f4ac5df3220 100644 --- a/lib/editor/atto/plugins/underline/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/underline/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/undo/classes/privacy/provider.php b/lib/editor/atto/plugins/undo/classes/privacy/provider.php index e46eea75e84..3990d701d84 100644 --- a/lib/editor/atto/plugins/undo/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/undo/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/atto/plugins/unorderedlist/classes/privacy/provider.php b/lib/editor/atto/plugins/unorderedlist/classes/privacy/provider.php index f589b9c6976..346d492921b 100644 --- a/lib/editor/atto/plugins/unorderedlist/classes/privacy/provider.php +++ b/lib/editor/atto/plugins/unorderedlist/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/editor/classes/privacy/provider.php b/lib/editor/classes/privacy/provider.php index f044192e148..d4571c73bc5 100644 --- a/lib/editor/classes/privacy/provider.php +++ b/lib/editor/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('htmleditor', 'privacy:metadata:preference:htmleditor'); return $collection; diff --git a/lib/editor/textarea/classes/privacy/provider.php b/lib/editor/textarea/classes/privacy/provider.php index cebcc664074..f5564cc3282 100644 --- a/lib/editor/textarea/classes/privacy/provider.php +++ b/lib/editor/textarea/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/lib/editor/tiny/plugins/noautolink/classes/privacy/provider.php b/lib/editor/tiny/plugins/noautolink/classes/privacy/provider.php index 95ef63112b3..caede8a253c 100644 --- a/lib/editor/tiny/plugins/noautolink/classes/privacy/provider.php +++ b/lib/editor/tiny/plugins/noautolink/classes/privacy/provider.php @@ -31,7 +31,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'; } } diff --git a/lib/enrollib.php b/lib/enrollib.php index d27174a7bbd..825cce5b4f6 100644 --- a/lib/enrollib.php +++ b/lib/enrollib.php @@ -977,7 +977,7 @@ function enrol_get_users_courses($userid, $onlyactive = false, $fields = null, $ * @param int $courseid Course id. * @return array Array[$userid][$roleid] = role_assignment. */ -function enrol_get_course_users_roles(int $courseid) : array { +function enrol_get_course_users_roles(int $courseid): array { global $DB; $context = context_course::instance($courseid); @@ -3495,7 +3495,7 @@ abstract class enrol_plugin { * @param int $courseid Course ID. * @return array Updated enrolment data with custom fields info. */ - public function fill_enrol_custom_fields(array $enrolmentdata, int $courseid) : array { + public function fill_enrol_custom_fields(array $enrolmentdata, int $courseid): array { return $enrolmentdata; } @@ -3506,7 +3506,7 @@ abstract class enrol_plugin { * @param int|null $courseid Course ID. * @return array Errors */ - public function validate_enrol_plugin_data(array $enrolmentdata, ?int $courseid = null) : array { + public function validate_enrol_plugin_data(array $enrolmentdata, ?int $courseid = null): array { $errors = []; if (!$this->is_csv_upload_supported()) { $errors['errorunsupportedmethod'] = @@ -3530,7 +3530,7 @@ abstract class enrol_plugin { * @param int|null $courseid Course ID. * @return lang_string|null Error */ - public function validate_plugin_data_context(array $enrolmentdata, ?int $courseid = null) : ?lang_string { + public function validate_plugin_data_context(array $enrolmentdata, ?int $courseid = null): ?lang_string { if ($courseid) { $enrolmentdata += ['courseid' => $courseid, 'id' => 0, 'status' => ENROL_INSTANCE_ENABLED]; $instance = (object)[ @@ -3555,7 +3555,7 @@ abstract class enrol_plugin { * @param int $courseid Course ID. * @return stdClass|null Matching instance */ - public function find_instance(array $enrolmentdata, int $courseid) : ?stdClass { + public function find_instance(array $enrolmentdata, int $courseid): ?stdClass { // By default, we assume we can't uniquely identify an instance so better not update any. // Plugins can override this if they can uniquely identify an instance. diff --git a/lib/external/classes/privacy/provider.php b/lib/external/classes/privacy/provider.php index 5a930a2668c..a564fcda71e 100644 --- a/lib/external/classes/privacy/provider.php +++ b/lib/external/classes/privacy/provider.php @@ -44,7 +44,7 @@ class provider implements * @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('external_tokens', [ 'token' => 'privacy:metadata:tokens:token', diff --git a/lib/filelib.php b/lib/filelib.php index d1b9a5e4b31..a61384c1a4b 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -848,7 +848,7 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') { * @param string $filepath path for the uploaded files. * @return array An array of files associated with this draft item id. */ -function file_get_all_files_in_draftarea(int $draftitemid, string $filepath = '/') : array { +function file_get_all_files_in_draftarea(int $draftitemid, string $filepath = '/'): array { $files = []; $draftfiles = file_get_drafarea_files($draftitemid, $filepath); file_get_drafarea_folders($draftitemid, $filepath, $draftfiles); @@ -3114,23 +3114,23 @@ function get_moodle_proxy_url() { */ class curl { /** @var curl_cache|false Caches http request contents */ - public $cache = false; + public $cache = false; /** @var bool Uses proxy, null means automatic based on URL */ - public $proxy = null; + public $proxy = null; /** @var string library version */ - public $version = '0.4 dev'; + public $version = '0.4 dev'; /** @var array http's response */ - public $response = array(); + public $response = array(); /** @var array Raw response headers, needed for BC in download_file_content(). */ public $rawresponse = array(); /** @var array http header */ - public $header = array(); + public $header = array(); /** @var array cURL information */ - public $info; + public $info; /** @var string error */ - public $error; + public $error; /** @var int error code */ - public $errno; + public $errno; /** @var bool Perform redirects at PHP level instead of relying on native cURL functionality. Always true now. */ public $emulateredirects = null; diff --git a/lib/flickrlib.php b/lib/flickrlib.php index 25af647ffb4..bc8ad87837b 100644 --- a/lib/flickrlib.php +++ b/lib/flickrlib.php @@ -73,7 +73,7 @@ class phpFlickr { * @global object */ - function __construct ($api_key, $secret = NULL, $token = '') + function __construct($api_key, $secret = NULL, $token = '') { global $CFG; //The API Key must be set before any calls can be made. You can @@ -93,7 +93,7 @@ class phpFlickr { ]); } - function request ($command, $args = array()) + function request($command, $args = array()) { //Sends a request to Flickr's REST endpoint via POST. if (substr($command,0,7) != "flickr.") { @@ -217,7 +217,7 @@ class phpFlickr { /** These functions are front ends for the flickr calls */ - function buildPhotoURL ($photo, $size = "Medium") + function buildPhotoURL($photo, $size = "Medium") { //receives an array (can use the individual photo data returned //from an API call) and returns a URL (doesn't mean that the @@ -252,7 +252,7 @@ class phpFlickr { return unserialize(file_get_contents('http://phpflickr.com/geodata/?format=php&lat=' . $lat . '&lon=' . $lon)); } - function auth ($perms = "write", $remember_uri = true) + function auth($perms = "write", $remember_uri = true) { debugging('The flickrlib.php cannot be used for authenticated Flickr API calls. @@ -290,14 +290,14 @@ class phpFlickr { */ /** Activity methods */ - function activity_userComments ($per_page = NULL, $page = NULL) + function activity_userComments($per_page = NULL, $page = NULL) { /** http://www.flickr.com/services/api/flickr.activity.userComments.html */ $this->request('flickr.activity.userComments', array("per_page" => $per_page, "page" => $page)); return $this->parsed_response ? $this->parsed_response['items']['item'] : false; } - function activity_userPhotos ($timeframe = NULL, $per_page = NULL, $page = NULL) + function activity_userPhotos($timeframe = NULL, $per_page = NULL, $page = NULL) { /** http://www.flickr.com/services/api/flickr.activity.userPhotos.html */ $this->request('flickr.activity.userPhotos', array("timeframe" => $timeframe, "per_page" => $per_page, "page" => $page)); @@ -305,28 +305,28 @@ class phpFlickr { } /** Authentication methods */ - function auth_checkToken () + function auth_checkToken() { /** http://www.flickr.com/services/api/flickr.auth.checkToken.html */ $this->request('flickr.auth.checkToken'); return $this->parsed_response ? $this->parsed_response['auth'] : false; } - function auth_getFrob () + function auth_getFrob() { /** http://www.flickr.com/services/api/flickr.auth.getFrob.html */ $this->request('flickr.auth.getFrob'); return $this->parsed_response ? $this->parsed_response['frob'] : false; } - function auth_getFullToken ($mini_token) + function auth_getFullToken($mini_token) { /** http://www.flickr.com/services/api/flickr.auth.getFullToken.html */ $this->request('flickr.auth.getFullToken', array('mini_token'=>$mini_token)); return $this->parsed_response ? $this->parsed_response['auth'] : false; } - function auth_getToken ($frob) + function auth_getToken($frob) { /** http://www.flickr.com/services/api/flickr.auth.getToken.html */ $this->request('flickr.auth.getToken', array('frob'=>$frob)); @@ -335,7 +335,7 @@ class phpFlickr { } /** Blogs methods */ - function blogs_getList () + function blogs_getList() { /** http://www.flickr.com/services/api/flickr.blogs.getList.html */ $this->request('flickr.blogs.getList'); @@ -350,7 +350,7 @@ class phpFlickr { } /** Contacts Methods */ - function contacts_getList ($filter = NULL, $page = NULL, $per_page = NULL) + function contacts_getList($filter = NULL, $page = NULL, $per_page = NULL) { /** http://www.flickr.com/services/api/flickr.contacts.getList.html */ $this->request('flickr.contacts.getList', array('filter'=>$filter, 'page'=>$page, 'per_page'=>$per_page)); @@ -365,7 +365,7 @@ class phpFlickr { } /** Favorites Methods */ - function favorites_add ($photo_id) + function favorites_add($photo_id) { /** http://www.flickr.com/services/api/flickr.favorites.add.html */ $this->request('flickr.favorites.add', array('photo_id'=>$photo_id), TRUE); @@ -398,21 +398,21 @@ class phpFlickr { } /** Groups Methods */ - function groups_browse ($cat_id = NULL) + function groups_browse($cat_id = NULL) { /** http://www.flickr.com/services/api/flickr.groups.browse.html */ $this->request("flickr.groups.browse", array("cat_id"=>$cat_id)); return $this->parsed_response ? $this->parsed_response['category'] : false; } - function groups_getInfo ($group_id) + function groups_getInfo($group_id) { /** http://www.flickr.com/services/api/flickr.groups.getInfo.html */ $this->request("flickr.groups.getInfo", array("group_id"=>$group_id)); return $this->parsed_response ? $this->parsed_response['group'] : false; } - function groups_search ($text, $per_page=NULL, $page=NULL) + function groups_search($text, $per_page=NULL, $page=NULL) { /** http://www.flickr.com/services/api/flickr.groups.search.html */ $this->request("flickr.groups.search", array("text"=>$text,"per_page"=>$per_page,"page"=>$page)); @@ -420,28 +420,28 @@ class phpFlickr { } /** Groups Pools Methods */ - function groups_pools_add ($photo_id, $group_id) + function groups_pools_add($photo_id, $group_id) { /** http://www.flickr.com/services/api/flickr.groups.pools.add.html */ $this->request("flickr.groups.pools.add", array("photo_id"=>$photo_id, "group_id"=>$group_id), TRUE); return $this->parsed_response ? true : false; } - function groups_pools_getContext ($photo_id, $group_id) + function groups_pools_getContext($photo_id, $group_id) { /** http://www.flickr.com/services/api/flickr.groups.pools.getContext.html */ $this->request("flickr.groups.pools.getContext", array("photo_id"=>$photo_id, "group_id"=>$group_id)); return $this->parsed_response ? $this->parsed_response : false; } - function groups_pools_getGroups ($page = NULL, $per_page = NULL) + function groups_pools_getGroups($page = NULL, $per_page = NULL) { /** http://www.flickr.com/services/api/flickr.groups.pools.getGroups.html */ $this->request("flickr.groups.pools.getGroups", array('page'=>$page, 'per_page'=>$per_page)); return $this->parsed_response ? $this->parsed_response['groups'] : false; } - function groups_pools_getPhotos ($group_id, $tags = NULL, $user_id = NULL, $extras = NULL, $per_page = NULL, $page = NULL) + function groups_pools_getPhotos($group_id, $tags = NULL, $user_id = NULL, $extras = NULL, $per_page = NULL, $page = NULL) { /** http://www.flickr.com/services/api/flickr.groups.pools.getPhotos.html */ if (is_array($extras)) { @@ -451,7 +451,7 @@ class phpFlickr { return $this->parsed_response ? $this->parsed_response['photos'] : false; } - function groups_pools_remove ($photo_id, $group_id) + function groups_pools_remove($photo_id, $group_id) { /** http://www.flickr.com/services/api/flickr.groups.pools.remove.html */ $this->request("flickr.groups.pools.remove", array("photo_id"=>$photo_id, "group_id"=>$group_id), TRUE); @@ -471,14 +471,14 @@ class phpFlickr { } /** People methods */ - function people_findByEmail ($find_email) + function people_findByEmail($find_email) { /** http://www.flickr.com/services/api/flickr.people.findByEmail.html */ $this->request("flickr.people.findByEmail", array("find_email"=>$find_email)); return $this->parsed_response ? $this->parsed_response['user'] : false; } - function people_findByUsername ($username) + function people_findByUsername($username) { /** http://www.flickr.com/services/api/flickr.people.findByUsername.html */ $this->request("flickr.people.findByUsername", array("username"=>$username)); @@ -519,7 +519,7 @@ class phpFlickr { /** Photos Methods */ - function photos_addTags ($photo_id, $tags) + function photos_addTags($photo_id, $tags) { /** http://www.flickr.com/services/api/flickr.photos.addTags.html */ $this->request("flickr.photos.addTags", array("photo_id"=>$photo_id, "tags"=>$tags), TRUE); @@ -533,42 +533,42 @@ class phpFlickr { return $this->parsed_response ? true : false; } - function photos_getAllContexts ($photo_id) + function photos_getAllContexts($photo_id) { /** http://www.flickr.com/services/api/flickr.photos.getAllContexts.html */ $this->request("flickr.photos.getAllContexts", array("photo_id"=>$photo_id)); return $this->parsed_response ? $this->parsed_response : false; } - function photos_getContactsPhotos ($count = NULL, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) + function photos_getContactsPhotos($count = NULL, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) { /** http://www.flickr.com/services/api/flickr.photos.getContactsPhotos.html */ $this->request("flickr.photos.getContactsPhotos", array("count"=>$count, "just_friends"=>$just_friends, "single_photo"=>$single_photo, "include_self"=>$include_self, "extras"=>$extras)); return $this->parsed_response ? $this->parsed_response['photos']['photo'] : false; } - function photos_getContactsPublicPhotos ($user_id, $count = NULL, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) + function photos_getContactsPublicPhotos($user_id, $count = NULL, $just_friends = NULL, $single_photo = NULL, $include_self = NULL, $extras = NULL) { /** http://www.flickr.com/services/api/flickr.photos.getContactsPublicPhotos.html */ $this->request("flickr.photos.getContactsPublicPhotos", array("user_id"=>$user_id, "count"=>$count, "just_friends"=>$just_friends, "single_photo"=>$single_photo, "include_self"=>$include_self, "extras"=>$extras)); return $this->parsed_response ? $this->parsed_response['photos']['photo'] : false; } - function photos_getContext ($photo_id) + function photos_getContext($photo_id) { /** http://www.flickr.com/services/api/flickr.photos.getContext.html */ $this->request("flickr.photos.getContext", array("photo_id"=>$photo_id)); return $this->parsed_response ? $this->parsed_response : false; } - function photos_getCounts ($dates = NULL, $taken_dates = NULL) + function photos_getCounts($dates = NULL, $taken_dates = NULL) { /** http://www.flickr.com/services/api/flickr.photos.getCounts.html */ $this->request("flickr.photos.getCounts", array("dates"=>$dates, "taken_dates"=>$taken_dates)); return $this->parsed_response ? $this->parsed_response['photocounts']['photocount'] : false; } - function photos_getExif ($photo_id, $secret = NULL) + function photos_getExif($photo_id, $secret = NULL) { /** http://www.flickr.com/services/api/flickr.photos.getExif.html */ $this->request("flickr.photos.getExif", array("photo_id"=>$photo_id, "secret"=>$secret)); @@ -697,7 +697,7 @@ class phpFlickr { return $this->parsed_response ? $this->parsed_response['photos'] : false; } - function photos_setContentType ($photo_id, $content_type) { + function photos_setContentType($photo_id, $content_type) { /** http://www.flickr.com/services/api/flickr.photos.setContentType.html */ return $this->call('flickr.photos.setContentType', array('photo_id' => $photo_id, 'content_type' => $content_type)); } @@ -723,7 +723,7 @@ class phpFlickr { return $this->parsed_response ? true : false; } - function photos_setSafetyLevel ($photo_id, $safety_level, $hidden = null) { + function photos_setSafetyLevel($photo_id, $safety_level, $hidden = null) { /** http://www.flickr.com/services/api/flickr.photos.setSafetyLevel.html */ return $this->call('flickr.photos.setSafetyLevel', array('photo_id' => $photo_id, 'safety_level' => $safety_level, 'hidden' => $hidden)); } @@ -963,38 +963,38 @@ class phpFlickr { } /** Places Methods */ - function places_resolvePlaceId ($place_id) { + function places_resolvePlaceId($place_id) { /** http://www.flickr.com/services/api/flickr.places.resolvePlaceId.html */ $rsp = $this->call('flickr.places.resolvePlaceId', array('place_id' => $place_id)); return $rsp ? $rsp['location'] : $rsp; } - function places_resolvePlaceURL ($url) { + function places_resolvePlaceURL($url) { /** http://www.flickr.com/services/api/flickr.places.resolvePlaceURL.html */ $rsp = $this->call('flickr.places.resolvePlaceURL', array('url' => $url)); return $rsp ? $rsp['location'] : $rsp; } /** Prefs Methods */ - function prefs_getContentType () { + function prefs_getContentType() { /** http://www.flickr.com/services/api/flickr.prefs.getContentType.html */ $rsp = $this->call('flickr.prefs.getContentType', array()); return $rsp ? $rsp['person'] : $rsp; } - function prefs_getHidden () { + function prefs_getHidden() { /** http://www.flickr.com/services/api/flickr.prefs.getHidden.html */ $rsp = $this->call('flickr.prefs.getHidden', array()); return $rsp ? $rsp['person'] : $rsp; } - function prefs_getPrivacy () { + function prefs_getPrivacy() { /** http://www.flickr.com/services/api/flickr.prefs.getPrivacy.html */ $rsp = $this->call('flickr.prefs.getPrivacy', array()); return $rsp ? $rsp['person'] : $rsp; } - function prefs_getSafetyLevel () { + function prefs_getSafetyLevel() { /** http://www.flickr.com/services/api/flickr.prefs.getSafetyLevel.html */ $rsp = $this->call('flickr.prefs.getSafetyLevel', array()); return $rsp ? $rsp['person'] : $rsp; diff --git a/lib/form/classes/privacy/provider.php b/lib/form/classes/privacy/provider.php index 974be8c6532..e23da5a100d 100644 --- a/lib/form/classes/privacy/provider.php +++ b/lib/form/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_user_preference('filemanager_recentviewmode', 'privacy:metadata:preference:filemanager_recentviewmode'); diff --git a/lib/form/url.php b/lib/form/url.php index 44c8d0fe954..7e1ec9aa0db 100644 --- a/lib/form/url.php +++ b/lib/form/url.php @@ -217,7 +217,7 @@ EOD; * * @return string the unique id of the file picker. */ - protected function get_filepicker_unique_id() : string { + protected function get_filepicker_unique_id(): string { if (empty($this->filepickeruniqueid)) { $this->filepickeruniqueid = uniqid(); } diff --git a/lib/formslib.php b/lib/formslib.php index 1e6b760f16b..92cc76d6c77 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -1963,7 +1963,7 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { * * @param boolean $disable default true, controls if the shortforms are disabled. */ - function setDisableShortforms ($disable = true) { + function setDisableShortforms($disable = true) { $this->_disableShortforms = $disable; } diff --git a/lib/licenselib.php b/lib/licenselib.php index 3296640a10d..3a95f165cf2 100644 --- a/lib/licenselib.php +++ b/lib/licenselib.php @@ -247,7 +247,7 @@ class license_manager { * * @throws \moodle_exception if attempting to use invalid direction value. */ - static public function change_license_sortorder(int $direction, string $licenseshortname) : void { + static public function change_license_sortorder(int $direction, string $licenseshortname): void { if ($direction != self::LICENSE_MOVE_UP && $direction != self::LICENSE_MOVE_DOWN) { throw new coding_exception( diff --git a/lib/mlbackend/php/classes/privacy/provider.php b/lib/mlbackend/php/classes/privacy/provider.php index d32fc8187c4..abf9403fd4e 100644 --- a/lib/mlbackend/php/classes/privacy/provider.php +++ b/lib/mlbackend/php/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/mlbackend/php/classes/processor.php b/lib/mlbackend/php/classes/processor.php index 840236a03d2..d5b3fbf8a19 100644 --- a/lib/mlbackend/php/classes/processor.php +++ b/lib/mlbackend/php/classes/processor.php @@ -463,7 +463,7 @@ class processor implements \core_analytics\classifier, \core_analytics\regressor * @param string $modeldir The directory that contains the trained model. * @return string The path to the directory that contains the exported model. */ - public function export(string $uniqueid, string $modeldir) : string { + public function export(string $uniqueid, string $modeldir): string { $modelfilepath = $this->get_model_filepath($modeldir); @@ -483,7 +483,7 @@ class processor implements \core_analytics\classifier, \core_analytics\regressor * @param string $importdir The directory that contains the files to import. * @return bool Success */ - public function import(string $uniqueid, string $modeldir, string $importdir) : bool { + public function import(string $uniqueid, string $modeldir, string $importdir): bool { $importmodelfilepath = $this->get_model_filepath($importdir); $modelfilepath = $this->get_model_filepath($modeldir); @@ -521,7 +521,7 @@ class processor implements \core_analytics\classifier, \core_analytics\regressor * @param string $modeldir The model directory * @return string The model file */ - protected function get_model_filepath(string $modeldir) : string { + protected function get_model_filepath(string $modeldir): string { // Output directory is already unique to the model. return $modeldir . DIRECTORY_SEPARATOR . self::MODEL_FILENAME; } diff --git a/lib/mlbackend/python/classes/privacy/provider.php b/lib/mlbackend/python/classes/privacy/provider.php index c223bd1db44..c73b8bf6255 100644 --- a/lib/mlbackend/python/classes/privacy/provider.php +++ b/lib/mlbackend/python/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/lib/mlbackend/python/classes/processor.php b/lib/mlbackend/python/classes/processor.php index 12be283e1c0..a56a6a8b545 100644 --- a/lib/mlbackend/python/classes/processor.php +++ b/lib/mlbackend/python/classes/processor.php @@ -374,7 +374,7 @@ class processor implements \core_analytics\classifier, \core_analytics\regresso * @param string $modeldir The directory that contains the trained model. * @return string The path to the directory that contains the exported model. */ - public function export(string $uniqueid, string $modeldir) : string { + public function export(string $uniqueid, string $modeldir): string { $exporttmpdir = make_request_directory(); @@ -419,7 +419,7 @@ class processor implements \core_analytics\classifier, \core_analytics\regresso * @param string $importdir The directory that contains the files to import. * @return bool Success */ - public function import(string $uniqueid, string $modeldir, string $importdir) : bool { + public function import(string $uniqueid, string $modeldir, string $importdir): bool { if (!$this->useserver) { // Use the local file system. diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index ec20e627c2b..ea031e1b0dc 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -5185,7 +5185,7 @@ class progress_bar implements renderable, templatable { * Getter for ID * @return string id */ - public function get_id() : string { + public function get_id(): string { return $this->html_id; } diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 241f424e1dd..5d6bd7a9a61 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -5190,7 +5190,7 @@ EOD; * @param string $estimate time remaining message * @return string ascii fragment */ - public function render_progress_bar_update(string $id, float $percent, string $msg, string $estimate) : string { + public function render_progress_bar_update(string $id, float $percent, string $msg, string $estimate): string { return html_writer::script(js_writer::function_call('updateProgressBar', [ $id, round($percent, 1), @@ -5474,7 +5474,7 @@ class core_renderer_cli extends core_renderer { * @param string $estimate time remaining message * @return string ascii fragment */ - public function render_progress_bar_update(string $id, float $percent, string $msg, string $estimate) : string { + public function render_progress_bar_update(string $id, float $percent, string $msg, string $estimate): string { $size = 55; // The width of the progress bar in chars. $ascii = ''; diff --git a/lib/pagelib.php b/lib/pagelib.php index 3fba00ac248..f1654a2dc61 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -2360,7 +2360,7 @@ class moodle_page { * * @param string $html The HTML to add. */ - public function add_header_action(string $html) : void { + public function add_header_action(string $html): void { $this->_headeractions[] = $html; } @@ -2369,7 +2369,7 @@ class moodle_page { * * @return string[] */ - public function get_header_actions() : array { + public function get_header_actions(): array { return $this->_headeractions; } @@ -2379,7 +2379,7 @@ class moodle_page { * * @param bool $value If the settings should be in the header. */ - public function set_include_region_main_settings_in_header_actions(bool $value) : void { + public function set_include_region_main_settings_in_header_actions(bool $value): void { $this->_regionmainsettingsinheader = $value; } @@ -2389,7 +2389,7 @@ class moodle_page { * * @return bool */ - public function include_region_main_settings_in_header_actions() : bool { + public function include_region_main_settings_in_header_actions(): bool { return $this->_regionmainsettingsinheader; } @@ -2428,7 +2428,7 @@ class moodle_page { * * @param string $navkey the key of the secondary nav node to be activated. */ - public function set_secondary_active_tab(string $navkey) : void { + public function set_secondary_active_tab(string $navkey): void { $this->_activekeysecondary = $navkey; } diff --git a/lib/phpunit/classes/coverage_info.php b/lib/phpunit/classes/coverage_info.php index 05efbd851ff..6e0088ad0b7 100644 --- a/lib/phpunit/classes/coverage_info.php +++ b/lib/phpunit/classes/coverage_info.php @@ -42,7 +42,7 @@ class phpunit_coverage_info { * @param string $plugindir The root of the plugin, relative to the dataroot. * @return array */ - final public function get_includelists(string $plugindir) : array { + final public function get_includelists(string $plugindir): array { $coverages = []; $includelistfolders = array_merge([ @@ -79,7 +79,7 @@ class phpunit_coverage_info { * @param string $plugindir The root of the plugin, relative to the dataroot. * @return array */ - final public function get_excludelists(string $plugindir) : array { + final public function get_excludelists(string $plugindir): array { $coverages = []; if (!empty($plugindir)) { diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index 9cf39639303..f12010d4769 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -984,7 +984,7 @@ class phpunit_util extends testing_util { * @param int $level The number of levels of indentation to pad * @return string */ - protected static function pad(string $string, int $level) : string { + protected static function pad(string $string, int $level): string { return str_repeat(" ", $level * 2) . "{$string}\n"; } @@ -995,7 +995,7 @@ class phpunit_util extends testing_util { * @param string[] $excludelists The list of files/folders in the excludelist. * @return string */ - protected static function get_coverage_config(array $includelists, array $excludelists) : string { + protected static function get_coverage_config(array $includelists, array $excludelists): string { $coverages = ''; if (!empty($includelists)) { $coverages .= self::pad("", 2); diff --git a/lib/questionlib.php b/lib/questionlib.php index b292ee06392..b867ea2dc4c 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -2079,7 +2079,7 @@ function get_next_version(int $questionbankentryid): int { * @param string $questionbankentryid Entry to check against. * @return bool */ -function is_latest(string $version, string $questionbankentryid) : bool { +function is_latest(string $version, string $questionbankentryid): bool { global $DB; $sql = 'SELECT MAX(version) AS max diff --git a/lib/testing/generator/data_generator.php b/lib/testing/generator/data_generator.php index 25e8dae53b0..bf96347df46 100644 --- a/lib/testing/generator/data_generator.php +++ b/lib/testing/generator/data_generator.php @@ -1326,7 +1326,7 @@ EOD; * @param array $data Array with data['name'] of category * @return \core_customfield\category_controller The created category */ - public function create_custom_field_category($data) : \core_customfield\category_controller { + public function create_custom_field_category($data): \core_customfield\category_controller { return $this->get_plugin_generator('core_customfield')->create_category($data); } @@ -1336,7 +1336,7 @@ EOD; * @param array $data Array with 'name', 'shortname' and 'type' of the field * @return \core_customfield\field_controller The created field */ - public function create_custom_field($data) : \core_customfield\field_controller { + public function create_custom_field($data): \core_customfield\field_controller { global $DB; if (empty($data['categoryid']) && !empty($data['category'])) { $data['categoryid'] = $DB->get_field('customfield_category', 'id', ['name' => $data['category']]); diff --git a/lib/tests/behat/behat_hooks.php b/lib/tests/behat/behat_hooks.php index 38822d79d10..56bef49cca4 100644 --- a/lib/tests/behat/behat_hooks.php +++ b/lib/tests/behat/behat_hooks.php @@ -546,7 +546,7 @@ EOF; * * @return array Array where key is tag name and value is an integer */ - public static function get_tags_for_scenario() : array { + public static function get_tags_for_scenario(): array { return self::$scenariotags; } diff --git a/lib/tests/external/check/get_result_admintree_test.php b/lib/tests/external/check/get_result_admintree_test.php index 69c57175f76..5814e6c4a24 100644 --- a/lib/tests/external/check/get_result_admintree_test.php +++ b/lib/tests/external/check/get_result_admintree_test.php @@ -73,7 +73,7 @@ class get_result_admintree_test extends externallib_advanced_testcase { * * @return array */ - public static function execute_options_provider() : array { + public static function execute_options_provider(): array { return [ 'get check result (ok, no details)' => [ 'triggererror' => false, diff --git a/lib/tests/moodle_url_test.php b/lib/tests/moodle_url_test.php index eb33e6ba76a..786736a4ed3 100644 --- a/lib/tests/moodle_url_test.php +++ b/lib/tests/moodle_url_test.php @@ -272,7 +272,7 @@ class moodle_url_test extends \advanced_testcase { * @param string $url URL with params to test. * @param array $expected The expected result. */ - public function test_moodle_url_export_params_for_template(string $url, array $expected) :void { + public function test_moodle_url_export_params_for_template(string $url, array $expected): void { // Should return params in the URL. $moodleurl = new \moodle_url($url); $this->assertSame($expected, $moodleurl->export_params_for_template()); @@ -283,7 +283,7 @@ class moodle_url_test extends \advanced_testcase { * * @return array[] the array of test data. */ - public function moodle_url_export_params_for_template_provider() :array { + public function moodle_url_export_params_for_template_provider(): array { $baseurl = "http://example.com"; return [ 'With indexed array params' => [ diff --git a/lib/tests/output/mustache_template_source_loader_test.php b/lib/tests/output/mustache_template_source_loader_test.php index a3fabdd007d..2716a2d1bf8 100644 --- a/lib/tests/output/mustache_template_source_loader_test.php +++ b/lib/tests/output/mustache_template_source_loader_test.php @@ -510,7 +510,7 @@ TEMPLATE; * @param array $cache A cache of templates * @return mustache_template_source_loader */ - private function build_loader_from_static_cache(array $cache) : mustache_template_source_loader { + private function build_loader_from_static_cache(array $cache): mustache_template_source_loader { return new mustache_template_source_loader(function($component, $name, $themename) use ($cache) { return $cache[$component][$name]; }); diff --git a/lib/tests/persistent_test.php b/lib/tests/persistent_test.php index 78f5b52a4b9..c08b3691ed0 100644 --- a/lib/tests/persistent_test.php +++ b/lib/tests/persistent_test.php @@ -183,7 +183,7 @@ class persistent_test extends advanced_testcase { /** * Test creating persistent instance by specifying record ID in constructor */ - public function test_constructor() : void { + public function test_constructor(): void { $persistent = (new core_testable_persistent(0, (object) [ 'idnumber' => '123', 'sortorder' => 1, diff --git a/lib/tests/report_helper_test.php b/lib/tests/report_helper_test.php index 3dc9798d252..f6cab8c7655 100644 --- a/lib/tests/report_helper_test.php +++ b/lib/tests/report_helper_test.php @@ -37,7 +37,7 @@ class report_helper_test extends \advanced_testcase { * * @return array */ - public function data_selected_report():array { + public function data_selected_report(): array { return [ ['course_url_id' => [ ['url' => '/test', 'id' => 1], @@ -56,7 +56,7 @@ class report_helper_test extends \advanced_testcase { * @dataProvider data_selected_report * @param array $courseurlid The array has both course url and course id */ - public function test_save_selected_report(array $courseurlid):void { + public function test_save_selected_report(array $courseurlid): void { global $USER; $url1 = new moodle_url($courseurlid[0]['url']); diff --git a/lib/tests/session_manager_test.php b/lib/tests/session_manager_test.php index 9cd4df4173c..ad84b7f18cc 100644 --- a/lib/tests/session_manager_test.php +++ b/lib/tests/session_manager_test.php @@ -792,7 +792,7 @@ class session_manager_test extends \advanced_testcase { * * @return array */ - public function sessionlocks_info_provider() : array { + public function sessionlocks_info_provider(): array { return [ [ 'url' => null, diff --git a/lib/tests/task/database_logger_test.php b/lib/tests/task/database_logger_test.php index 3ea897eb7fd..661718f056a 100644 --- a/lib/tests/task/database_logger_test.php +++ b/lib/tests/task/database_logger_test.php @@ -236,7 +236,7 @@ class database_logger_test extends \advanced_testcase { * * @return array */ - public function delete_task_logs_provider() : array { + public function delete_task_logs_provider(): array { return [ [ [0], diff --git a/lib/tests/task/logging_test.php b/lib/tests/task/logging_test.php index e7ab3dba398..9a7b056a765 100644 --- a/lib/tests/task/logging_test.php +++ b/lib/tests/task/logging_test.php @@ -442,7 +442,7 @@ class logging_test extends \advanced_testcase { * * @return adhoc_task */ - protected function get_test_adhoc_task() : adhoc_task { + protected function get_test_adhoc_task(): adhoc_task { $task = $this->getMockForAbstractClass(adhoc_task::class); $task->set_component('core'); @@ -460,7 +460,7 @@ class logging_test extends \advanced_testcase { * * @return scheduled_task */ - protected function get_test_scheduled_task() : scheduled_task { + protected function get_test_scheduled_task(): scheduled_task { $task = $this->getMockForAbstractClass(scheduled_task::class); // Mock a lock on the task. @@ -544,7 +544,7 @@ class logging_test_mocked_logger implements task_logger { * * @return bool */ - public static function is_configured() : bool { + public static function is_configured(): bool { return self::$isconfigured; } @@ -569,7 +569,7 @@ class logging_test_mocked_logger implements task_logger { * * @return bool */ - public static function has_log_report() : bool { + public static function has_log_report(): bool { return self::$haslogreport; } @@ -579,7 +579,7 @@ class logging_test_mocked_logger implements task_logger { * @param string $classname The task class to fetch for * @return \moodle_url */ - public static function get_url_for_task_class(string $classname) : \moodle_url { + public static function get_url_for_task_class(string $classname): \moodle_url { return new \moodle_url(''); } diff --git a/lib/userkey/classes/privacy/provider.php b/lib/userkey/classes/privacy/provider.php index 72bd9e95809..f8ab5ddfcb9 100644 --- a/lib/userkey/classes/privacy/provider.php +++ b/lib/userkey/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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('user_private_key', [ 'script' => 'privacy:metadata:user_private_key:script', 'value' => 'privacy:metadata:user_private_key:value', diff --git a/lib/weblib.php b/lib/weblib.php index 5144ab60606..0cac8cf5e83 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -904,7 +904,7 @@ class moodle_url { * * @return bool True if URL is relative to $CFG->wwwroot; otherwise, false. */ - public function is_local_url() : bool { + public function is_local_url(): bool { global $CFG; $url = $this->out(); diff --git a/lib/wiki_to_markdown.php b/lib/wiki_to_markdown.php index 6a0cecdb613..57819b0d6f7 100644 --- a/lib/wiki_to_markdown.php +++ b/lib/wiki_to_markdown.php @@ -58,7 +58,7 @@ class WikiToMarkdown { var $output; // output buffer var $courseid; - function close_block( $state ) { + function close_block($state ) { // provide appropriate closure for block according to state // if in list close this first @@ -86,7 +86,7 @@ class WikiToMarkdown { return $lclose . $sclose; } - function do_replace( $line, $mark, $tag ) { + function do_replace($line, $mark, $tag ) { // do the regex thingy for things like bold, italic etc // $mark is the magic character, and $tag the HTML tag to insert @@ -106,7 +106,7 @@ class WikiToMarkdown { } - function do_replace_markdown( $line, $mark, $tag ) { + function do_replace_markdown($line, $mark, $tag ) { // do the regex thingy for things like bold, italic etc // $mark is the magic character, and $tag the HTML tag to insert // MARKDOWN version does not generate HTML tags, just straigt replace @@ -127,7 +127,7 @@ class WikiToMarkdown { } - function do_replace_sub( $line, $mark, $tag ) { + function do_replace_sub($line, $mark, $tag ) { // do regex for subscript and superscript (slightly different) // $mark is the magic character and $tag the HTML tag to insert @@ -137,7 +137,7 @@ class WikiToMarkdown { return preg_replace( $regex, $replace, $line ); } - function do_list( $line, $blank=false ) { + function do_list($line, $blank=false ) { // handle line with list character on it // if blank line implies drop to level 0 @@ -222,7 +222,7 @@ class WikiToMarkdown { } - function line_replace( $line ) { + function line_replace($line ) { // return line after various formatting replacements // have been made - order is vital to stop them interfering with each other @@ -311,7 +311,7 @@ class WikiToMarkdown { return $line; } - function convert( $content,$courseid ) { + function convert($content,$courseid ) { // main entry point for processing Wiki-like text // $content is string containing text with Wiki-Like formatting diff --git a/lib/xapi/classes/privacy/provider.php b/lib/xapi/classes/privacy/provider.php index cfdb2a57d1a..c4226e0361c 100644 --- a/lib/xapi/classes/privacy/provider.php +++ b/lib/xapi/classes/privacy/provider.php @@ -39,7 +39,7 @@ class provider implements * @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('xapi_states', [ 'component' => 'privacy:metadata:component', 'userid' => 'privacy:metadata:userid', diff --git a/lib/xapi/tests/external/delete_state_test.php b/lib/xapi/tests/external/delete_state_test.php index 04411b7111d..a99cfcd317f 100644 --- a/lib/xapi/tests/external/delete_state_test.php +++ b/lib/xapi/tests/external/delete_state_test.php @@ -73,7 +73,7 @@ class delete_state_test extends externallib_advanced_testcase { * * @return array */ - public function components_provider() : array { + public function components_provider(): array { return [ 'Inexistent component' => [ 'component' => 'inexistent_component', @@ -150,7 +150,7 @@ class delete_state_test extends externallib_advanced_testcase { * * @return array */ - public function states_provider() : array { + public function states_provider(): array { return [ 'Existing and valid state' => [ 'info' => [], diff --git a/lib/xapi/tests/external/get_state_test.php b/lib/xapi/tests/external/get_state_test.php index 56f9e23891c..f29e15dbbbe 100644 --- a/lib/xapi/tests/external/get_state_test.php +++ b/lib/xapi/tests/external/get_state_test.php @@ -74,7 +74,7 @@ class get_state_test extends externallib_advanced_testcase { * * @return array */ - public function components_provider() : array { + public function components_provider(): array { return [ 'Inexistent component' => [ 'component' => 'inexistent_component', @@ -150,7 +150,7 @@ class get_state_test extends externallib_advanced_testcase { * * @return array */ - public function states_provider() : array { + public function states_provider(): array { return [ 'Existing and valid state' => [ 'info' => [], diff --git a/lib/xapi/tests/external/get_states_test.php b/lib/xapi/tests/external/get_states_test.php index a260dabf774..a98bfeb0ab9 100644 --- a/lib/xapi/tests/external/get_states_test.php +++ b/lib/xapi/tests/external/get_states_test.php @@ -145,7 +145,7 @@ class get_states_test extends externallib_advanced_testcase { * * @return array */ - public function components_provider() : array { + public function components_provider(): array { return [ 'Inexistent component' => [ 'component' => 'inexistent_component', diff --git a/lib/xapi/tests/external/post_state_test.php b/lib/xapi/tests/external/post_state_test.php index f8878c16e51..208a7ccc0b3 100644 --- a/lib/xapi/tests/external/post_state_test.php +++ b/lib/xapi/tests/external/post_state_test.php @@ -72,7 +72,7 @@ class post_state_test extends externallib_advanced_testcase { * * @return array */ - public function components_provider() : array { + public function components_provider(): array { return [ 'Inexistent component' => [ 'component' => 'inexistent_component', @@ -135,7 +135,7 @@ class post_state_test extends externallib_advanced_testcase { * * @return array */ - public function states_provider() : array { + public function states_provider(): array { return [ 'Empty stateid' => [ 'stateid' => '', diff --git a/lib/xapi/tests/external/post_statement_test.php b/lib/xapi/tests/external/post_statement_test.php index 1502b6ee098..a8642b90fa6 100644 --- a/lib/xapi/tests/external/post_statement_test.php +++ b/lib/xapi/tests/external/post_statement_test.php @@ -187,7 +187,7 @@ class post_statement_test extends externallib_advanced_testcase { * * @return array */ - public function components_provider() : array { + public function components_provider(): array { return [ 'Inexistent component' => [ 'inexistent_component', [] @@ -233,7 +233,7 @@ class post_statement_test extends externallib_advanced_testcase { * * @return array */ - public function invalid_json_provider() : array { + public function invalid_json_provider(): array { return [ 'Wrong json' => [ 'This is not { a json object /' @@ -376,7 +376,7 @@ class post_statement_test extends externallib_advanced_testcase { * * @return array */ - public function statement_provider() : array { + public function statement_provider(): array { return [ // Single statement with group statements enabled. 'Single, Valid actor, valid verb' => [ @@ -449,7 +449,7 @@ class post_statement_test extends externallib_advanced_testcase { * * @return array */ - public function group_statement_provider() : array { + public function group_statement_provider(): array { return [ // Single statement with group statements enabled. 'Group statement + group statement without group support' => [ diff --git a/lib/xapi/tests/iri_test.php b/lib/xapi/tests/iri_test.php index c90a0d1ba9d..bff38dd7858 100644 --- a/lib/xapi/tests/iri_test.php +++ b/lib/xapi/tests/iri_test.php @@ -76,7 +76,7 @@ class iri_test extends advanced_testcase { * * @return array */ - public function iri_samples_provider() : array { + public function iri_samples_provider(): array { global $CFG; return [ @@ -120,7 +120,7 @@ class iri_test extends advanced_testcase { * * @return array */ - public function iri_check_provider() : array { + public function iri_check_provider(): array { return [ 'Real IRI http' => [ 'http://adlnet.gov/expapi/activities/example', diff --git a/lib/xapi/tests/local/statement/item_activity_test.php b/lib/xapi/tests/local/statement/item_activity_test.php index e1b7b7aed5c..6b05c63b0a2 100644 --- a/lib/xapi/tests/local/statement/item_activity_test.php +++ b/lib/xapi/tests/local/statement/item_activity_test.php @@ -113,7 +113,7 @@ class item_activity_test extends advanced_testcase { * * @return array */ - public function create_from_id_provider() : array { + public function create_from_id_provider(): array { return [ 'Fake IRI with no definition' => [ 'paella', false, @@ -155,7 +155,7 @@ class item_activity_test extends advanced_testcase { * * @return array */ - public function invalid_data_provider() : array { + public function invalid_data_provider(): array { return [ 'Invalid Avtivity objectType' => [ 'Invalid Type!', iri::generate('paella', 'activity'), diff --git a/lib/xapi/tests/local/statement/item_agent_test.php b/lib/xapi/tests/local/statement/item_agent_test.php index 53aed334015..b5e8a6e65c9 100644 --- a/lib/xapi/tests/local/statement/item_agent_test.php +++ b/lib/xapi/tests/local/statement/item_agent_test.php @@ -143,7 +143,7 @@ class item_agent_test extends advanced_testcase { * * @return array */ - public function invalid_data_provider() : array { + public function invalid_data_provider(): array { return [ 'Wrong objecttype' => [ 'Invalid', true, true @@ -203,7 +203,7 @@ class item_agent_test extends advanced_testcase { * * @return array */ - public function unspupported_create_provider() : array { + public function unspupported_create_provider(): array { return [ 'Both mbox and account' => [ true, true, false, false diff --git a/lib/xapi/tests/local/statement/item_attachment_test.php b/lib/xapi/tests/local/statement/item_attachment_test.php index ee1c51f8cb9..11a0bfcaafa 100644 --- a/lib/xapi/tests/local/statement/item_attachment_test.php +++ b/lib/xapi/tests/local/statement/item_attachment_test.php @@ -94,7 +94,7 @@ class item_attachment_test extends advanced_testcase { * * @return array */ - public function invalid_values_data() : array { + public function invalid_values_data(): array { return [ 'No usageType attachment' => [ 'usageType', null diff --git a/lib/xapi/tests/local/statement/item_definition_test.php b/lib/xapi/tests/local/statement/item_definition_test.php index 92ea49b1df7..65185bc243f 100644 --- a/lib/xapi/tests/local/statement/item_definition_test.php +++ b/lib/xapi/tests/local/statement/item_definition_test.php @@ -72,7 +72,7 @@ class item_definition_test extends advanced_testcase { * * @return array */ - public function creation_provider() : array { + public function creation_provider(): array { return [ 'No interactionType' => [''], 'Choice' => ['choice'], diff --git a/lib/xapi/tests/local/statement/item_group_test.php b/lib/xapi/tests/local/statement/item_group_test.php index e55509009d0..ec9920905a2 100644 --- a/lib/xapi/tests/local/statement/item_group_test.php +++ b/lib/xapi/tests/local/statement/item_group_test.php @@ -143,7 +143,7 @@ class item_group_test extends advanced_testcase { * * @return array */ - public function invalid_data_provider() : array { + public function invalid_data_provider(): array { return [ 'Wrong objecttype' => [ 'Invalid', true, true diff --git a/lib/xapi/tests/local/statement/item_object_test.php b/lib/xapi/tests/local/statement/item_object_test.php index 2081c884b78..4abd2bf68fb 100644 --- a/lib/xapi/tests/local/statement/item_object_test.php +++ b/lib/xapi/tests/local/statement/item_object_test.php @@ -117,7 +117,7 @@ class item_object_test extends advanced_testcase { * * @return array */ - public function invalid_data_provider() : array { + public function invalid_data_provider(): array { return [ 'Empty or null id' => [ '', diff --git a/lib/xapi/tests/local/statement/item_result_test.php b/lib/xapi/tests/local/statement/item_result_test.php index b6c25b8ae7f..49d29545ddd 100644 --- a/lib/xapi/tests/local/statement/item_result_test.php +++ b/lib/xapi/tests/local/statement/item_result_test.php @@ -98,7 +98,7 @@ class item_result_test extends advanced_testcase { * * @return array */ - public function duration_values_data() : array { + public function duration_values_data(): array { return [ 'No duration' => [ null, null, false diff --git a/lib/xapi/tests/local/statement/item_verb_test.php b/lib/xapi/tests/local/statement/item_verb_test.php index deaecfecfe0..c57e30678e4 100644 --- a/lib/xapi/tests/local/statement/item_verb_test.php +++ b/lib/xapi/tests/local/statement/item_verb_test.php @@ -75,7 +75,7 @@ class item_verb_test extends advanced_testcase { * * @return array */ - public function create_from_id_provider() : array { + public function create_from_id_provider(): array { return [ 'Fake IRI' => [ 'cook', @@ -105,7 +105,7 @@ class item_verb_test extends advanced_testcase { * * @return array */ - public function invalid_data_provider() : array { + public function invalid_data_provider(): array { return [ 'Empty or null id' => [ '', diff --git a/lib/xapi/tests/local/statement_test.php b/lib/xapi/tests/local/statement_test.php index d1b5e47d226..c9ff7be7aef 100644 --- a/lib/xapi/tests/local/statement_test.php +++ b/lib/xapi/tests/local/statement_test.php @@ -184,7 +184,7 @@ class statement_test extends advanced_testcase { * * @return array */ - public function create_provider() : array { + public function create_provider(): array { return [ 'Agent statement with no extras' => [ true, [], [] @@ -413,7 +413,7 @@ class statement_test extends advanced_testcase { * * @return array */ - public function invalid_gets_provider() : array { + public function invalid_gets_provider(): array { return [ 'Method get_user on empty statement' => ['get_user', true], 'Method get_all_users on empty statement' => ['get_all_users', true], @@ -532,7 +532,7 @@ class statement_test extends advanced_testcase { * * @return array */ - public function invalid_data_provider() : array { + public function invalid_data_provider(): array { return [ 'No actor, no verb, no object' => [false, false, false], 'No actor, verb, no object' => [false, true, false], diff --git a/lib/xapi/tests/state_store_test.php b/lib/xapi/tests/state_store_test.php index 817e5af7de5..fd50f29077f 100644 --- a/lib/xapi/tests/state_store_test.php +++ b/lib/xapi/tests/state_store_test.php @@ -113,7 +113,7 @@ class state_store_test extends advanced_testcase { * * @return array */ - public function states_provider() : array { + public function states_provider(): array { return [ 'Existing and valid state' => [ 'info' => [], @@ -193,7 +193,7 @@ class state_store_test extends advanced_testcase { * * @return array */ - public function put_states_provider() : array { + public function put_states_provider(): array { return [ 'Update existing state' => [ 'info' => [], @@ -334,7 +334,7 @@ class state_store_test extends advanced_testcase { * * @return array */ - public function reset_wipe_states_provider() : array { + public function reset_wipe_states_provider(): array { return [ 'With fake_component' => [ 'info' => [], diff --git a/lib/xmldb/xmldb_file.php b/lib/xmldb/xmldb_file.php index 67acce05381..b52cbb5a960 100644 --- a/lib/xmldb/xmldb_file.php +++ b/lib/xmldb/xmldb_file.php @@ -167,7 +167,7 @@ class xmldb_file extends xmldb_object { * @param array $xmlarr * @return xmldb_structure */ - public function arr2xmldb_structure ($xmlarr) { + public function arr2xmldb_structure($xmlarr) { $structure = new xmldb_structure($this->path); $structure->arr2xmldb_structure($xmlarr); return $structure; diff --git a/lib/xmldb/xmldb_object.php b/lib/xmldb/xmldb_object.php index 9a69bd8a365..09a311af080 100644 --- a/lib/xmldb/xmldb_object.php +++ b/lib/xmldb/xmldb_object.php @@ -192,7 +192,7 @@ class xmldb_object { * only lowercase a-z, 0-9 and _ are allowed * @return bool */ - public function checkName () { + public function checkName() { $result = true; if ($this->name != preg_replace('/[^a-z0-9_ -]/i', '', $this->name)) { diff --git a/media/classes/privacy/provider.php b/media/classes/privacy/provider.php index 9b77205a0d8..33cc356b4d2 100644 --- a/media/classes/privacy/provider.php +++ b/media/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/media/player/html5audio/classes/privacy/provider.php b/media/player/html5audio/classes/privacy/provider.php index 0efbb798f59..4ab8b83f7d2 100644 --- a/media/player/html5audio/classes/privacy/provider.php +++ b/media/player/html5audio/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/media/player/html5video/classes/privacy/provider.php b/media/player/html5video/classes/privacy/provider.php index 8988579feba..3817d58bc3f 100644 --- a/media/player/html5video/classes/privacy/provider.php +++ b/media/player/html5video/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/media/player/videojs/classes/privacy/provider.php b/media/player/videojs/classes/privacy/provider.php index 6b429183656..aec106430a7 100644 --- a/media/player/videojs/classes/privacy/provider.php +++ b/media/player/videojs/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/media/player/vimeo/classes/privacy/provider.php b/media/player/vimeo/classes/privacy/provider.php index 6c4be033050..6975d606be0 100644 --- a/media/player/vimeo/classes/privacy/provider.php +++ b/media/player/vimeo/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/media/player/youtube/classes/privacy/provider.php b/media/player/youtube/classes/privacy/provider.php index 3222c3945c2..fff3c9002c4 100644 --- a/media/player/youtube/classes/privacy/provider.php +++ b/media/player/youtube/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/message/classes/api.php b/message/classes/api.php index 15c0aed9c64..5ba3e7a1ee1 100644 --- a/message/classes/api.php +++ b/message/classes/api.php @@ -206,7 +206,7 @@ class api { * @param int $limitnum * @return array */ - public static function message_search_users(int $userid, string $search, int $limitfrom = 0, int $limitnum = 20) : array { + public static function message_search_users(int $userid, string $search, int $limitfrom = 0, int $limitnum = 20): array { global $CFG, $DB; // Check if messaging is enabled. @@ -395,7 +395,7 @@ class api { * @throws \coding_exception * @throws \dml_exception */ - protected static function get_linked_conversation_extra_fields(array $conversations) : array { + protected static function get_linked_conversation_extra_fields(array $conversations): array { global $DB, $PAGE; $renderer = $PAGE->get_renderer('core'); @@ -801,7 +801,7 @@ class api { * @throws \dml_exception */ public static function get_conversations_between_users(int $userid1, int $userid2, - int $limitfrom = 0, int $limitnum = 20) : array { + int $limitfrom = 0, int $limitnum = 20): array { global $DB; @@ -968,7 +968,7 @@ class api { * @return favourite the favourite object. * @throws \moodle_exception if the user or conversation don't exist. */ - public static function set_favourite_conversation(int $conversationid, int $userid) : favourite { + public static function set_favourite_conversation(int $conversationid, int $userid): favourite { global $DB; if (!self::is_user_in_conversation($userid, $conversationid)) { @@ -1062,7 +1062,7 @@ class api { * @param int $userid The user id * @return array */ - public static function count_contacts(int $userid) : int { + public static function count_contacts(int $userid): int { global $DB; $sql = "SELECT COUNT(id) @@ -1105,7 +1105,7 @@ class api { * @return array of messages */ public static function get_conversation_messages(int $userid, int $convid, int $limitfrom = 0, int $limitnum = 0, - string $sort = 'timecreated ASC', int $timefrom = 0, int $timeto = 0) : array { + string $sort = 'timecreated ASC', int $timefrom = 0, int $timeto = 0): array { if (!empty($timefrom)) { // Check the cache to see if we even need to do a DB query. @@ -1168,7 +1168,7 @@ class api { * @param int $conversationid The id of the conversation * @return bool Returns true if a user can delete the conversation, false otherwise. */ - public static function can_delete_conversation(int $userid, int $conversationid = null) : bool { + public static function can_delete_conversation(int $userid, int $conversationid = null): bool { global $USER; if (is_null($conversationid)) { @@ -1280,7 +1280,7 @@ class api { * @return bool true if user is permitted, false otherwise * @since 3.6 */ - public static function can_mark_all_messages_as_read(int $userid, int $conversationid) : bool { + public static function can_mark_all_messages_as_read(int $userid, int $conversationid): bool { global $USER; $systemcontext = \context_system::instance(); @@ -1307,7 +1307,7 @@ class api { * @param int $userid The user whose conversations should be counted. * @return array the array of conversations counts, indexed by type. */ - public static function get_conversation_counts(int $userid) : array { + public static function get_conversation_counts(int $userid): array { global $DB; self::lazy_create_self_conversation($userid); @@ -1550,7 +1550,7 @@ class api { * the user is still able to send a message. * @return bool true if user is permitted, false otherwise. */ - public static function can_send_message(int $recipientid, int $senderid, bool $evenifblocked = false) : bool { + public static function can_send_message(int $recipientid, int $senderid, bool $evenifblocked = false): bool { $systemcontext = \context_system::instance(); if (!has_capability('moodle/site:sendmessage', $systemcontext, $senderid)) { @@ -1574,7 +1574,7 @@ class api { * @return bool true if the user can send a message to the conversation, false otherwise. * @throws \moodle_exception */ - public static function can_send_message_to_conversation(int $userid, int $conversationid) : bool { + public static function can_send_message_to_conversation(int $userid, int $conversationid): bool { global $DB; $systemcontext = \context_system::instance(); @@ -1621,7 +1621,7 @@ class api { * @throws \moodle_exception if the user is not permitted to send a message to the conversation. */ public static function send_message_to_conversation(int $userid, int $conversationid, string $message, - int $format) : \stdClass { + int $format): \stdClass { global $DB, $PAGE; if (!self::can_send_message_to_conversation($userid, $conversationid)) { @@ -1712,7 +1712,7 @@ class api { * @param int $userid The user identifier. * @return int The default messaging preference. */ - public static function get_user_privacy_messaging_preference(int $userid) : int { + public static function get_user_privacy_messaging_preference(int $userid): int { global $CFG, $USER; // When $CFG->messagingallusers is enabled, default value for the messaging preference will be "Anyone on the site"; @@ -2165,7 +2165,7 @@ class api { * @param \context $context The context they are creating the conversation from, most likely course context * @return bool */ - public static function can_create_group_conversation(int $userid, \context $context) : bool { + public static function can_create_group_conversation(int $userid, \context $context): bool { global $CFG; // If we can't message at all, then we can't create a conversation. @@ -2184,7 +2184,7 @@ class api { * @param int $requesteduserid The id of the user being requested * @return bool */ - public static function can_create_contact(int $userid, int $requesteduserid) : bool { + public static function can_create_contact(int $userid, int $requesteduserid): bool { global $CFG; // If we can't message at all, then we can't create a contact. @@ -2208,7 +2208,7 @@ class api { * @param int $requesteduserid The id of the user being requested * @return \stdClass the request */ - public static function create_contact_request(int $userid, int $requesteduserid) : \stdClass { + public static function create_contact_request(int $userid, int $requesteduserid): \stdClass { global $DB, $PAGE, $SITE; $request = new \stdClass(); @@ -2309,7 +2309,7 @@ class api { * @param int $limitnum * @return array The list of contact requests */ - public static function get_contact_requests(int $userid, int $limitfrom = 0, int $limitnum = 0) : array { + public static function get_contact_requests(int $userid, int $limitfrom = 0, int $limitnum = 0): array { global $DB; $sql = "SELECT mcr.userid @@ -2333,7 +2333,7 @@ class api { * @param int $userid The ID of the user we want to return the number of received contact requests for * @return int The count */ - public static function get_received_contact_requests_count(int $userid) : int { + public static function get_received_contact_requests_count(int $userid): int { global $DB; $sql = "SELECT COUNT(mcr.id) FROM {message_contact_requests} mcr @@ -2452,7 +2452,7 @@ class api { * @param int $contactid The id of the other user * @return bool Returns true if they are a contact, false otherwise */ - public static function is_contact(int $userid, int $contactid) : bool { + public static function is_contact(int $userid, int $contactid): bool { global $DB; $sql = "SELECT id @@ -2486,7 +2486,7 @@ class api { * @param int $blockeduserid * @return bool Returns true if they are a blocked, false otherwise */ - public static function is_blocked(int $userid, int $blockeduserid) : bool { + public static function is_blocked(int $userid, int $blockeduserid): bool { global $DB; return $DB->record_exists('message_users_blocked', ['userid' => $userid, 'blockeduserid' => $blockeduserid]); @@ -2499,7 +2499,7 @@ class api { * @param int $requesteduserid The id of the user being requested * @return \stdClass[] */ - public static function get_contact_requests_between_users(int $userid, int $requesteduserid) : array { + public static function get_contact_requests_between_users(int $userid, int $requesteduserid): array { global $DB; $sql = "SELECT * @@ -2516,7 +2516,7 @@ class api { * @param int $requesteduserid The id of the user being requested * @return bool Returns true if a contact request exists, false otherwise */ - public static function does_contact_request_exist(int $userid, int $requesteduserid) : bool { + public static function does_contact_request_exist(int $userid, int $requesteduserid): bool { global $DB; $sql = "SELECT id @@ -2533,7 +2533,7 @@ class api { * @param int $conversationid The id of the conversation * @return bool Returns true if a contact request exists, false otherwise */ - public static function is_user_in_conversation(int $userid, int $conversationid) : bool { + public static function is_user_in_conversation(int $userid, int $conversationid): bool { global $DB; return $DB->record_exists('message_conversation_members', ['conversationid' => $conversationid, @@ -2549,7 +2549,7 @@ class api { * the user is still able to send a message. * @return bool true if recipient hasn't blocked sender and sender can contact to recipient, false otherwise. */ - protected static function can_contact_user(int $recipientid, int $senderid, bool $evenifblocked = false) : bool { + protected static function can_contact_user(int $recipientid, int $senderid, bool $evenifblocked = false): bool { if (has_capability('moodle/site:messageanyuser', \context_system::instance(), $senderid) || $recipientid == $senderid) { // The sender has the ability to contact any user across the entire site or themselves. @@ -2687,7 +2687,7 @@ class api { * @return int Number of conversation members. * @throws \dml_exception */ - public static function count_conversation_members(int $convid) : int { + public static function count_conversation_members(int $convid): int { global $DB; return $DB->count_records('message_conversation_members', ['conversationid' => $convid]); @@ -2702,7 +2702,7 @@ class api { * @param int $contextid The id of the context. * @return bool Returns if a conversation area exists and is enabled, false otherwise */ - public static function is_conversation_area_enabled(string $component, string $itemtype, int $itemid, int $contextid) : bool { + public static function is_conversation_area_enabled(string $component, string $itemtype, int $itemid, int $contextid): bool { global $DB; return $DB->record_exists('message_conversations', @@ -2802,7 +2802,7 @@ class api { */ public static function get_conversation_members(int $userid, int $conversationid, bool $includecontactrequests = false, bool $includeprivacyinfo = false, int $limitfrom = 0, - int $limitnum = 0) : array { + int $limitnum = 0): array { global $DB; if ($members = $DB->get_records('message_conversation_members', ['conversationid' => $conversationid], @@ -2822,7 +2822,7 @@ class api { * @param int $userid the id of the user whose conversations we'll check. * @return array the unread counts for each conversation, indexed by type. */ - public static function get_unread_conversation_counts(int $userid) : array { + public static function get_unread_conversation_counts(int $userid): array { global $DB; // Get all conversations the user is in, and check unread. @@ -2877,7 +2877,7 @@ class api { * @param int $userid The id of the user * @param int $conversationid The id of the conversation */ - public static function mute_conversation(int $userid, int $conversationid) : void { + public static function mute_conversation(int $userid, int $conversationid): void { global $DB; $mutedconversation = new \stdClass(); @@ -2895,7 +2895,7 @@ class api { * @param int $userid The id of the user * @param int $conversationid The id of the conversation */ - public static function unmute_conversation(int $userid, int $conversationid) : void { + public static function unmute_conversation(int $userid, int $conversationid): void { global $DB; $DB->delete_records('message_conversation_actions', @@ -2914,7 +2914,7 @@ class api { * @param int $conversationid The id of the conversation * @return bool Whether or not the conversation is muted or not */ - public static function is_conversation_muted(int $userid, int $conversationid) : bool { + public static function is_conversation_muted(int $userid, int $conversationid): bool { global $DB; return $DB->record_exists('message_conversation_actions', @@ -2964,7 +2964,7 @@ class api { * @param int $messageid The message id * @return bool Returns true if a user can delete the message for all users, false otherwise. */ - public static function can_delete_message_for_all_users(int $userid, int $messageid) : bool { + public static function can_delete_message_for_all_users(int $userid, int $messageid): bool { global $DB; $sql = "SELECT mc.id, mc.contextid @@ -3018,7 +3018,7 @@ class api { * * @param int $userid the user to whom the conversation belongs. */ - protected static function lazy_create_self_conversation(int $userid) : void { + protected static function lazy_create_self_conversation(int $userid): void { global $DB; // Check if the self-conversation for this user exists. // If not, create and star it for the user. diff --git a/message/classes/helper.php b/message/classes/helper.php index 9a66ca2eddc..7e4634931c3 100644 --- a/message/classes/helper.php +++ b/message/classes/helper.php @@ -59,7 +59,7 @@ class helper { */ public static function get_conversation_messages(int $userid, int $convid, int $timedeleted = 0, int $limitfrom = 0, int $limitnum = 0, string $sort = 'timecreated ASC', int $timefrom = 0, - int $timeto = 0) : array { + int $timeto = 0): array { global $DB; $sql = "SELECT m.id, m.useridfrom, m.subject, m.fullmessage, m.fullmessagehtml, @@ -124,7 +124,7 @@ class helper { * @param array $messages The formated array messages. * @return array A conversation array with the messages and the involved members. */ - public static function format_conversation_messages(int $userid, int $convid, array $messages) : array { + public static function format_conversation_messages(int $userid, int $convid, array $messages): array { global $USER; // Create the conversation array. @@ -349,7 +349,7 @@ class helper { * @param int $useridto * @return array */ - public static function messageuser_link_params(int $useridto) : array { + public static function messageuser_link_params(int $useridto): array { global $USER; return [ @@ -422,7 +422,7 @@ class helper { * @throws \dml_exception */ public static function get_member_info(int $referenceuserid, array $userids, bool $includecontactrequests = false, - bool $includeprivacyinfo = false) : array { + bool $includeprivacyinfo = false): array { global $DB, $PAGE; // Prevent exception being thrown when array is empty. @@ -666,7 +666,7 @@ class helper { * subset of user_get_default_fields (optional) * @return array the array of userdetails, if visible, or an empty array otherwise. */ - public static function search_get_user_details(\stdClass $user, array $userfields = []) : array { + public static function search_get_user_details(\stdClass $user, array $userfields = []): array { global $CFG, $USER; require_once($CFG->dirroot . '/user/lib.php'); @@ -697,7 +697,7 @@ class helper { public static function prevent_unclosed_html_tags( string $message, bool $removebody = false - ) : string { + ): string { $html = ''; if (!empty($message)) { $doc = new DOMDocument(); diff --git a/message/classes/privacy/provider.php b/message/classes/privacy/provider.php index 07e204e71b8..fc5f86c8128 100644 --- a/message/classes/privacy/provider.php +++ b/message/classes/privacy/provider.php @@ -62,7 +62,7 @@ class provider implements * @param collection $items a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { $items->add_database_table( 'messages', [ @@ -207,7 +207,7 @@ class provider implements * @param int $userid the userid. * @return contextlist the list of contexts containing user info for the user. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { global $DB; $contextlist = new contextlist(); diff --git a/message/classes/search/base_message.php b/message/classes/search/base_message.php index bcb7dd882bf..2d8f363fc34 100644 --- a/message/classes/search/base_message.php +++ b/message/classes/search/base_message.php @@ -204,7 +204,7 @@ abstract class base_message extends \core_search\base { * * @return \core_search\document_icon */ - public function get_doc_icon(\core_search\document $doc) : \core_search\document_icon { + public function get_doc_icon(\core_search\document $doc): \core_search\document_icon { return new \core_search\document_icon('t/message'); } diff --git a/message/classes/tests/helper.php b/message/classes/tests/helper.php index a0c1d645a10..5267621be06 100644 --- a/message/classes/tests/helper.php +++ b/message/classes/tests/helper.php @@ -44,7 +44,7 @@ class helper { * @throws \dml_exception if the conversation doesn't exist. */ public static function send_fake_message_to_conversation(\stdClass $userfrom, int $convid, string $message = 'Hello world!', - int $time = null) : int { + int $time = null): int { global $DB; $conversationrec = $DB->get_record('message_conversations', ['id' => $convid], 'id', MUST_EXIST); $conversationid = $conversationrec->id; diff --git a/message/output/airnotifier/classes/privacy/provider.php b/message/output/airnotifier/classes/privacy/provider.php index 27d06237276..2af5e6e104e 100644 --- a/message/output/airnotifier/classes/privacy/provider.php +++ b/message/output/airnotifier/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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->link_subsystem('core_user', 'privacy:metadata:usersubsystem'); $collection->add_database_table('message_airnotifier_devices', [ 'userdeviceid' => 'privacy:metadata:userdeviceid', @@ -78,7 +78,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {message_airnotifier_devices} mad JOIN {user_devices} ud ON ud.id = mad.userdeviceid @@ -195,7 +195,7 @@ class provider implements * @param int $userid The user ID * @return array An array of records. */ - protected static function get_records(int $userid) : array { + protected static function get_records(int $userid): array { global $DB; $sql = "SELECT mad.id, mad.enable, ud.appid, ud.name, ud.model, ud.platform, ud.version, ud.timecreated, ud.timemodified, ud.pushid diff --git a/message/output/email/classes/privacy/provider.php b/message/output/email/classes/privacy/provider.php index faba2460725..6566b2aa369 100644 --- a/message/output/email/classes/privacy/provider.php +++ b/message/output/email/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @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 { $messageemailmessages = [ 'useridto' => 'privacy:metadata:message_email_messages:useridto', 'conversationid' => 'privacy:metadata:message_email_messages:conversationid', @@ -83,7 +83,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); return $contextlist; } diff --git a/message/output/email/classes/task/send_email_task.php b/message/output/email/classes/task/send_email_task.php index 9696dfb141a..87864645e33 100644 --- a/message/output/email/classes/task/send_email_task.php +++ b/message/output/email/classes/task/send_email_task.php @@ -108,7 +108,7 @@ class send_email_task extends scheduled_task { * * @return moodle_recordset A moodle_recordset instance. */ - private function get_unique_users() : moodle_recordset { + private function get_unique_users(): moodle_recordset { global $DB; $subsql = 'SELECT DISTINCT(useridto) as id @@ -128,7 +128,7 @@ class send_email_task extends scheduled_task { * @param int $userid The ID of the user we are sending a digest to. * @return moodle_recordset A moodle_recordset instance. */ - private function get_conversations_for_user(int $userid) : moodle_recordset { + private function get_conversations_for_user(int $userid): moodle_recordset { global $DB; // We shouldn't be joining directly on the group table as group @@ -158,7 +158,7 @@ class send_email_task extends scheduled_task { * @param int $userid * @return moodle_recordset A moodle_recordset instance. */ - protected function get_users_messages_for_conversation(int $conversationid, int $userid) : moodle_recordset { + protected function get_users_messages_for_conversation(int $conversationid, int $userid): moodle_recordset { global $DB; $userfieldsapi = \core_user\fields::for_userpic(); diff --git a/message/output/popup/classes/privacy/provider.php b/message/output/popup/classes/privacy/provider.php index e5774b27dbf..9c31f7b5c5c 100644 --- a/message/output/popup/classes/privacy/provider.php +++ b/message/output/popup/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mnet/classes/privacy/provider.php b/mnet/classes/privacy/provider.php index e6ef0312256..0fffa8a1d85 100644 --- a/mnet/classes/privacy/provider.php +++ b/mnet/classes/privacy/provider.php @@ -35,7 +35,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'; } } diff --git a/mnet/service/enrol/classes/privacy/provider.php b/mnet/service/enrol/classes/privacy/provider.php index ce4ba7f85dd..172509116ea 100644 --- a/mnet/service/enrol/classes/privacy/provider.php +++ b/mnet/service/enrol/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @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( 'mnetservice_enrol_enrolments', [ @@ -75,7 +75,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT c.id FROM {context} c JOIN {mnetservice_enrol_enrolments} me diff --git a/mnet/xmlrpc/client.php b/mnet/xmlrpc/client.php index 9326bc3e12f..6e2fb08c42c 100644 --- a/mnet/xmlrpc/client.php +++ b/mnet/xmlrpc/client.php @@ -375,7 +375,7 @@ class mnet_xmlrpc_client { * @param object $mnet_peer A mnet_peer object with details of the remote host the request will be sent to * @return \PhpXmlRpc\Client handle - the almost-ready-to-send http request */ - public function prepare_http_request ($mnet_peer) { + public function prepare_http_request($mnet_peer) { $uri = $mnet_peer->wwwroot . $mnet_peer->application->xmlrpc_server_url; // Instantiate the xmlrpc client to be used for the client request diff --git a/mod/assign/classes/analytics/indicator/cognitive_depth.php b/mod/assign/classes/analytics/indicator/cognitive_depth.php index 08fbf49bd62..35e5f5ed8c2 100644 --- a/mod/assign/classes/analytics/indicator/cognitive_depth.php +++ b/mod/assign/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_assign'); } diff --git a/mod/assign/classes/analytics/indicator/social_breadth.php b/mod/assign/classes/analytics/indicator/social_breadth.php index fa3790564a8..38344be9453 100644 --- a/mod/assign/classes/analytics/indicator/social_breadth.php +++ b/mod/assign/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_assign'); } diff --git a/mod/assign/classes/privacy/provider.php b/mod/assign/classes/privacy/provider.php index 79642382fcc..8918fe1078b 100644 --- a/mod/assign/classes/privacy/provider.php +++ b/mod/assign/classes/privacy/provider.php @@ -69,7 +69,7 @@ class provider implements * @param collection $collection A collection of meta data items to be added to. * @return collection Returns the collection of metadata. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $assigngrades = [ 'userid' => 'privacy:metadata:userid', 'timecreated' => 'privacy:metadata:timecreated', @@ -134,7 +134,7 @@ class provider implements * @param int $userid The user ID. * @return contextlist an object with the contexts related to a userid. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $params = ['modulename' => 'assign', 'contextlevel' => CONTEXT_MODULE, 'userid' => $userid, diff --git a/mod/assign/feedback/comments/classes/privacy/provider.php b/mod/assign/feedback/comments/classes/privacy/provider.php index aa014a05cc3..86fcb63592a 100644 --- a/mod/assign/feedback/comments/classes/privacy/provider.php +++ b/mod/assign/feedback/comments/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @param collection $collection A list of information to add to. * @return collection Return the collection after adding to it. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $data = [ 'assignment' => 'privacy:metadata:assignmentid', 'grade' => 'privacy:metadata:gradepurpose', diff --git a/mod/assign/feedback/comments/locallib.php b/mod/assign/feedback/comments/locallib.php index 9cfd0ee3493..94f8675b30b 100644 --- a/mod/assign/feedback/comments/locallib.php +++ b/mod/assign/feedback/comments/locallib.php @@ -575,7 +575,7 @@ class assign_feedback_comments extends assign_feedback_plugin { * @param stdClass $grade The assign_grades object from the db * @return array */ - public function files_for_gradebook(stdClass $grade) : array { + public function files_for_gradebook(stdClass $grade): array { return [ 'contextid' => $this->assignment->get_context()->id, 'component' => ASSIGNFEEDBACK_COMMENTS_COMPONENT, diff --git a/mod/assign/feedback/editpdf/classes/privacy/provider.php b/mod/assign/feedback/editpdf/classes/privacy/provider.php index ebad1e7bcbc..a138eeb91b0 100644 --- a/mod/assign/feedback/editpdf/classes/privacy/provider.php +++ b/mod/assign/feedback/editpdf/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @param collection $collection A list of information to add to. * @return collection Return the collection after adding to it. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $quickdata = [ 'userid' => 'privacy:metadata:userid', 'rawtext' => 'privacy:metadata:rawtextpurpose', diff --git a/mod/assign/feedback/file/classes/privacy/provider.php b/mod/assign/feedback/file/classes/privacy/provider.php index 839e9577531..6096dd1f266 100644 --- a/mod/assign/feedback/file/classes/privacy/provider.php +++ b/mod/assign/feedback/file/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @param collection $collection A list of information to add to. * @return collection Return the collection after adding to it. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->link_subsystem('core_files', 'privacy:metadata:filepurpose'); return $collection; } diff --git a/mod/assign/feedback/offline/classes/privacy/provider.php b/mod/assign/feedback/offline/classes/privacy/provider.php index f3793adf2af..76ff2db1ee2 100644 --- a/mod/assign/feedback/offline/classes/privacy/provider.php +++ b/mod/assign/feedback/offline/classes/privacy/provider.php @@ -41,7 +41,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:nullproviderreason'; } } diff --git a/mod/assign/feedbackplugin.php b/mod/assign/feedbackplugin.php index 9b959a33680..f4a663f6a17 100644 --- a/mod/assign/feedbackplugin.php +++ b/mod/assign/feedbackplugin.php @@ -97,7 +97,7 @@ abstract class assign_feedback_plugin extends assign_plugin { * @param stdClass $grade The assign_grades object from the db * @return array */ - public function files_for_gradebook(stdClass $grade) : array { + public function files_for_gradebook(stdClass $grade): array { return []; } diff --git a/mod/assign/lib.php b/mod/assign/lib.php index c97f123fd95..7049d884590 100644 --- a/mod/assign/lib.php +++ b/mod/assign/lib.php @@ -1787,7 +1787,7 @@ function mod_assign_user_preferences(): array { * @param array $args The path (the part after the filearea and before the filename). * @return array The itemid and the filepath inside the $args path, for the defined filearea. */ -function mod_assign_get_path_from_pluginfile(string $filearea, array $args) : array { +function mod_assign_get_path_from_pluginfile(string $filearea, array $args): array { // Assign never has an itemid (the number represents the revision but it's not stored in database). array_shift($args); diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 837f6705b7e..cf80496e413 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -1773,7 +1773,7 @@ class assign { * @param int|null $userid the id of the user to load the assign instance for. * @return stdClass The settings */ - public function get_instance(int $userid = null) : stdClass { + public function get_instance(int $userid = null): stdClass { global $USER; $userid = $userid ?? $USER->id; @@ -1796,7 +1796,7 @@ class assign { * @param int $userid the id of the user to calculate the properties for. * @return stdClass a new record having calculated properties. */ - private function calculate_properties(\stdClass $record, int $userid) : \stdClass { + private function calculate_properties(\stdClass $record, int $userid): \stdClass { $record = clone ($record); // Relative dates. diff --git a/mod/assign/submission/comments/classes/privacy/provider.php b/mod/assign/submission/comments/classes/privacy/provider.php index 8a7336c86a8..dae3091816e 100644 --- a/mod/assign/submission/comments/classes/privacy/provider.php +++ b/mod/assign/submission/comments/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements metadataprovider, * @param collection $collection A list of information to add to. * @return collection Return the collection after adding to it. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->link_subsystem('core_comment', 'privacy:metadata:commentpurpose'); return $collection; } diff --git a/mod/assign/submission/file/classes/privacy/provider.php b/mod/assign/submission/file/classes/privacy/provider.php index f02f6dc70ab..057a4ca95b4 100644 --- a/mod/assign/submission/file/classes/privacy/provider.php +++ b/mod/assign/submission/file/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @param collection $collection A list of information to add to. * @return collection Return the collection after adding to it. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->link_subsystem('core_files', 'privacy:metadata:filepurpose'); return $collection; } diff --git a/mod/assign/submission/onlinetext/classes/privacy/provider.php b/mod/assign/submission/onlinetext/classes/privacy/provider.php index fa660b9769a..6aab29e4c9f 100644 --- a/mod/assign/submission/onlinetext/classes/privacy/provider.php +++ b/mod/assign/submission/onlinetext/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @param collection $collection A list of information to add to. * @return collection Return the collection after adding to it. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $detail = [ 'assignment' => 'privacy:metadata:assignmentid', 'submission' => 'privacy:metadata:submissionpurpose', diff --git a/mod/assign/submissionplugin.php b/mod/assign/submissionplugin.php index 2280cd094cf..0bbed0cd91d 100644 --- a/mod/assign/submissionplugin.php +++ b/mod/assign/submissionplugin.php @@ -83,7 +83,7 @@ abstract class assign_submission_plugin extends assign_plugin { * @param stdClass $submission - New submission record * @return bool */ - public function copy_submission( stdClass $oldsubmission, stdClass $submission) { + public function copy_submission(stdClass $oldsubmission, stdClass $submission) { return true; } diff --git a/mod/bigbluebuttonbn/classes/instance.php b/mod/bigbluebuttonbn/classes/instance.php index 507133b8cc7..5f13e8e8809 100644 --- a/mod/bigbluebuttonbn/classes/instance.php +++ b/mod/bigbluebuttonbn/classes/instance.php @@ -1307,7 +1307,7 @@ EOF; * * @return string */ - public function get_guest_access_password() : string { + public function get_guest_access_password(): string { $guestpassword = $this->get_instance_var('guestpassword'); if (empty($guestpassword)) { $this->generate_guest_credentials(); @@ -1321,7 +1321,7 @@ EOF; * * @return void */ - private function generate_guest_credentials():void { + private function generate_guest_credentials(): void { global $DB; [$this->instancedata->guestlinkuid, $this->instancedata->guestpassword] = \mod_bigbluebuttonbn\plugin::generate_guest_meeting_credentials(); diff --git a/mod/bigbluebuttonbn/classes/meeting.php b/mod/bigbluebuttonbn/classes/meeting.php index bf8672c9b55..25b9a34e258 100644 --- a/mod/bigbluebuttonbn/classes/meeting.php +++ b/mod/bigbluebuttonbn/classes/meeting.php @@ -482,7 +482,7 @@ class meeting { * @param object $data * @return string */ - public static function meeting_events(instance $instance, object $data): string { + public static function meeting_events(instance $instance, object $data): string { $bigbluebuttonbn = $instance->get_instance_data(); // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. $meetingidelements = explode('[', $data->{'meeting_id'}); diff --git a/mod/book/classes/analytics/indicator/cognitive_depth.php b/mod/book/classes/analytics/indicator/cognitive_depth.php index ff5dc909c15..e1bb957a96f 100644 --- a/mod/book/classes/analytics/indicator/cognitive_depth.php +++ b/mod/book/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_book'); } diff --git a/mod/book/classes/analytics/indicator/social_breadth.php b/mod/book/classes/analytics/indicator/social_breadth.php index 279fa0306f2..8befc6c9c3f 100644 --- a/mod/book/classes/analytics/indicator/social_breadth.php +++ b/mod/book/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_book'); } diff --git a/mod/book/classes/privacy/provider.php b/mod/book/classes/privacy/provider.php index 98a49e45292..a0b17586b09 100644 --- a/mod/book/classes/privacy/provider.php +++ b/mod/book/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/book/tool/exportimscp/classes/privacy/provider.php b/mod/book/tool/exportimscp/classes/privacy/provider.php index 05967bf152e..066b9bc8e21 100644 --- a/mod/book/tool/exportimscp/classes/privacy/provider.php +++ b/mod/book/tool/exportimscp/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/book/tool/importhtml/classes/privacy/provider.php b/mod/book/tool/importhtml/classes/privacy/provider.php index d9adab5db00..3aeb7f06772 100644 --- a/mod/book/tool/importhtml/classes/privacy/provider.php +++ b/mod/book/tool/importhtml/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/book/tool/print/classes/privacy/provider.php b/mod/book/tool/print/classes/privacy/provider.php index 7f41705e6a5..9012e5f3e7f 100644 --- a/mod/book/tool/print/classes/privacy/provider.php +++ b/mod/book/tool/print/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/chat/chatd.php b/mod/chat/chatd.php index d576456245c..3be05f6508f 100644 --- a/mod/chat/chatd.php +++ b/mod/chat/chatd.php @@ -153,7 +153,7 @@ class ChatDaemon { } } - public function error_handler ($errno, $errmsg, $filename, $linenum, $vars) { + public function error_handler($errno, $errmsg, $filename, $linenum, $vars) { // Checks if an error needs to be suppressed due to @. if (error_reporting() != 0) { $this->trace($errmsg.' on line '.$linenum, $errno); diff --git a/mod/chat/classes/analytics/indicator/cognitive_depth.php b/mod/chat/classes/analytics/indicator/cognitive_depth.php index dc25e0befc4..4343c3c2023 100644 --- a/mod/chat/classes/analytics/indicator/cognitive_depth.php +++ b/mod/chat/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_chat'); } diff --git a/mod/chat/classes/analytics/indicator/social_breadth.php b/mod/chat/classes/analytics/indicator/social_breadth.php index 97b2cf4ba48..f7b64e4c16a 100644 --- a/mod/chat/classes/analytics/indicator/social_breadth.php +++ b/mod/chat/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_chat'); } diff --git a/mod/chat/classes/privacy/provider.php b/mod/chat/classes/privacy/provider.php index d2da21b2899..d6f24a643ff 100644 --- a/mod/chat/classes/privacy/provider.php +++ b/mod/chat/classes/privacy/provider.php @@ -59,7 +59,7 @@ class provider implements * @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('chat_messages', [ 'userid' => 'privacy:metadata:messages:userid', @@ -98,7 +98,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $contextlist = new \core_privacy\local\request\contextlist(); $sql = " diff --git a/mod/choice/classes/analytics/indicator/cognitive_depth.php b/mod/choice/classes/analytics/indicator/cognitive_depth.php index 5dcbeb844a1..3e3d390c9e1 100644 --- a/mod/choice/classes/analytics/indicator/cognitive_depth.php +++ b/mod/choice/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_choice'); } diff --git a/mod/choice/classes/analytics/indicator/social_breadth.php b/mod/choice/classes/analytics/indicator/social_breadth.php index 2ae86497b49..96e7b824907 100644 --- a/mod/choice/classes/analytics/indicator/social_breadth.php +++ b/mod/choice/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_choice'); } diff --git a/mod/choice/classes/privacy/provider.php b/mod/choice/classes/privacy/provider.php index 353ba0a9212..19ebcf44484 100644 --- a/mod/choice/classes/privacy/provider.php +++ b/mod/choice/classes/privacy/provider.php @@ -57,7 +57,7 @@ class provider implements * @param collection $items a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { $items->add_database_table( 'choice_answers', [ @@ -78,7 +78,7 @@ class provider implements * @param int $userid the userid. * @return contextlist the list of contexts containing user info for the user. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { // Fetch all choice answers. $sql = "SELECT c.id FROM {context} c diff --git a/mod/data/classes/analytics/indicator/cognitive_depth.php b/mod/data/classes/analytics/indicator/cognitive_depth.php index 8ac7fdbe475..94cd18b8338 100644 --- a/mod/data/classes/analytics/indicator/cognitive_depth.php +++ b/mod/data/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_data'); } diff --git a/mod/data/classes/analytics/indicator/social_breadth.php b/mod/data/classes/analytics/indicator/social_breadth.php index 3f3cce2c517..46dda934619 100644 --- a/mod/data/classes/analytics/indicator/social_breadth.php +++ b/mod/data/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_data'); } diff --git a/mod/data/classes/manager.php b/mod/data/classes/manager.php index 0485bfa7d7f..05b0d565a6c 100644 --- a/mod/data/classes/manager.php +++ b/mod/data/classes/manager.php @@ -422,7 +422,7 @@ class manager { * @param int $userid the user id to check ($USER->id if null). * @return bool if the user can view the preset. */ - public function can_view_preset (preset $preset, ?int $userid = null): bool { + public function can_view_preset(preset $preset, ?int $userid = null): bool { global $USER; if (!$userid) { $userid = $USER->id; diff --git a/mod/data/classes/output/template_editor_tools.php b/mod/data/classes/output/template_editor_tools.php index f124f234ef8..03705f6ab6c 100644 --- a/mod/data/classes/output/template_editor_tools.php +++ b/mod/data/classes/output/template_editor_tools.php @@ -190,7 +190,7 @@ class template_editor_tools implements templatable, renderable { * @param array $taglist the indexed array of taglists ($tag => $tagname) * @return array of optgroup data */ - protected function get_optgroup_data (string $name, array $taglist): array { + protected function get_optgroup_data(string $name, array $taglist): array { $tags = []; foreach ($taglist as $tag => $tagname) { $tags[] = [ diff --git a/mod/data/classes/privacy/provider.php b/mod/data/classes/privacy/provider.php index 43898d0e87e..e39695546e0 100644 --- a/mod/data/classes/privacy/provider.php +++ b/mod/data/classes/privacy/provider.php @@ -59,7 +59,7 @@ class provider implements * @param collection $collection a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_database_table( 'data_records', [ @@ -102,7 +102,7 @@ class provider implements * @param int $userid the userid. * @return contextlist the list of contexts containing user info for the user. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // Fetch all data records that the user rote. diff --git a/mod/data/classes/search/entry.php b/mod/data/classes/search/entry.php index 47ae9d9f895..75718e52d81 100644 --- a/mod/data/classes/search/entry.php +++ b/mod/data/classes/search/entry.php @@ -373,7 +373,7 @@ class entry extends \core_search\base_mod { * @param string $fieldtype * @return string|null It will return the class name or null if the field type is not available. */ - protected function get_field_class_name(string $fieldtype) : ?string { + protected function get_field_class_name(string $fieldtype): ?string { global $CFG; $fieldtype = trim($fieldtype); diff --git a/mod/data/field/checkbox/classes/privacy/provider.php b/mod/data/field/checkbox/classes/privacy/provider.php index 3da14eb09b9..3ff56cc4d20 100644 --- a/mod/data/field/checkbox/classes/privacy/provider.php +++ b/mod/data/field/checkbox/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/date/classes/privacy/provider.php b/mod/data/field/date/classes/privacy/provider.php index 478ac0d6199..2ee6f85a93c 100644 --- a/mod/data/field/date/classes/privacy/provider.php +++ b/mod/data/field/date/classes/privacy/provider.php @@ -40,7 +40,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'; } diff --git a/mod/data/field/file/classes/privacy/provider.php b/mod/data/field/file/classes/privacy/provider.php index ebb757dfe93..cf77fc9a995 100644 --- a/mod/data/field/file/classes/privacy/provider.php +++ b/mod/data/field/file/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/latlong/classes/privacy/provider.php b/mod/data/field/latlong/classes/privacy/provider.php index 9c7013e87a2..bfe13724bd0 100644 --- a/mod/data/field/latlong/classes/privacy/provider.php +++ b/mod/data/field/latlong/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/menu/classes/privacy/provider.php b/mod/data/field/menu/classes/privacy/provider.php index 08c419ad4a2..2f78d43ebc9 100644 --- a/mod/data/field/menu/classes/privacy/provider.php +++ b/mod/data/field/menu/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/multimenu/classes/privacy/provider.php b/mod/data/field/multimenu/classes/privacy/provider.php index 42f109e4dcf..b323b9a19e4 100644 --- a/mod/data/field/multimenu/classes/privacy/provider.php +++ b/mod/data/field/multimenu/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/number/classes/privacy/provider.php b/mod/data/field/number/classes/privacy/provider.php index c7a2a7361fa..87c75756a81 100644 --- a/mod/data/field/number/classes/privacy/provider.php +++ b/mod/data/field/number/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/picture/classes/privacy/provider.php b/mod/data/field/picture/classes/privacy/provider.php index d28fcdb7a37..9c399367291 100644 --- a/mod/data/field/picture/classes/privacy/provider.php +++ b/mod/data/field/picture/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/radiobutton/classes/privacy/provider.php b/mod/data/field/radiobutton/classes/privacy/provider.php index 25926ba151a..ffd350f8e5a 100644 --- a/mod/data/field/radiobutton/classes/privacy/provider.php +++ b/mod/data/field/radiobutton/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/text/classes/privacy/provider.php b/mod/data/field/text/classes/privacy/provider.php index 923e517b2e7..8594a20a9fd 100644 --- a/mod/data/field/text/classes/privacy/provider.php +++ b/mod/data/field/text/classes/privacy/provider.php @@ -39,7 +39,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'; } diff --git a/mod/data/field/textarea/classes/privacy/provider.php b/mod/data/field/textarea/classes/privacy/provider.php index 4ad607fe540..9ebb4059646 100644 --- a/mod/data/field/textarea/classes/privacy/provider.php +++ b/mod/data/field/textarea/classes/privacy/provider.php @@ -41,7 +41,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'; } diff --git a/mod/data/field/url/classes/privacy/provider.php b/mod/data/field/url/classes/privacy/provider.php index 75aeb56e4e5..bb6d6c7c389 100644 --- a/mod/data/field/url/classes/privacy/provider.php +++ b/mod/data/field/url/classes/privacy/provider.php @@ -40,7 +40,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'; } diff --git a/mod/data/preset/imagegallery/classes/privacy/provider.php b/mod/data/preset/imagegallery/classes/privacy/provider.php index fbf08b394a1..14d648ce05f 100644 --- a/mod/data/preset/imagegallery/classes/privacy/provider.php +++ b/mod/data/preset/imagegallery/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/data/preset/journal/classes/privacy/provider.php b/mod/data/preset/journal/classes/privacy/provider.php index 73bbdb93536..882f965ee6e 100644 --- a/mod/data/preset/journal/classes/privacy/provider.php +++ b/mod/data/preset/journal/classes/privacy/provider.php @@ -31,7 +31,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'; } } diff --git a/mod/data/preset/proposals/classes/privacy/provider.php b/mod/data/preset/proposals/classes/privacy/provider.php index 9b9d45e2546..48c9f853319 100644 --- a/mod/data/preset/proposals/classes/privacy/provider.php +++ b/mod/data/preset/proposals/classes/privacy/provider.php @@ -31,7 +31,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'; } } diff --git a/mod/data/preset/resources/classes/privacy/provider.php b/mod/data/preset/resources/classes/privacy/provider.php index 2fa45123091..1a936ef23f1 100644 --- a/mod/data/preset/resources/classes/privacy/provider.php +++ b/mod/data/preset/resources/classes/privacy/provider.php @@ -31,7 +31,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'; } } diff --git a/mod/feedback/classes/analytics/indicator/cognitive_depth.php b/mod/feedback/classes/analytics/indicator/cognitive_depth.php index 5641005b2c3..d8e3c15ff5b 100644 --- a/mod/feedback/classes/analytics/indicator/cognitive_depth.php +++ b/mod/feedback/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_feedback'); } diff --git a/mod/feedback/classes/analytics/indicator/social_breadth.php b/mod/feedback/classes/analytics/indicator/social_breadth.php index 8d972ea0008..09aa8c226ad 100644 --- a/mod/feedback/classes/analytics/indicator/social_breadth.php +++ b/mod/feedback/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_feedback'); } diff --git a/mod/feedback/classes/privacy/provider.php b/mod/feedback/classes/privacy/provider.php index 0e77a348e34..43baeb9d6a4 100644 --- a/mod/feedback/classes/privacy/provider.php +++ b/mod/feedback/classes/privacy/provider.php @@ -59,7 +59,7 @@ class provider implements * @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 { $completedfields = [ 'userid' => 'privacy:metadata:completed:userid', 'timemodified' => 'privacy:metadata:completed:timemodified', @@ -85,7 +85,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = " SELECT DISTINCT ctx.id FROM {%s} fc diff --git a/mod/folder/classes/analytics/indicator/cognitive_depth.php b/mod/folder/classes/analytics/indicator/cognitive_depth.php index 6b1f5582a02..c9ee3f712cb 100644 --- a/mod/folder/classes/analytics/indicator/cognitive_depth.php +++ b/mod/folder/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_folder'); } diff --git a/mod/folder/classes/analytics/indicator/social_breadth.php b/mod/folder/classes/analytics/indicator/social_breadth.php index 2d84c0a474e..dbe0f2b7dc0 100644 --- a/mod/folder/classes/analytics/indicator/social_breadth.php +++ b/mod/folder/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_folder'); } diff --git a/mod/folder/classes/privacy/provider.php b/mod/folder/classes/privacy/provider.php index 7ed91f33499..34b6d071ee0 100644 --- a/mod/folder/classes/privacy/provider.php +++ b/mod/folder/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/mod/folder/lib.php b/mod/folder/lib.php index ac18c071c80..82393fc72ea 100644 --- a/mod/folder/lib.php +++ b/mod/folder/lib.php @@ -848,7 +848,7 @@ function mod_folder_core_calendar_provide_event_action(calendar_event $event, * @param array $args The path (the part after the filearea and before the filename). * @return array The itemid and the filepath inside the $args path, for the defined filearea. */ -function mod_folder_get_path_from_pluginfile(string $filearea, array $args) : array { +function mod_folder_get_path_from_pluginfile(string $filearea, array $args): array { // Folder never has an itemid (the number represents the revision but it's not stored in database). array_shift($args); diff --git a/mod/forum/classes/analytics/indicator/cognitive_depth.php b/mod/forum/classes/analytics/indicator/cognitive_depth.php index eddfa7e7a81..52fa3eb065d 100644 --- a/mod/forum/classes/analytics/indicator/cognitive_depth.php +++ b/mod/forum/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_forum'); } diff --git a/mod/forum/classes/analytics/indicator/social_breadth.php b/mod/forum/classes/analytics/indicator/social_breadth.php index d1d1d13b260..0d2411b38b5 100644 --- a/mod/forum/classes/analytics/indicator/social_breadth.php +++ b/mod/forum/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_forum'); } diff --git a/mod/forum/classes/local/builders/exported_discussion.php b/mod/forum/classes/local/builders/exported_discussion.php index d0e98f5d7e2..4f3b7dc0a7d 100644 --- a/mod/forum/classes/local/builders/exported_discussion.php +++ b/mod/forum/classes/local/builders/exported_discussion.php @@ -105,7 +105,7 @@ class exported_discussion { stdClass $user, forum_entity $forum, discussion_entity $discussion - ) : array { + ): array { $favouriteids = []; if ($this->is_favourited($discussion, $forum->get_context(), $user)) { @@ -125,7 +125,7 @@ class exported_discussion { * @param forum_entity $forum The forum entity * @return stdClass[] */ - private function get_groups_available_in_forum($forum) : array { + private function get_groups_available_in_forum($forum): array { $course = $forum->get_course_record(); $coursemodule = $forum->get_course_module_record(); diff --git a/mod/forum/classes/local/builders/exported_discussion_summaries.php b/mod/forum/classes/local/builders/exported_discussion_summaries.php index 33c1cedab64..b080f473e1c 100644 --- a/mod/forum/classes/local/builders/exported_discussion_summaries.php +++ b/mod/forum/classes/local/builders/exported_discussion_summaries.php @@ -112,7 +112,7 @@ class exported_discussion_summaries { stdClass $user, forum_entity $forum, array $discussions - ) : array { + ): array { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $canseeanyprivatereply = $capabilitymanager->can_view_any_private_reply($user); @@ -200,7 +200,7 @@ class exported_discussion_summaries { * @param stdClass $user The user we are getting favourites for * @return int[] A list of favourited itemids */ - private function get_favourites(stdClass $user) : array { + private function get_favourites(stdClass $user): array { $ids = []; if (isloggedin()) { @@ -237,7 +237,7 @@ class exported_discussion_summaries { * @param forum_entity $forum The forum entity * @return stdClass[] */ - private function get_groups_available_in_forum($forum) : array { + private function get_groups_available_in_forum($forum): array { $course = $forum->get_course_record(); $coursemodule = $forum->get_course_module_record(); @@ -251,7 +251,7 @@ class exported_discussion_summaries { * @param forum_entity $forum The forum entity * @return array Author groups indexed by author id */ - private function get_author_groups_from_posts(array $posts, $forum) : array { + private function get_author_groups_from_posts(array $posts, $forum): array { $course = $forum->get_course_record(); $coursemodule = $forum->get_course_module_record(); $authorids = array_reduce($posts, function($carry, $post) { @@ -292,7 +292,7 @@ class exported_discussion_summaries { * @param int[] $authorids The list of author ids to fetch context ids for. * @return int[] Context ids indexed by author id */ - private function get_author_context_ids(array $authorids) : array { + private function get_author_context_ids(array $authorids): array { $authorvault = $this->vaultfactory->get_author_vault(); return $authorvault->get_context_ids_for_author_ids($authorids); } diff --git a/mod/forum/classes/local/builders/exported_posts.php b/mod/forum/classes/local/builders/exported_posts.php index 7f092e3bf5d..26cbb2ac831 100644 --- a/mod/forum/classes/local/builders/exported_posts.php +++ b/mod/forum/classes/local/builders/exported_posts.php @@ -126,7 +126,7 @@ class exported_posts { array $discussions, array $posts, bool $includeinlineattachments = false - ) : array { + ): array { // Format the forums and discussion to make them more easily accessed later. $forums = array_reduce($forums, function($carry, $forum) { $carry[$forum->get_id()] = $forum; @@ -225,7 +225,7 @@ class exported_posts { * @param post_entity[] $posts The list of posts to process. * @return array List of grouped posts. Each group has a discussion, forum, and posts. */ - private function group_posts_by_discussion(array $forums, array $discussions, array $posts) : array { + private function group_posts_by_discussion(array $forums, array $discussions, array $posts): array { return array_reduce($posts, function($carry, $post) use ($forums, $discussions) { $discussionid = $post->get_discussion_id(); if (!isset($discussions[$discussionid])) { @@ -261,7 +261,7 @@ class exported_posts { * @param post_entity[] $posts The list of posts to process. * @return author_entity[] */ - private function get_authors_for_posts(array $posts) : array { + private function get_authors_for_posts(array $posts): array { $authorvault = $this->vaultfactory->get_author_vault(); return $authorvault->get_authors_for_posts($posts); } @@ -272,7 +272,7 @@ class exported_posts { * @param int[] $authorids The list of author ids to fetch context ids for. * @return int[] Context ids indexed by author id */ - private function get_author_context_ids(array $authorids) : array { + private function get_author_context_ids(array $authorids): array { $authorvault = $this->vaultfactory->get_author_vault(); return $authorvault->get_context_ids_for_author_ids($authorids); } @@ -284,7 +284,7 @@ class exported_posts { * @param array $groupedposts List of posts grouped by discussions. * @return stored_file[] */ - private function get_inline_attachments_for_posts(array $groupedposts) : array { + private function get_inline_attachments_for_posts(array $groupedposts): array { $inlineattachmentsbypostid = []; $postattachmentvault = $this->vaultfactory->get_post_attachment_vault(); $postsbyforum = array_reduce($groupedposts, function($carry, $grouping) { @@ -322,7 +322,7 @@ class exported_posts { * @param array $groupedposts List of posts grouped by discussions. * @return stored_file[] */ - private function get_attachments_for_posts(array $groupedposts) : array { + private function get_attachments_for_posts(array $groupedposts): array { $attachmentsbypostid = []; $postattachmentvault = $this->vaultfactory->get_post_attachment_vault(); $postsbyforum = array_reduce($groupedposts, function($carry, $grouping) { @@ -363,7 +363,7 @@ class exported_posts { * @param array $groupedposts List of posts grouped by discussions. * @return array List of groups indexed by forum id and then author id. */ - private function get_author_groups_from_posts(array $groupedposts) : array { + private function get_author_groups_from_posts(array $groupedposts): array { $groupsbyauthorid = []; $authoridsbycourseid = []; @@ -432,7 +432,7 @@ class exported_posts { * @param post_entity[] $posts The list of posts to load tags for. * @return array Sets of tags indexed by post id. */ - private function get_tags_from_posts(array $posts) : array { + private function get_tags_from_posts(array $posts): array { $postids = array_map(function($post) { return $post->get_id(); }, $posts); diff --git a/mod/forum/classes/local/container.php b/mod/forum/classes/local/container.php index 23825f8acbc..fb48d7fcb50 100644 --- a/mod/forum/classes/local/container.php +++ b/mod/forum/classes/local/container.php @@ -50,7 +50,7 @@ class container { * * @return renderer_factory */ - public static function get_renderer_factory() : renderer_factory { + public static function get_renderer_factory(): renderer_factory { global $PAGE; return new renderer_factory( @@ -70,7 +70,7 @@ class container { * * @return legacy_data_mapper_factory */ - public static function get_legacy_data_mapper_factory() : legacy_data_mapper_factory { + public static function get_legacy_data_mapper_factory(): legacy_data_mapper_factory { return new legacy_data_mapper_factory(); } @@ -79,7 +79,7 @@ class container { * * @return exporter_factory */ - public static function get_exporter_factory() : exporter_factory { + public static function get_exporter_factory(): exporter_factory { return new exporter_factory( self::get_legacy_data_mapper_factory(), self::get_manager_factory(), @@ -93,7 +93,7 @@ class container { * * @return vault_factory */ - public static function get_vault_factory() : vault_factory { + public static function get_vault_factory(): vault_factory { global $DB; return new vault_factory( @@ -109,7 +109,7 @@ class container { * * @return manager_factory */ - public static function get_manager_factory() : manager_factory { + public static function get_manager_factory(): manager_factory { return new manager_factory( self::get_legacy_data_mapper_factory() ); @@ -120,7 +120,7 @@ class container { * * @return entity_factory */ - public static function get_entity_factory() : entity_factory { + public static function get_entity_factory(): entity_factory { return new entity_factory(); } @@ -129,7 +129,7 @@ class container { * * @return builder_factory */ - public static function get_builder_factory() : builder_factory { + public static function get_builder_factory(): builder_factory { global $PAGE; return new builder_factory( @@ -146,7 +146,7 @@ class container { * * @return url_factory */ - public static function get_url_factory() : url_factory { + public static function get_url_factory(): url_factory { return new url_factory( self::get_legacy_data_mapper_factory() ); diff --git a/mod/forum/classes/local/data_mappers/legacy/author.php b/mod/forum/classes/local/data_mappers/legacy/author.php index b62e5a6f5da..34538afae57 100644 --- a/mod/forum/classes/local/data_mappers/legacy/author.php +++ b/mod/forum/classes/local/data_mappers/legacy/author.php @@ -42,7 +42,7 @@ class author { * @param author_entity[] $authors The authors to convert. * @return stdClass[] */ - public function to_legacy_objects(array $authors) : array { + public function to_legacy_objects(array $authors): array { return array_map(function(author_entity $author) { return (object) [ 'id' => $author->get_id(), @@ -67,7 +67,7 @@ class author { * @param author_entity $author The author to convert. * @return stdClass */ - public function to_legacy_object(author_entity $author) : stdClass { + public function to_legacy_object(author_entity $author): stdClass { return $this->to_legacy_objects([$author])[0]; } } diff --git a/mod/forum/classes/local/data_mappers/legacy/discussion.php b/mod/forum/classes/local/data_mappers/legacy/discussion.php index 2973fa48adc..b74bc1b8eeb 100644 --- a/mod/forum/classes/local/data_mappers/legacy/discussion.php +++ b/mod/forum/classes/local/data_mappers/legacy/discussion.php @@ -42,7 +42,7 @@ class discussion { * @param discussion_entity[] $authors The authors to convert. * @return stdClass[] */ - public function to_legacy_objects(array $discussions) : array { + public function to_legacy_objects(array $discussions): array { return array_map(function(discussion_entity $discussion) { return (object) [ 'id' => $discussion->get_id(), @@ -69,7 +69,7 @@ class discussion { * @param discussion_entity $discussion The discussion to convert. * @return stdClass */ - public function to_legacy_object(discussion_entity $discussion) : stdClass { + public function to_legacy_object(discussion_entity $discussion): stdClass { return $this->to_legacy_objects([$discussion])[0]; } } diff --git a/mod/forum/classes/local/data_mappers/legacy/forum.php b/mod/forum/classes/local/data_mappers/legacy/forum.php index 6b8ec772b80..a55dcbff127 100644 --- a/mod/forum/classes/local/data_mappers/legacy/forum.php +++ b/mod/forum/classes/local/data_mappers/legacy/forum.php @@ -42,7 +42,7 @@ class forum { * @param forum_entity[] $forums The forums to convert. * @return stdClass[] */ - public function to_legacy_objects(array $forums) : array { + public function to_legacy_objects(array $forums): array { return array_map(function(forum_entity $forum) { return (object) [ 'id' => $forum->get_id(), @@ -84,7 +84,7 @@ class forum { * @param forum_entity $forum The forum to convert. * @return stdClass */ - public function to_legacy_object(forum_entity $forum) : stdClass { + public function to_legacy_object(forum_entity $forum): stdClass { return $this->to_legacy_objects([$forum])[0]; } } diff --git a/mod/forum/classes/local/data_mappers/legacy/post.php b/mod/forum/classes/local/data_mappers/legacy/post.php index 09742c1ed5c..1db2ade9a80 100644 --- a/mod/forum/classes/local/data_mappers/legacy/post.php +++ b/mod/forum/classes/local/data_mappers/legacy/post.php @@ -42,7 +42,7 @@ class post { * @param post_entity[] $posts The posts to convert. * @return stdClass[] */ - public function to_legacy_objects(array $posts) : array { + public function to_legacy_objects(array $posts): array { return array_map(function(post_entity $post) { return (object) [ 'id' => $post->get_id(), @@ -73,7 +73,7 @@ class post { * @param post_entity $post The post to convert. * @return stdClass */ - public function to_legacy_object(post_entity $post) : stdClass { + public function to_legacy_object(post_entity $post): stdClass { return $this->to_legacy_objects([$post])[0]; } } diff --git a/mod/forum/classes/local/entities/author.php b/mod/forum/classes/local/entities/author.php index 527ecedaa2d..84367afc125 100644 --- a/mod/forum/classes/local/entities/author.php +++ b/mod/forum/classes/local/entities/author.php @@ -106,7 +106,7 @@ class author { * * @return int */ - public function get_id() : int { + public function get_id(): int { return $this->id; } @@ -115,7 +115,7 @@ class author { * * @return int */ - public function get_picture_item_id() : int { + public function get_picture_item_id(): int { return $this->pictureitemid; } @@ -124,7 +124,7 @@ class author { * * @return string */ - public function get_first_name() : string { + public function get_first_name(): string { return $this->firstname; } @@ -133,7 +133,7 @@ class author { * * @return string */ - public function get_last_name() : string { + public function get_last_name(): string { return $this->lastname; } @@ -142,7 +142,7 @@ class author { * * @return string */ - public function get_full_name() : string { + public function get_full_name(): string { return $this->fullname; } @@ -151,7 +151,7 @@ class author { * * @return string */ - public function get_email() : string { + public function get_email(): string { return $this->email; } @@ -160,7 +160,7 @@ class author { * * @return bool */ - public function is_deleted() : bool { + public function is_deleted(): bool { return !empty($this->deleted); } @@ -169,7 +169,7 @@ class author { * * @return string|null */ - public function get_middle_name() : ?string { + public function get_middle_name(): ?string { return $this->middlename; } @@ -178,7 +178,7 @@ class author { * * @return string|null */ - public function get_first_name_phonetic() : ?string { + public function get_first_name_phonetic(): ?string { return $this->firstnamephonetic; } @@ -187,7 +187,7 @@ class author { * * @return string|null */ - public function get_last_name_phonetic() : ?string { + public function get_last_name_phonetic(): ?string { return $this->lastnamephonetic; } @@ -196,7 +196,7 @@ class author { * * @return string|null */ - public function get_alternate_name() : ?string { + public function get_alternate_name(): ?string { return $this->alternatename; } @@ -205,7 +205,7 @@ class author { * * @return string|null */ - public function get_image_alt() : ?string { + public function get_image_alt(): ?string { return $this->imagealt; } } diff --git a/mod/forum/classes/local/entities/discussion.php b/mod/forum/classes/local/entities/discussion.php index 13daac36d8b..b626ca61cde 100644 --- a/mod/forum/classes/local/entities/discussion.php +++ b/mod/forum/classes/local/entities/discussion.php @@ -119,7 +119,7 @@ class discussion { * * @return int */ - public function get_id() : int { + public function get_id(): int { return $this->id; } @@ -128,7 +128,7 @@ class discussion { * * @return int */ - public function get_course_id() : int { + public function get_course_id(): int { return $this->courseid; } @@ -137,7 +137,7 @@ class discussion { * * @return int */ - public function get_forum_id() : int { + public function get_forum_id(): int { return $this->forumid; } @@ -146,7 +146,7 @@ class discussion { * * @return string */ - public function get_name() : string { + public function get_name(): string { return $this->name; } @@ -155,7 +155,7 @@ class discussion { * * @return int */ - public function get_first_post_id() : int { + public function get_first_post_id(): int { return $this->firstpostid; } @@ -164,7 +164,7 @@ class discussion { * * @return int */ - public function get_user_id() : int { + public function get_user_id(): int { return $this->userid; } @@ -173,7 +173,7 @@ class discussion { * * @return int */ - public function get_group_id() : int { + public function get_group_id(): int { return $this->groupid; } @@ -182,7 +182,7 @@ class discussion { * * @return bool */ - public function is_assessed() : bool { + public function is_assessed(): bool { return $this->assessed; } @@ -191,7 +191,7 @@ class discussion { * * @return int */ - public function get_time_modified() : int { + public function get_time_modified(): int { return $this->timemodified; } @@ -200,7 +200,7 @@ class discussion { * * @return int */ - public function get_user_modified() : int { + public function get_user_modified(): int { return $this->usermodified; } @@ -210,7 +210,7 @@ class discussion { * * @return int */ - public function get_time_start() : int { + public function get_time_start(): int { return $this->timestart; } @@ -220,7 +220,7 @@ class discussion { * * @return int */ - public function get_time_end() : int { + public function get_time_end(): int { return $this->timeend; } @@ -229,7 +229,7 @@ class discussion { * * @return bool */ - public function is_pinned() : bool { + public function is_pinned(): bool { return $this->pinned; } @@ -238,7 +238,7 @@ class discussion { * * @return bool */ - public function get_locked() : int { + public function get_locked(): int { return $this->timelocked; } @@ -247,7 +247,7 @@ class discussion { * * @return bool */ - public function is_locked() : bool { + public function is_locked(): bool { return ($this->timelocked ? true : false); } @@ -267,7 +267,7 @@ class discussion { * @param post_entity $post The post to check * @return bool */ - public function is_first_post(post_entity $post) : bool { + public function is_first_post(post_entity $post): bool { return $this->get_first_post_id() === $post->get_id(); } @@ -276,7 +276,7 @@ class discussion { * * @return bool */ - public function has_started() : bool { + public function has_started(): bool { $startime = $this->get_time_start(); return empty($startime) || $startime < time(); } @@ -286,7 +286,7 @@ class discussion { * * @return bool */ - public function has_ended() : bool { + public function has_ended(): bool { $endtime = $this->get_time_end(); return !empty($endtime) && $endtime < time(); } @@ -296,7 +296,7 @@ class discussion { * * @return bool */ - public function has_group() : bool { + public function has_group(): bool { return $this->get_group_id() > 0; } @@ -317,7 +317,7 @@ class discussion { * * @return bool */ - public function is_timed_discussion() : bool { + public function is_timed_discussion(): bool { global $CFG; return !empty($CFG->forum_enabletimedposts) && @@ -329,7 +329,7 @@ class discussion { * * @return bool */ - public function is_timed_discussion_visible() : bool { + public function is_timed_discussion_visible(): bool { return !$this->is_timed_discussion() || ($this->has_started() && !$this->has_ended()); } } diff --git a/mod/forum/classes/local/entities/discussion_summary.php b/mod/forum/classes/local/entities/discussion_summary.php index facf5ffd22c..11b9067b457 100644 --- a/mod/forum/classes/local/entities/discussion_summary.php +++ b/mod/forum/classes/local/entities/discussion_summary.php @@ -71,7 +71,7 @@ class discussion_summary { * * @return discussion_entity */ - public function get_discussion() : discussion_entity { + public function get_discussion(): discussion_entity { return $this->discussion; } @@ -80,7 +80,7 @@ class discussion_summary { * * @return author_entity */ - public function get_first_post_author() : author_entity { + public function get_first_post_author(): author_entity { return $this->firstpostauthor; } @@ -89,7 +89,7 @@ class discussion_summary { * * @return author_entity */ - public function get_latest_post_author() : author_entity { + public function get_latest_post_author(): author_entity { return $this->latestpostauthor; } @@ -98,7 +98,7 @@ class discussion_summary { * * @return post_entity */ - public function get_first_post() : post_entity { + public function get_first_post(): post_entity { return $this->firstpost; } } diff --git a/mod/forum/classes/local/entities/forum.php b/mod/forum/classes/local/entities/forum.php index 53cfebdae0f..9d089298077 100644 --- a/mod/forum/classes/local/entities/forum.php +++ b/mod/forum/classes/local/entities/forum.php @@ -220,7 +220,7 @@ class forum { * * @return context */ - public function get_context() : context { + public function get_context(): context { return $this->context; } @@ -229,7 +229,7 @@ class forum { * * @return stdClass */ - public function get_course_module_record() : stdClass { + public function get_course_module_record(): stdClass { return $this->coursemodule; } @@ -238,7 +238,7 @@ class forum { * * @return int */ - public function get_effective_group_mode() : int { + public function get_effective_group_mode(): int { return $this->effectivegroupmode; } @@ -247,7 +247,7 @@ class forum { * * @return bool */ - public function is_in_group_mode() : bool { + public function is_in_group_mode(): bool { return $this->get_effective_group_mode() !== NOGROUPS; } @@ -256,7 +256,7 @@ class forum { * * @return stdClass */ - public function get_course_record() : stdClass { + public function get_course_record(): stdClass { return $this->course; } @@ -265,7 +265,7 @@ class forum { * * @return int */ - public function get_id() : int { + public function get_id(): int { return $this->id; } @@ -274,7 +274,7 @@ class forum { * * @return int */ - public function get_course_id() : int { + public function get_course_id(): int { return $this->courseid; } @@ -283,7 +283,7 @@ class forum { * * @return string */ - public function get_type() : string { + public function get_type(): string { return $this->type; } @@ -292,7 +292,7 @@ class forum { * * @return string */ - public function get_name() : string { + public function get_name(): string { return $this->name; } @@ -301,7 +301,7 @@ class forum { * * @return string */ - public function get_intro() : string { + public function get_intro(): string { return $this->intro; } @@ -310,7 +310,7 @@ class forum { * * @return int */ - public function get_intro_format() : int { + public function get_intro_format(): int { return $this->introformat; } @@ -319,7 +319,7 @@ class forum { * * @return int */ - public function get_rating_aggregate() : int { + public function get_rating_aggregate(): int { return $this->assessed; } @@ -328,7 +328,7 @@ class forum { * * @return bool */ - public function has_rating_aggregate() : bool { + public function has_rating_aggregate(): bool { return $this->get_rating_aggregate() != RATING_AGGREGATE_NONE; } @@ -337,7 +337,7 @@ class forum { * * @return int */ - public function get_assess_time_start() : int { + public function get_assess_time_start(): int { return $this->assesstimestart; } @@ -346,7 +346,7 @@ class forum { * * @return int */ - public function get_assess_time_finish() : int { + public function get_assess_time_finish(): int { return $this->assesstimefinish; } @@ -355,7 +355,7 @@ class forum { * * @return int */ - public function get_scale() : int { + public function get_scale(): int { return $this->scale; } @@ -364,7 +364,7 @@ class forum { * * @return int */ - public function get_grade_for_forum() : int { + public function get_grade_for_forum(): int { return $this->gradeforum; } @@ -391,7 +391,7 @@ class forum { * * @return int */ - public function get_max_bytes() : int { + public function get_max_bytes(): int { return $this->maxbytes; } @@ -400,7 +400,7 @@ class forum { * * @return int */ - public function get_max_attachments() : int { + public function get_max_attachments(): int { return $this->maxattachments; } @@ -409,7 +409,7 @@ class forum { * * @return int */ - public function get_subscription_mode() : int { + public function get_subscription_mode(): int { return $this->forcesubscribe; } @@ -418,7 +418,7 @@ class forum { * * @return bool */ - public function is_subscription_optional() : bool { + public function is_subscription_optional(): bool { return $this->get_subscription_mode() === FORUM_CHOOSESUBSCRIBE; } @@ -427,7 +427,7 @@ class forum { * * @return bool */ - public function is_subscription_forced() : bool { + public function is_subscription_forced(): bool { return $this->get_subscription_mode() === FORUM_FORCESUBSCRIBE; } @@ -436,7 +436,7 @@ class forum { * * @return bool */ - public function is_subscription_automatic() : bool { + public function is_subscription_automatic(): bool { return $this->get_subscription_mode() === FORUM_INITIALSUBSCRIBE; } @@ -445,7 +445,7 @@ class forum { * * @return bool */ - public function is_subscription_disabled() : bool { + public function is_subscription_disabled(): bool { return $this->get_subscription_mode() === FORUM_DISALLOWSUBSCRIBE; } @@ -454,7 +454,7 @@ class forum { * * @return int */ - public function get_tracking_type() : int { + public function get_tracking_type(): int { return $this->trackingtype; } @@ -463,7 +463,7 @@ class forum { * * @return int */ - public function get_rss_type() : int { + public function get_rss_type(): int { return $this->rsstype; } @@ -472,7 +472,7 @@ class forum { * * @return int */ - public function get_rss_articles() : int { + public function get_rss_articles(): int { return $this->rssarticles; } @@ -481,7 +481,7 @@ class forum { * * @return int */ - public function get_time_modified() : int { + public function get_time_modified(): int { return $this->timemodified; } @@ -490,7 +490,7 @@ class forum { * * @return int */ - public function get_warn_after() : int { + public function get_warn_after(): int { return $this->warnafter; } @@ -499,7 +499,7 @@ class forum { * * @return int */ - public function get_block_after() : int { + public function get_block_after(): int { return $this->blockafter; } @@ -508,7 +508,7 @@ class forum { * * @return int */ - public function get_block_period() : int { + public function get_block_period(): int { return $this->blockperiod; } @@ -517,7 +517,7 @@ class forum { * * @return bool */ - public function has_blocking_enabled() : bool { + public function has_blocking_enabled(): bool { return !empty($this->get_block_after()) && !empty($this->get_block_period()); } @@ -526,7 +526,7 @@ class forum { * * @return int */ - public function get_completion_discussions() : int { + public function get_completion_discussions(): int { return $this->completiondiscussions; } @@ -535,7 +535,7 @@ class forum { * * @return int */ - public function get_completion_replies() : int { + public function get_completion_replies(): int { return $this->completionreplies; } @@ -544,7 +544,7 @@ class forum { * * @return int */ - public function get_completion_posts() : int { + public function get_completion_posts(): int { return $this->completionposts; } @@ -553,7 +553,7 @@ class forum { * * @return bool */ - public function should_display_word_count() : bool { + public function should_display_word_count(): bool { return $this->displaywordcount; } @@ -562,7 +562,7 @@ class forum { * * @return int */ - public function get_lock_discussions_after() : int { + public function get_lock_discussions_after(): int { return $this->lockdiscussionafter; } @@ -571,7 +571,7 @@ class forum { * * @return bool */ - public function has_lock_discussions_after() : bool { + public function has_lock_discussions_after(): bool { return !empty($this->get_lock_discussions_after()); } @@ -581,7 +581,7 @@ class forum { * @param discussion_entity $discussion * @return bool */ - public function is_discussion_time_locked(discussion_entity $discussion) : bool { + public function is_discussion_time_locked(discussion_entity $discussion): bool { if (!$this->has_lock_discussions_after()) { return false; } @@ -599,7 +599,7 @@ class forum { * * @return int */ - public function get_cutoff_date() : int { + public function get_cutoff_date(): int { return $this->cutoffdate; } @@ -608,7 +608,7 @@ class forum { * * @return bool */ - public function has_cutoff_date() : bool { + public function has_cutoff_date(): bool { return !empty($this->get_cutoff_date()); } @@ -617,7 +617,7 @@ class forum { * * @return bool */ - public function is_cutoff_date_reached() : bool { + public function is_cutoff_date_reached(): bool { if ($this->has_cutoff_date() && ($this->get_cutoff_date() < time())) { return true; } @@ -630,7 +630,7 @@ class forum { * * @return int */ - public function get_due_date() : int { + public function get_due_date(): int { return $this->duedate; } @@ -639,7 +639,7 @@ class forum { * * @return bool */ - public function has_due_date() : bool { + public function has_due_date(): bool { return !empty($this->get_due_date()); } @@ -648,7 +648,7 @@ class forum { * * @return bool */ - public function is_due_date_reached() : bool { + public function is_due_date_reached(): bool { if ($this->has_due_date() && ($this->get_due_date() < time())) { return true; } @@ -662,7 +662,7 @@ class forum { * @param discussion_entity $discussion The discussion to check * @return bool */ - public function is_discussion_locked(discussion_entity $discussion) : bool { + public function is_discussion_locked(discussion_entity $discussion): bool { if ($discussion->is_locked()) { return true; } diff --git a/mod/forum/classes/local/entities/post.php b/mod/forum/classes/local/entities/post.php index 119e1d02cd2..4ca4b266476 100644 --- a/mod/forum/classes/local/entities/post.php +++ b/mod/forum/classes/local/entities/post.php @@ -137,7 +137,7 @@ class post { * * @return int */ - public function get_id() : int { + public function get_id(): int { return $this->id; } @@ -146,7 +146,7 @@ class post { * * @return int */ - public function get_discussion_id() : int { + public function get_discussion_id(): int { return $this->discussionid; } @@ -155,7 +155,7 @@ class post { * * @return int */ - public function get_parent_id() : int { + public function get_parent_id(): int { return $this->parentid; } @@ -164,7 +164,7 @@ class post { * * @return bool */ - public function has_parent() : bool { + public function has_parent(): bool { return $this->get_parent_id() > 0; } @@ -173,7 +173,7 @@ class post { * * @return int */ - public function get_author_id() : int { + public function get_author_id(): int { return $this->authorid; } @@ -182,7 +182,7 @@ class post { * * @return int */ - public function get_time_created() : int { + public function get_time_created(): int { return $this->timecreated; } @@ -191,7 +191,7 @@ class post { * * @return int */ - public function get_time_modified() : int { + public function get_time_modified(): int { return $this->timemodified; } @@ -200,7 +200,7 @@ class post { * * @return bool */ - public function has_been_mailed() : bool { + public function has_been_mailed(): bool { return $this->mailed; } @@ -209,7 +209,7 @@ class post { * * @return string */ - public function get_subject() : string { + public function get_subject(): string { return $this->subject; } @@ -218,7 +218,7 @@ class post { * * @return string */ - public function get_message() : string { + public function get_message(): string { return $this->message; } @@ -227,7 +227,7 @@ class post { * * @return int */ - public function get_message_format() : int { + public function get_message_format(): int { return $this->messageformat; } @@ -236,7 +236,7 @@ class post { * * @return bool */ - public function is_message_trusted() : bool { + public function is_message_trusted(): bool { return $this->messagetrust; } @@ -245,7 +245,7 @@ class post { * * @return bool */ - public function has_attachments() : bool { + public function has_attachments(): bool { return $this->hasattachments; } @@ -254,7 +254,7 @@ class post { * * @return int */ - public function get_total_score() : int { + public function get_total_score(): int { return $this->totalscore; } @@ -263,7 +263,7 @@ class post { * * @return bool */ - public function should_mail_now() : bool { + public function should_mail_now(): bool { return $this->mailnow; } @@ -272,7 +272,7 @@ class post { * * @return bool */ - public function is_deleted() : bool { + public function is_deleted(): bool { return $this->deleted; } @@ -281,7 +281,7 @@ class post { * * @return bool */ - public function is_private_reply() : bool { + public function is_private_reply(): bool { return !empty($this->privatereplyto); } @@ -290,7 +290,7 @@ class post { * * @return int */ - public function get_private_reply_recipient_id() : int { + public function get_private_reply_recipient_id(): int { return $this->privatereplyto; } @@ -300,7 +300,7 @@ class post { * * @return int */ - public function get_age() : int { + public function get_age(): int { return time() - $this->get_time_created(); } @@ -310,7 +310,7 @@ class post { * @param stdClass $user The user to check. * @return bool */ - public function is_owned_by_user(stdClass $user) : bool { + public function is_owned_by_user(stdClass $user): bool { return $this->get_author_id() == $user->id; } @@ -320,7 +320,7 @@ class post { * @param stdClass $user The user to check. * @return bool */ - public function is_private_reply_intended_for_user(stdClass $user) : bool { + public function is_private_reply_intended_for_user(stdClass $user): bool { return $this->get_private_reply_recipient_id() == $user->id; } @@ -329,7 +329,7 @@ class post { * * @return int|null */ - public function get_wordcount() : ?int { + public function get_wordcount(): ?int { return $this->wordcount; } @@ -338,7 +338,7 @@ class post { * * @return int|null */ - public function get_charcount() : ?int { + public function get_charcount(): ?int { return $this->charcount; } @@ -348,7 +348,7 @@ class post { * @param \stdClass $record A record ready to be inserted / updated in DB. * @return void. */ - public static function add_message_counts(\stdClass $record) : void { + public static function add_message_counts(\stdClass $record): void { if (!empty($record->message)) { $record->wordcount = count_words($record->message, $record->messageformat); $record->charcount = count_letters($record->message, $record->messageformat); diff --git a/mod/forum/classes/local/entities/post_read_receipt_collection.php b/mod/forum/classes/local/entities/post_read_receipt_collection.php index d51b66fdc62..16defb38a53 100644 --- a/mod/forum/classes/local/entities/post_read_receipt_collection.php +++ b/mod/forum/classes/local/entities/post_read_receipt_collection.php @@ -65,7 +65,7 @@ class post_read_receipt_collection { * @param post_entity $post The post to check * @return bool */ - public function has_user_read_post(stdClass $user, post_entity $post) : bool { + public function has_user_read_post(stdClass $user, post_entity $post): bool { global $CFG; $isoldpost = ($post->get_time_modified() < (time() - ($CFG->forum_oldpostdays * 24 * 3600))); diff --git a/mod/forum/classes/local/entities/sorter.php b/mod/forum/classes/local/entities/sorter.php index 688bfb763a6..b2fb9d8a840 100644 --- a/mod/forum/classes/local/entities/sorter.php +++ b/mod/forum/classes/local/entities/sorter.php @@ -89,7 +89,7 @@ class sorter { * @param array $items The list of items to sort. * @return array */ - public function sort_into_children(array $items) : array { + public function sort_into_children(array $items): array { $ids = array_reduce($items, function($carry, $item) { $carry[($this->getid)($item)] = true; return $carry; @@ -139,7 +139,7 @@ class sorter { * @param array $items Items in the data structure returned by "sort_into_children" * @return array A flat array. */ - public function flatten_children(array $items) : array { + public function flatten_children(array $items): array { $result = []; foreach ($items as [$item, $children]) { diff --git a/mod/forum/classes/local/exporters/forum.php b/mod/forum/classes/local/exporters/forum.php index 59260b17ba7..ef8e547cf67 100644 --- a/mod/forum/classes/local/exporters/forum.php +++ b/mod/forum/classes/local/exporters/forum.php @@ -187,7 +187,7 @@ class forum extends exporter { * * @return stdClass */ - private function get_forum_record() : stdClass { + private function get_forum_record(): stdClass { $forumdbdatamapper = $this->related['legacydatamapperfactory']->get_forum_data_mapper(); return $forumdbdatamapper->to_legacy_object($this->forum); } diff --git a/mod/forum/classes/local/exporters/post.php b/mod/forum/classes/local/exporters/post.php index a336f551740..c80a7607aa7 100644 --- a/mod/forum/classes/local/exporters/post.php +++ b/mod/forum/classes/local/exporters/post.php @@ -545,7 +545,7 @@ class post extends exporter { * @param post_entity $post The post * @return string */ - private function get_message(post_entity $post) : string { + private function get_message(post_entity $post): string { global $CFG; $message = $post->get_message(); @@ -574,7 +574,7 @@ class post extends exporter { * @param bool $canexport If the user can export the post (relates to portfolios not exporters like this class) * @return array */ - private function export_attachments(array $attachments, post_entity $post, renderer_base $output, bool $canexport) : array { + private function export_attachments(array $attachments, post_entity $post, renderer_base $output, bool $canexport): array { global $CFG; $urlfactory = $this->related['urlfactory']; @@ -630,7 +630,7 @@ class post extends exporter { * @param renderer_base $output Renderer base * @return array */ - private function export_inline_attachments(array $inlineattachments, post_entity $post, renderer_base $output) : array { + private function export_inline_attachments(array $inlineattachments, post_entity $post, renderer_base $output): array { return array_map(function($attachment) use ( $output, @@ -647,7 +647,7 @@ class post extends exporter { * @param core_tag_tag[] $tags List of tags to export * @return array */ - private function export_tags(array $tags) : array { + private function export_tags(array $tags): array { $user = $this->related['user']; $context = $this->related['context']; $capabilitymanager = $this->related['capabilitymanager']; @@ -675,7 +675,7 @@ class post extends exporter { * @param int $timecreated The post time created timestamp if it's to be displayed * @return string */ - private function get_author_subheading_html(stdClass $exportedauthor, int $timecreated) : string { + private function get_author_subheading_html(stdClass $exportedauthor, int $timecreated): string { $fullname = $exportedauthor->fullname; $profileurl = $exportedauthor->urls['profile'] ?? null; $name = $profileurl ? "{$fullname}" : $fullname; diff --git a/mod/forum/classes/local/factories/builder.php b/mod/forum/classes/local/factories/builder.php index 8c631778c5d..8de4b3e08a3 100644 --- a/mod/forum/classes/local/factories/builder.php +++ b/mod/forum/classes/local/factories/builder.php @@ -85,7 +85,7 @@ class builder { * * @return exported_posts_builder */ - public function get_exported_posts_builder() : exported_posts_builder { + public function get_exported_posts_builder(): exported_posts_builder { return new exported_posts_builder( $this->rendererbase, $this->legacydatamapperfactory, @@ -100,7 +100,7 @@ class builder { * * @return exported_discussion_summaries_builder */ - public function get_exported_discussion_summaries_builder() : exported_discussion_summaries_builder { + public function get_exported_discussion_summaries_builder(): exported_discussion_summaries_builder { return new exported_discussion_summaries_builder( $this->rendererbase, $this->legacydatamapperfactory, @@ -115,7 +115,7 @@ class builder { * * @return exported_discussion_summaries_builder */ - public function get_exported_discussion_builder() : exported_discussion_builder { + public function get_exported_discussion_builder(): exported_discussion_builder { return new exported_discussion_builder( $this->rendererbase, $this->legacydatamapperfactory, diff --git a/mod/forum/classes/local/factories/entity.php b/mod/forum/classes/local/factories/entity.php index 9ed4c5498ae..0f63dea2875 100644 --- a/mod/forum/classes/local/factories/entity.php +++ b/mod/forum/classes/local/factories/entity.php @@ -63,7 +63,7 @@ class entity { context $context, stdClass $coursemodule, stdClass $course - ) : forum_entity { + ): forum_entity { // Note: cm_info::create loads a cm_info in the context of the current user which // creates hidden dependency on the logged in user (very bad) however it's the best // option to load some data we need which doesn't require the logged in user. @@ -114,7 +114,7 @@ class entity { * @param stdClass $record Discussion record * @return discussion_entity */ - public function get_discussion_from_stdclass(stdClass $record) : discussion_entity { + public function get_discussion_from_stdclass(stdClass $record): discussion_entity { return new discussion_entity( $record->id, $record->course, @@ -139,7 +139,7 @@ class entity { * @param stdClass $record The post record * @return post_entity */ - public function get_post_from_stdclass(stdClass $record) : post_entity { + public function get_post_from_stdclass(stdClass $record): post_entity { return new post_entity( $record->id, $record->discussion, @@ -168,7 +168,7 @@ class entity { * @param stdClass $record The user record * @return author_entity */ - public function get_author_from_stdclass(stdClass $record) : author_entity { + public function get_author_from_stdclass(stdClass $record): author_entity { return new author_entity( $record->id, $record->picture, @@ -199,7 +199,7 @@ class entity { stdClass $firstpost, stdClass $firstpostauthor, stdClass $latestpostauthor - ) : discussion_summary_entity { + ): discussion_summary_entity { $firstpostauthorentity = $this->get_author_from_stdclass($firstpostauthor); return new discussion_summary_entity( @@ -216,7 +216,7 @@ class entity { * @param array $records A list of read receipt records. * @return post_read_receipt_collection_entity */ - public function get_post_read_receipt_collection_from_stdclasses(array $records) : post_read_receipt_collection_entity { + public function get_post_read_receipt_collection_from_stdclasses(array $records): post_read_receipt_collection_entity { return new post_read_receipt_collection_entity($records); } @@ -225,7 +225,7 @@ class entity { * * @return sorter_entity */ - public function get_posts_sorter() : sorter_entity { + public function get_posts_sorter(): sorter_entity { return new sorter_entity( // Get id function for a post_entity. function(post_entity $post) { @@ -243,7 +243,7 @@ class entity { * * @return sorter_entity */ - public function get_exported_posts_sorter() : sorter_entity { + public function get_exported_posts_sorter(): sorter_entity { return new sorter_entity( // Get id function for an exported post. function(stdClass $post) { diff --git a/mod/forum/classes/local/factories/exporter.php b/mod/forum/classes/local/factories/exporter.php index 38bc803fa99..58df6c4e25c 100644 --- a/mod/forum/classes/local/factories/exporter.php +++ b/mod/forum/classes/local/factories/exporter.php @@ -93,7 +93,7 @@ class exporter { stdClass $user, forum_entity $forum, ?int $currentgroup - ) : forum_exporter { + ): forum_exporter { return new forum_exporter($forum, [ 'legacydatamapperfactory' => $this->legacydatamapperfactory, 'capabilitymanager' => $this->managerfactory->get_capability_manager($forum), @@ -109,7 +109,7 @@ class exporter { * * @return array */ - public static function get_forum_export_structure() : array { + public static function get_forum_export_structure(): array { return forum_exporter::read_properties_definition(); } @@ -128,7 +128,7 @@ class exporter { discussion_entity $discussion, array $groupsbyid = [], array $favouriteids = [] - ) : discussion_exporter { + ): discussion_exporter { return new discussion_exporter($discussion, [ 'context' => $forum->get_context(), 'forum' => $forum, @@ -178,7 +178,7 @@ class exporter { array $postauthorcontextids = [], array $favourites = [], array $latestauthors = [] - ) : discussion_summaries_exporter { + ): discussion_summaries_exporter { return new discussion_summaries_exporter( $discussions, $groupsbyid, @@ -241,7 +241,7 @@ class exporter { array $ratingbypostid = [], bool $includehtml = false, array $inlineattachmentsbypostid = [] - ) : posts_exporter { + ): posts_exporter { return new posts_exporter( $posts, $authorsbyid, diff --git a/mod/forum/classes/local/factories/legacy_data_mapper.php b/mod/forum/classes/local/factories/legacy_data_mapper.php index 816e25af26a..864f02372b5 100644 --- a/mod/forum/classes/local/factories/legacy_data_mapper.php +++ b/mod/forum/classes/local/factories/legacy_data_mapper.php @@ -47,7 +47,7 @@ class legacy_data_mapper { * * @return forum_data_mapper */ - public function get_forum_data_mapper() : forum_data_mapper { + public function get_forum_data_mapper(): forum_data_mapper { return new forum_data_mapper(); } @@ -56,7 +56,7 @@ class legacy_data_mapper { * * @return discussion_data_mapper */ - public function get_discussion_data_mapper() : discussion_data_mapper { + public function get_discussion_data_mapper(): discussion_data_mapper { return new discussion_data_mapper(); } @@ -65,7 +65,7 @@ class legacy_data_mapper { * * @return post_data_mapper */ - public function get_post_data_mapper() : post_data_mapper { + public function get_post_data_mapper(): post_data_mapper { return new post_data_mapper(); } @@ -74,7 +74,7 @@ class legacy_data_mapper { * * @return author_data_mapper */ - public function get_author_data_mapper() : author_data_mapper { + public function get_author_data_mapper(): author_data_mapper { return new author_data_mapper(); } diff --git a/mod/forum/classes/local/factories/manager.php b/mod/forum/classes/local/factories/manager.php index 9abce1147c8..4f6013427c5 100644 --- a/mod/forum/classes/local/factories/manager.php +++ b/mod/forum/classes/local/factories/manager.php @@ -75,7 +75,7 @@ class manager { * * @return rating_manager */ - public function get_rating_manager() : rating_manager { + public function get_rating_manager(): rating_manager { return new rating_manager(); } } diff --git a/mod/forum/classes/local/factories/renderer.php b/mod/forum/classes/local/factories/renderer.php index 78c2b35a3ea..737662bf47f 100644 --- a/mod/forum/classes/local/factories/renderer.php +++ b/mod/forum/classes/local/factories/renderer.php @@ -116,7 +116,7 @@ class renderer { forum_entity $forum, discussion_entity $discussion, int $displaymode - ) : discussion_renderer { + ): discussion_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $ratingmanager = $this->managerfactory->get_rating_manager(); @@ -158,7 +158,7 @@ class renderer { * * @return posts_renderer */ - public function get_posts_renderer() : posts_renderer { + public function get_posts_renderer(): posts_renderer { return new posts_renderer( $this->rendererbase, $this->builderfactory->get_exported_posts_builder(), @@ -173,7 +173,7 @@ class renderer { * @param bool $readonly Should the posts include the actions to reply, delete, etc? * @return posts_renderer */ - public function get_single_discussion_posts_renderer(int $displaymode = null, bool $readonly = false) : posts_renderer { + public function get_single_discussion_posts_renderer(int $displaymode = null, bool $readonly = false): posts_renderer { $exportedpostssorter = $this->entityfactory->get_exported_posts_sorter(); switch ($displaymode) { @@ -312,7 +312,7 @@ class renderer { * @param string[] $searchterms The search terms to be highlighted in the posts * @return posts_renderer */ - public function get_posts_search_results_renderer(array $searchterms) : posts_renderer { + public function get_posts_search_results_renderer(array $searchterms): posts_renderer { $urlfactory = $this->urlfactory; return new posts_renderer( @@ -387,7 +387,7 @@ class renderer { * @param bool $addlinkstocontext Should links to the course, forum, and discussion be included? * @return posts_renderer */ - public function get_user_forum_posts_report_renderer(bool $addlinkstocontext) : posts_renderer { + public function get_user_forum_posts_report_renderer(bool $addlinkstocontext): posts_renderer { $urlfactory = $this->urlfactory; return new posts_renderer( @@ -427,7 +427,7 @@ class renderer { */ public function get_discussion_list_renderer( forum_entity $forum - ) : discussion_list_renderer { + ): discussion_list_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $rendererbase = $this->rendererbase; @@ -482,7 +482,7 @@ class renderer { private function get_detailed_discussion_list_renderer( forum_entity $forum, string $template - ) : discussion_list_renderer { + ): discussion_list_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $rendererbase = $this->rendererbase; @@ -559,7 +559,7 @@ class renderer { */ public function get_blog_discussion_list_renderer( forum_entity $forum - ) : discussion_list_renderer { + ): discussion_list_renderer { return $this->get_detailed_discussion_list_renderer($forum, 'mod_forum/blog_discussion_list'); } @@ -571,7 +571,7 @@ class renderer { */ public function get_social_discussion_list_renderer( forum_entity $forum - ) : discussion_list_renderer { + ): discussion_list_renderer { return $this->get_detailed_discussion_list_renderer($forum, 'mod_forum/social_discussion_list'); } @@ -583,7 +583,7 @@ class renderer { */ public function get_frontpage_news_discussion_list_renderer( forum_entity $forum - ) : discussion_list_renderer { + ): discussion_list_renderer { return $this->get_detailed_discussion_list_renderer($forum, 'mod_forum/frontpage_social_discussion_list'); } @@ -601,7 +601,7 @@ class renderer { discussion_entity $discussion, bool $hasmultiplediscussions, int $displaymode - ) : discussion_renderer { + ): discussion_renderer { $capabilitymanager = $this->managerfactory->get_capability_manager($forum); $ratingmanager = $this->managerfactory->get_rating_manager(); diff --git a/mod/forum/classes/local/factories/url.php b/mod/forum/classes/local/factories/url.php index caae3d711ef..cfef7da3375 100644 --- a/mod/forum/classes/local/factories/url.php +++ b/mod/forum/classes/local/factories/url.php @@ -62,7 +62,7 @@ class url { * @param int $courseid The course id * @return moodle_url */ - public function get_course_url_from_courseid(int $courseid) : moodle_url { + public function get_course_url_from_courseid(int $courseid): moodle_url { return new moodle_url('/course/view.php', [ 'id' => $courseid, ]); @@ -74,7 +74,7 @@ class url { * @param forum_entity $forum The forum entity * @return moodle_url */ - public function get_course_url_from_forum(forum_entity $forum) : moodle_url { + public function get_course_url_from_forum(forum_entity $forum): moodle_url { return $this->get_course_url_from_courseid($forum->get_course_id()); } @@ -84,7 +84,7 @@ class url { * @param forum_entity $forum The forum entity * @return moodle_url */ - public function get_discussion_create_url(forum_entity $forum) : moodle_url { + public function get_discussion_create_url(forum_entity $forum): moodle_url { return new moodle_url('/mod/forum/post.php', [ 'forum' => $forum->get_id(), ]); @@ -99,7 +99,7 @@ class url { * @return moodle_url */ public function get_forum_view_url_from_forum(forum_entity $forum, ?int $pageno = null, - ?int $sortorder = null) : moodle_url { + ?int $sortorder = null): moodle_url { return $this->get_forum_view_url_from_course_module_id($forum->get_course_module_record()->id, $pageno, $sortorder); } @@ -113,7 +113,7 @@ class url { * @return moodle_url */ public function get_forum_view_url_from_course_module_id(int $coursemoduleid, ?int $pageno = null, - ?int $sortorder = null) : moodle_url { + ?int $sortorder = null): moodle_url { $url = new moodle_url('/mod/forum/view.php', [ 'id' => $coursemoduleid, @@ -136,7 +136,7 @@ class url { * @param int $discussionid The discussion id * @return moodle_url */ - public function get_discussion_view_url_from_discussion_id(int $discussionid) : moodle_url { + public function get_discussion_view_url_from_discussion_id(int $discussionid): moodle_url { return new moodle_url('/mod/forum/discuss.php', [ 'd' => $discussionid ]); @@ -148,7 +148,7 @@ class url { * @param discussion_entity $discussion The discussion * @return moodle_url */ - public function get_discussion_view_url_from_discussion(discussion_entity $discussion) : moodle_url { + public function get_discussion_view_url_from_discussion(discussion_entity $discussion): moodle_url { return $this->get_discussion_view_url_from_discussion_id($discussion->get_id()); } @@ -187,7 +187,7 @@ class url { * @param post_entity $post The post * @return moodle_url */ - public function get_discussion_view_url_from_post(post_entity $post) : moodle_url { + public function get_discussion_view_url_from_post(post_entity $post): moodle_url { return $this->get_discussion_view_url_from_discussion_id($post->get_discussion_id()); } @@ -198,7 +198,7 @@ class url { * @param int $postid The post id * @return moodle_url */ - public function get_view_post_url_from_post_id(int $discussionid, int $postid) : moodle_url { + public function get_view_post_url_from_post_id(int $discussionid, int $postid): moodle_url { $url = $this->get_discussion_view_url_from_discussion_id($discussionid); $url->set_anchor('p' . $postid); return $url; @@ -210,7 +210,7 @@ class url { * @param post_entity $post The post * @return moodle_url */ - public function get_view_post_url_from_post(post_entity $post) : moodle_url { + public function get_view_post_url_from_post(post_entity $post): moodle_url { return $this->get_view_post_url_from_post_id($post->get_discussion_id(), $post->get_id()); } @@ -222,7 +222,7 @@ class url { * @param int $postid The post id * @return moodle_url */ - public function get_view_isolated_post_url_from_post_id(int $discussionid, int $postid) : moodle_url { + public function get_view_isolated_post_url_from_post_id(int $discussionid, int $postid): moodle_url { $url = $this->get_discussion_view_url_from_discussion_id($discussionid); $url->params(['parent' => $postid]); return $url; @@ -235,7 +235,7 @@ class url { * @param post_entity $post The post * @return moodle_url */ - public function get_view_isolated_post_url_from_post(post_entity $post) : moodle_url { + public function get_view_isolated_post_url_from_post(post_entity $post): moodle_url { return $this->get_view_isolated_post_url_from_post_id($post->get_discussion_id(), $post->get_id()); } @@ -246,7 +246,7 @@ class url { * @param post_entity $post The post * @return moodle_url */ - public function get_edit_post_url_from_post(forum_entity $forum, post_entity $post) : moodle_url { + public function get_edit_post_url_from_post(forum_entity $forum, post_entity $post): moodle_url { if ($forum->get_type() == 'single' && !$post->has_parent()) { return new moodle_url('/course/modedit.php', [ 'update' => $forum->get_course_module_record()->id, @@ -266,7 +266,7 @@ class url { * @param post_entity $post The post * @return moodle_url */ - public function get_split_discussion_at_post_url_from_post(post_entity $post) : moodle_url { + public function get_split_discussion_at_post_url_from_post(post_entity $post): moodle_url { return new moodle_url('/mod/forum/post.php', [ 'prune' => $post->get_id() ]); @@ -278,7 +278,7 @@ class url { * @param post_entity $post The post * @return moodle_url */ - public function get_delete_post_url_from_post(post_entity $post) : moodle_url { + public function get_delete_post_url_from_post(post_entity $post): moodle_url { return new moodle_url('/mod/forum/post.php', [ 'delete' => $post->get_id() ]); @@ -290,7 +290,7 @@ class url { * @param post_entity $post The post * @return moodle_url */ - public function get_reply_to_post_url_from_post(post_entity $post) : moodle_url { + public function get_reply_to_post_url_from_post(post_entity $post): moodle_url { return new moodle_url('/mod/forum/post.php#mformforum', [ 'reply' => $post->get_id() ]); @@ -302,7 +302,7 @@ class url { * @param post_entity $post The post * @return moodle_url */ - public function get_export_post_url_from_post(post_entity $post) : ?moodle_url { + public function get_export_post_url_from_post(post_entity $post): ?moodle_url { global $CFG; require_once($CFG->libdir . '/portfoliolib.php'); @@ -325,7 +325,7 @@ class url { * @param int $displaymode The display mode to show the forum in after marking as read * @return moodle_url */ - public function get_mark_post_as_read_url_from_post(post_entity $post, int $displaymode = FORUM_MODE_THREADED) : moodle_url { + public function get_mark_post_as_read_url_from_post(post_entity $post, int $displaymode = FORUM_MODE_THREADED): moodle_url { $params = [ 'd' => $post->get_discussion_id(), 'postid' => $post->get_id(), @@ -350,7 +350,7 @@ class url { * @param int $displaymode The display mode to show the forum in after marking as unread * @return moodle_url */ - public function get_mark_post_as_unread_url_from_post(post_entity $post, int $displaymode = FORUM_MODE_THREADED) : moodle_url { + public function get_mark_post_as_unread_url_from_post(post_entity $post, int $displaymode = FORUM_MODE_THREADED): moodle_url { $params = [ 'd' => $post->get_discussion_id(), 'postid' => $post->get_id(), @@ -375,7 +375,7 @@ class url { * @param stored_file $attachment * @return moodle_url|null */ - public function get_export_attachment_url_from_post_and_attachment(post_entity $post, stored_file $attachment) : ?moodle_url { + public function get_export_attachment_url_from_post_and_attachment(post_entity $post, stored_file $attachment): ?moodle_url { global $CFG; require_once($CFG->libdir . '/portfoliolib.php'); @@ -397,7 +397,7 @@ class url { * @param int $courseid The course id * @return moodle_url */ - public function get_author_profile_url(author_entity $author, int $courseid) : moodle_url { + public function get_author_profile_url(author_entity $author, int $courseid): moodle_url { return new moodle_url('/user/view.php', [ 'id' => $author->get_id(), 'course' => $courseid @@ -417,7 +417,7 @@ class url { author_entity $author, int $authorcontextid = null, int $size = 100 - ) : moodle_url { + ): moodle_url { global $PAGE; $datamapper = $this->legacydatamapperfactory->get_author_data_mapper(); @@ -435,7 +435,7 @@ class url { * @param \stdClass $group The group * @return moodle_url */ - public function get_author_group_url(\stdClass $group) : moodle_url { + public function get_author_group_url(\stdClass $group): moodle_url { return new moodle_url('/user/index.php', [ 'id' => $group->courseid, 'group' => $group->id @@ -451,7 +451,7 @@ class url { public function get_mark_discussion_as_read_url_from_discussion( forum_entity $forum, discussion_entity $discussion - ) : moodle_url { + ): moodle_url { return new moodle_url('/mod/forum/markposts.php', [ 'f' => $discussion->get_forum_id(), 'd' => $discussion->get_id(), @@ -467,7 +467,7 @@ class url { * @param forum_entity $forum The forum that the discussions belong to * @return moodle_url */ - public function get_mark_all_discussions_as_read_url(forum_entity $forum) : moodle_url { + public function get_mark_all_discussions_as_read_url(forum_entity $forum): moodle_url { return new moodle_url('/mod/forum/markposts.php', [ 'f' => $forum->get_id(), 'mark' => 'read', @@ -482,7 +482,7 @@ class url { * @param discussion_entity $discussion The discussion * @return moodle_url */ - public function get_discussion_subscribe_url(discussion_entity $discussion) : moodle_url { + public function get_discussion_subscribe_url(discussion_entity $discussion): moodle_url { return new moodle_url('/mod/forum/subscribe.php', [ 'sesskey' => sesskey(), 'id' => $discussion->get_forum_id(), @@ -497,7 +497,7 @@ class url { * @return moodle_url * @throws \moodle_exception */ - public function get_pin_discussion_url_from_discussion(discussion_entity $discussion) : moodle_url { + public function get_pin_discussion_url_from_discussion(discussion_entity $discussion): moodle_url { return new moodle_url('discuss.php', [ 'sesskey' => sesskey(), 'd' => $discussion->get_id(), diff --git a/mod/forum/classes/local/factories/vault.php b/mod/forum/classes/local/factories/vault.php index 1f1f9e2eaa1..ac3525f81f2 100644 --- a/mod/forum/classes/local/factories/vault.php +++ b/mod/forum/classes/local/factories/vault.php @@ -77,7 +77,7 @@ class vault { * * @return forum_vault */ - public function get_forum_vault() : forum_vault { + public function get_forum_vault(): forum_vault { return new forum_vault( $this->db, $this->entityfactory, @@ -90,7 +90,7 @@ class vault { * * @return discussion_vault */ - public function get_discussion_vault() : discussion_vault { + public function get_discussion_vault(): discussion_vault { return new discussion_vault( $this->db, $this->entityfactory, @@ -103,7 +103,7 @@ class vault { * * @return discussion_list_vault */ - public function get_discussions_in_forum_vault() : discussion_list_vault { + public function get_discussions_in_forum_vault(): discussion_list_vault { return new discussion_list_vault( $this->db, $this->entityfactory, @@ -116,7 +116,7 @@ class vault { * * @return post_vault */ - public function get_post_vault() : post_vault { + public function get_post_vault(): post_vault { return new post_vault( $this->db, $this->entityfactory, @@ -129,7 +129,7 @@ class vault { * * @return author_vault */ - public function get_author_vault() : author_vault { + public function get_author_vault(): author_vault { return new author_vault( $this->db, $this->entityfactory, @@ -142,7 +142,7 @@ class vault { * * @return post_read_receipt_collection_vault */ - public function get_post_read_receipt_collection_vault() : post_read_receipt_collection_vault { + public function get_post_read_receipt_collection_vault(): post_read_receipt_collection_vault { return new post_read_receipt_collection_vault( $this->db, $this->entityfactory, @@ -155,7 +155,7 @@ class vault { * * @return post_attachment_vault */ - public function get_post_attachment_vault() : post_attachment_vault { + public function get_post_attachment_vault(): post_attachment_vault { return new post_attachment_vault( $this->filestorage ); diff --git a/mod/forum/classes/local/managers/capability.php b/mod/forum/classes/local/managers/capability.php index 0af23db8e60..bbcb8cb4684 100644 --- a/mod/forum/classes/local/managers/capability.php +++ b/mod/forum/classes/local/managers/capability.php @@ -92,7 +92,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_subscribe_to_forum(stdClass $user) : bool { + public function can_subscribe_to_forum(stdClass $user): bool { if ($this->forum->get_type() == 'single') { return false; } @@ -108,7 +108,7 @@ class capability { * @param int|null $groupid The current activity group id * @return bool */ - public function can_create_discussions(stdClass $user, int $groupid = null) : bool { + public function can_create_discussions(stdClass $user, int $groupid = null): bool { if (isguestuser($user) or !isloggedin()) { return false; } @@ -159,7 +159,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_access_all_groups(stdClass $user) : bool { + public function can_access_all_groups(stdClass $user): bool { return has_capability('moodle/site:accessallgroups', $this->get_context(), $user); } @@ -170,7 +170,7 @@ class capability { * @param int $groupid The id of the group that the forum is set to * @return bool */ - public function can_access_group(stdClass $user, int $groupid) : bool { + public function can_access_group(stdClass $user, int $groupid): bool { if ($this->can_access_all_groups($user)) { // This user has access to all groups. return true; @@ -188,7 +188,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_post_to_my_groups(stdClass $user) : bool { + public function can_post_to_my_groups(stdClass $user): bool { return has_capability('mod/forum:canposttomygroups', $this->get_context(), $user); } @@ -198,7 +198,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_view_discussions(stdClass $user) : bool { + public function can_view_discussions(stdClass $user): bool { return has_capability('mod/forum:viewdiscussion', $this->get_context(), $user); } @@ -208,7 +208,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_move_discussions(stdClass $user) : bool { + public function can_move_discussions(stdClass $user): bool { $forum = $this->get_forum(); return $forum->get_type() !== 'single' && has_capability('mod/forum:movediscussions', $this->get_context(), $user); @@ -220,7 +220,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_pin_discussions(stdClass $user) : bool { + public function can_pin_discussions(stdClass $user): bool { return $this->forum->get_type() !== 'single' && has_capability('mod/forum:pindiscussions', $this->get_context(), $user); } @@ -231,7 +231,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_split_discussions(stdClass $user) : bool { + public function can_split_discussions(stdClass $user): bool { $forum = $this->get_forum(); return $forum->get_type() !== 'single' && has_capability('mod/forum:splitdiscussions', $this->get_context(), $user); } @@ -242,7 +242,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_export_discussions(stdClass $user) : bool { + public function can_export_discussions(stdClass $user): bool { global $CFG; return $CFG->enableportfolios && has_capability('mod/forum:exportdiscussion', $this->get_context(), $user); } @@ -253,7 +253,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_manually_control_post_read_status(stdClass $user) : bool { + public function can_manually_control_post_read_status(stdClass $user): bool { global $CFG; return $CFG->forum_usermarksread && isloggedin() && forum_tp_is_tracked($this->get_forum_record(), $user); } @@ -265,7 +265,7 @@ class capability { * @param discussion_entity $discussion The discussion to check * @return bool */ - public function must_post_before_viewing_discussion(stdClass $user, discussion_entity $discussion) : bool { + public function must_post_before_viewing_discussion(stdClass $user, discussion_entity $discussion): bool { $forum = $this->get_forum(); if ($forum->get_type() === 'qanda') { @@ -286,7 +286,7 @@ class capability { * @param discussion_entity $discussion The discussion to check * @return bool */ - public function can_subscribe_to_discussion(stdClass $user, discussion_entity $discussion) : bool { + public function can_subscribe_to_discussion(stdClass $user, discussion_entity $discussion): bool { return $this->can_subscribe_to_forum($user); } @@ -297,7 +297,7 @@ class capability { * @param discussion_entity $discussion The discussion to check * @return bool */ - public function can_move_discussion(stdClass $user, discussion_entity $discussion) : bool { + public function can_move_discussion(stdClass $user, discussion_entity $discussion): bool { return $this->can_move_discussions($user); } @@ -308,7 +308,7 @@ class capability { * @param discussion_entity $discussion The discussion to check * @return bool */ - public function can_pin_discussion(stdClass $user, discussion_entity $discussion) : bool { + public function can_pin_discussion(stdClass $user, discussion_entity $discussion): bool { return $this->can_pin_discussions($user); } @@ -319,7 +319,7 @@ class capability { * @param discussion_entity $discussion The discussion to check * @return bool */ - public function can_post_in_discussion(stdClass $user, discussion_entity $discussion) : bool { + public function can_post_in_discussion(stdClass $user, discussion_entity $discussion): bool { $forum = $this->get_forum(); $forumrecord = $this->get_forum_record(); @@ -343,7 +343,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_favourite_discussion(stdClass $user) : bool { + public function can_favourite_discussion(stdClass $user): bool { $context = $this->get_context(); return has_capability('mod/forum:cantogglefavourite', $context, $user); } @@ -355,7 +355,7 @@ class capability { * @param discussion_entity $discussion The discussion to check * @return bool */ - public function can_view_discussion(stdClass $user, discussion_entity $discussion) : bool { + public function can_view_discussion(stdClass $user, discussion_entity $discussion): bool { $forumrecord = $this->get_forum_record(); $discussionrecord = $this->get_discussion_record($discussion); $context = $this->get_context(); @@ -371,7 +371,7 @@ class capability { * @param post_entity $post The post the user wants to view * @return bool */ - public function can_view_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { + public function can_view_post(stdClass $user, discussion_entity $discussion, post_entity $post): bool { if (!$this->can_view_post_shell($user, $post)) { return false; } @@ -404,7 +404,7 @@ class capability { * @return bool * */ - public function can_view_post_shell(stdClass $user, post_entity $post) : bool { + public function can_view_post_shell(stdClass $user, post_entity $post): bool { if ($post->is_owned_by_user($user)) { return true; } @@ -426,7 +426,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_view_any_private_reply(stdClass $user) : bool { + public function can_view_any_private_reply(stdClass $user): bool { return has_capability('mod/forum:readprivatereplies', $this->get_context(), $user); } @@ -438,7 +438,7 @@ class capability { * @param post_entity $post The post the user wants to edit * @return bool */ - public function can_edit_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { + public function can_edit_post(stdClass $user, discussion_entity $discussion, post_entity $post): bool { global $CFG; $context = $this->get_context(); @@ -472,7 +472,7 @@ class capability { * @throws moodle_exception */ public function validate_delete_post(stdClass $user, discussion_entity $discussion, post_entity $post, - bool $hasreplies = false) : void { + bool $hasreplies = false): void { global $CFG; $forum = $this->get_forum(); @@ -513,7 +513,7 @@ class capability { * @return bool */ public function can_delete_post(stdClass $user, discussion_entity $discussion, post_entity $post, - bool $hasreplies = false) : bool { + bool $hasreplies = false): bool { try { $this->validate_delete_post($user, $discussion, $post, $hasreplies); @@ -531,7 +531,7 @@ class capability { * @param post_entity $post The post the user wants to split * @return bool */ - public function can_split_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { + public function can_split_post(stdClass $user, discussion_entity $discussion, post_entity $post): bool { if ($post->is_private_reply()) { // It is not possible to create a private discussion. return false; @@ -548,7 +548,7 @@ class capability { * @param post_entity $post The post the user wants to reply to * @return bool */ - public function can_reply_to_post(stdClass $user, discussion_entity $discussion, post_entity $post) : bool { + public function can_reply_to_post(stdClass $user, discussion_entity $discussion, post_entity $post): bool { if ($post->is_private_reply()) { // It is not possible to reply to a private reply. return false; @@ -567,7 +567,7 @@ class capability { * @param post_entity $post The post the user wants to reply to * @return bool */ - public function can_reply_privately_to_post(stdClass $user, post_entity $post) : bool { + public function can_reply_privately_to_post(stdClass $user, post_entity $post): bool { if ($post->is_private_reply()) { // You cannot reply privately to a post which is, itself, a private reply. return false; @@ -583,7 +583,7 @@ class capability { * @param post_entity $post The post the user wants to export * @return bool */ - public function can_export_post(stdClass $user, post_entity $post) : bool { + public function can_export_post(stdClass $user, post_entity $post): bool { global $CFG; $context = $this->get_context(); return $CFG->enableportfolios && (has_capability('mod/forum:exportpost', $context, $user) || @@ -595,7 +595,7 @@ class capability { * * @return forum_entity */ - protected function get_forum() : forum_entity { + protected function get_forum(): forum_entity { return $this->forum; } @@ -604,7 +604,7 @@ class capability { * * @return stdClass */ - protected function get_forum_record() : stdClass { + protected function get_forum_record(): stdClass { return $this->forumrecord; } @@ -613,7 +613,7 @@ class capability { * * @return context */ - protected function get_context() : context { + protected function get_context(): context { return $this->context; } @@ -623,7 +623,7 @@ class capability { * @param discussion_entity $discussion The discussion to convert * @return stdClass */ - protected function get_discussion_record(discussion_entity $discussion) : stdClass { + protected function get_discussion_record(discussion_entity $discussion): stdClass { return $this->discussiondatamapper->to_legacy_object($discussion); } @@ -633,7 +633,7 @@ class capability { * @param post_entity $post The post to convert * @return stdClass */ - protected function get_post_record(post_entity $post) : stdClass { + protected function get_post_record(post_entity $post): stdClass { return $this->postdatamapper->to_legacy_object($post); } @@ -644,7 +644,7 @@ class capability { * @param discussion_entity $discussion The discussion to check * @return bool */ - public function can_view_participants(stdClass $user, discussion_entity $discussion) : bool { + public function can_view_participants(stdClass $user, discussion_entity $discussion): bool { return course_can_view_participants($this->get_context()) && !$this->must_post_before_viewing_discussion($user, $discussion); } @@ -655,7 +655,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_view_hidden_posts(stdClass $user) : bool { + public function can_view_hidden_posts(stdClass $user): bool { return has_capability('mod/forum:viewhiddentimedposts', $this->get_context(), $user); } @@ -675,7 +675,7 @@ class capability { * @param stdClass $user The user to check * @return bool */ - public function can_manage_tags(stdClass $user) : bool { + public function can_manage_tags(stdClass $user): bool { return has_capability('moodle/tag:manage', context_system::instance(), $user); } @@ -686,7 +686,7 @@ class capability { * @param stdClass $user * @return bool */ - public function can_self_enrol(stdClass $user) : bool { + public function can_self_enrol(stdClass $user): bool { $canstart = false; if ($this->forum->get_type() != 'news') { @@ -711,7 +711,7 @@ class capability { * @param stdClass $user The user object. * @return bool True if the user can export the forum or false otherwise. */ - public function can_export_forum(stdClass $user) : bool { + public function can_export_forum(stdClass $user): bool { return has_capability('mod/forum:exportforum', $this->get_context(), $user); } diff --git a/mod/forum/classes/local/renderers/discussion.php b/mod/forum/classes/local/renderers/discussion.php index 9912582bba3..0c9d5e35a6f 100644 --- a/mod/forum/classes/local/renderers/discussion.php +++ b/mod/forum/classes/local/renderers/discussion.php @@ -179,7 +179,7 @@ class discussion { stdClass $user, post_entity $firstpost, array $replies - ) : string { + ): string { global $CFG; $displaymode = $this->displaymode; @@ -258,7 +258,7 @@ class discussion { * * @return stdClass[] */ - private function get_groups_available_in_forum() : array { + private function get_groups_available_in_forum(): array { $course = $this->forum->get_course_record(); $coursemodule = $this->forum->get_course_module_record(); @@ -271,7 +271,7 @@ class discussion { * @param stdClass $user The user viewing the discussion * @return array */ - private function get_exported_discussion(stdClass $user) : array { + private function get_exported_discussion(stdClass $user): array { $discussionexporter = $this->exporterfactory->get_discussion_exporter( $user, $this->forum, @@ -289,7 +289,7 @@ class discussion { * @param stdClass $user The current user * @return string */ - private function get_display_mode_selector_html(int $displaymode, stdClass $user) : string { + private function get_display_mode_selector_html(int $displaymode, stdClass $user): string { $baseurl = $this->baseurl; $select = new single_select( $baseurl, @@ -309,7 +309,7 @@ class discussion { * * @return string */ - private function get_move_discussion_html() : ?string { + private function get_move_discussion_html(): ?string { global $DB; $forum = $this->forum; @@ -370,7 +370,7 @@ class discussion { * @param stdClass $user The user viewing the discussion * @return string|null */ - private function get_export_discussion_html(stdClass $user) : ?string { + private function get_export_discussion_html(stdClass $user): ?string { global $CFG; if (!$this->capabilitymanager->can_export_discussions($user)) { @@ -389,7 +389,7 @@ class discussion { * @param stdClass $user The user viewing the discussion * @return string[] */ - private function get_notifications($user) : array { + private function get_notifications($user): array { $notifications = $this->notifications; $discussion = $this->discussion; $forum = $this->forum; @@ -452,7 +452,7 @@ class discussion { * * @return string */ - private function get_neighbour_links_html() : string { + private function get_neighbour_links_html(): string { $forum = $this->forum; $coursemodule = $forum->get_course_module_record(); $neighbours = forum_get_discussion_neighbours($coursemodule, $this->discussionrecord, $this->forumrecord); diff --git a/mod/forum/classes/local/renderers/discussion_list.php b/mod/forum/classes/local/renderers/discussion_list.php index 24f6ce8bdf2..dcec49415cc 100644 --- a/mod/forum/classes/local/renderers/discussion_list.php +++ b/mod/forum/classes/local/renderers/discussion_list.php @@ -158,7 +158,7 @@ class discussion_list { ?int $pagesize, int $displaymode = null, bool $enablediscussioncreation = true - ) : string { + ): string { global $PAGE; $forum = $this->forum; @@ -332,7 +332,7 @@ class discussion_list { * @param int $pagesize The number of discussions to show on the page * @return int The normalised page size */ - private function get_page_size(?int $pagesize) : int { + private function get_page_size(?int $pagesize): int { if (null === $pagesize || $pagesize <= 0) { $pagesize = discussion_list_vault::PAGESIZE_DEFAULT; } @@ -346,7 +346,7 @@ class discussion_list { * @param int $pageno The zero-indexed page number to use * @return int The normalised page number */ - private function get_page_number(?int $pageno) : int { + private function get_page_number(?int $pageno): int { if (null === $pageno || $pageno < 0) { $pageno = 0; } diff --git a/mod/forum/classes/local/renderers/posts.php b/mod/forum/classes/local/renderers/posts.php index ce17f526b77..aa7bfbe9a29 100644 --- a/mod/forum/classes/local/renderers/posts.php +++ b/mod/forum/classes/local/renderers/posts.php @@ -80,7 +80,7 @@ class posts { array $forums, array $discussions, array $posts - ) : string { + ): string { // Format the forums and discussion to make them more easily accessed later. $forums = array_reduce($forums, function($carry, $forum) { $carry[$forum->get_id()] = $forum; diff --git a/mod/forum/classes/local/vaults/author.php b/mod/forum/classes/local/vaults/author.php index 48846f0f6e6..d0a4d5009bf 100644 --- a/mod/forum/classes/local/vaults/author.php +++ b/mod/forum/classes/local/vaults/author.php @@ -46,7 +46,7 @@ class author extends db_table_vault { * * @return string */ - protected function get_table_alias() : string { + protected function get_table_alias(): string { return 'a'; } @@ -58,7 +58,7 @@ class author extends db_table_vault { * @param int|null $userid The user ID * @return string */ - protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null) : string { + protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null): string { $selectsql = 'SELECT * FROM {' . self::TABLE . '} ' . $this->get_table_alias(); $selectsql .= $wheresql ? ' WHERE ' . $wheresql : ''; $selectsql .= $sortsql ? ' ORDER BY ' . $sortsql : ''; @@ -91,7 +91,7 @@ class author extends db_table_vault { * @param post_entity[] $posts The list of posts * @return author_entity[] */ - public function get_authors_for_posts(array $posts) : array { + public function get_authors_for_posts(array $posts): array { $authorids = array_reduce($posts, function($carry, $post) { $carry[$post->get_author_id()] = true; return $carry; @@ -107,7 +107,7 @@ class author extends db_table_vault { * @param int[] $authorids The list of author ids to fetch. * @return int[] Results indexed by author id. */ - public function get_context_ids_for_author_ids(array $authorids) : array { + public function get_context_ids_for_author_ids(array $authorids): array { $db = $this->get_db(); [$insql, $params] = $db->get_in_or_equal($authorids); $sql = "SELECT instanceid, id FROM {context} WHERE contextlevel = ? AND instanceid {$insql}"; diff --git a/mod/forum/classes/local/vaults/db_table_vault.php b/mod/forum/classes/local/vaults/db_table_vault.php index 34edcc02f54..2442ede3391 100644 --- a/mod/forum/classes/local/vaults/db_table_vault.php +++ b/mod/forum/classes/local/vaults/db_table_vault.php @@ -65,7 +65,7 @@ abstract class db_table_vault { * * @return string */ - abstract protected function get_table_alias() : string; + abstract protected function get_table_alias(): string; /** * Build the SQL to be used in get_records_sql. @@ -76,7 +76,7 @@ abstract class db_table_vault { * @return string */ abstract protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, - ?int $userid = null) : string; + ?int $userid = null): string; /** * Convert the DB records into entities. The list of records will have been @@ -101,7 +101,7 @@ abstract class db_table_vault { * * @return array */ - protected function get_preprocessors() : array { + protected function get_preprocessors(): array { return []; } @@ -110,7 +110,7 @@ abstract class db_table_vault { * * @return moodle_database */ - protected function get_db() : moodle_database { + protected function get_db(): moodle_database { return $this->db; } @@ -119,7 +119,7 @@ abstract class db_table_vault { * * @return entity_factory */ - protected function get_entity_factory() : entity_factory { + protected function get_entity_factory(): entity_factory { return $this->entityfactory; } diff --git a/mod/forum/classes/local/vaults/discussion.php b/mod/forum/classes/local/vaults/discussion.php index 5b93f0596d8..25a894a7099 100644 --- a/mod/forum/classes/local/vaults/discussion.php +++ b/mod/forum/classes/local/vaults/discussion.php @@ -50,7 +50,7 @@ class discussion extends db_table_vault { * * @return string */ - protected function get_table_alias() : string { + protected function get_table_alias(): string { return 'd'; } @@ -62,7 +62,7 @@ class discussion extends db_table_vault { * @param int|null $userid The user ID * @return string */ - protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null) : string { + protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null): string { $selectsql = 'SELECT * FROM {' . self::TABLE . '} ' . $this->get_table_alias(); $selectsql .= $wheresql ? ' WHERE ' . $wheresql : ''; $selectsql .= $sortsql ? ' ORDER BY ' . $sortsql : ''; @@ -121,7 +121,7 @@ class discussion extends db_table_vault { * @param forum_entity $forum * @return discussion_entity|null */ - public function get_first_discussion_in_forum(forum_entity $forum) : ?discussion_entity { + public function get_first_discussion_in_forum(forum_entity $forum): ?discussion_entity { $records = $this->get_db()->get_records(self::TABLE, [ 'forum' => $forum->get_id(), ], 'timemodified ASC', '*', 0, 1); @@ -136,7 +136,7 @@ class discussion extends db_table_vault { * @param forum_entity $forum * @return discussion_entity|null */ - public function get_last_discussion_in_forum(forum_entity $forum) : ?discussion_entity { + public function get_last_discussion_in_forum(forum_entity $forum): ?discussion_entity { $records = $this->get_db()->get_records(self::TABLE, [ 'forum' => $forum->get_id(), ], 'timemodified DESC', '*', 0, 1); @@ -151,7 +151,7 @@ class discussion extends db_table_vault { * @param forum_entity $forum * @return int */ - public function get_count_discussions_in_forum(forum_entity $forum) : ?int { + public function get_count_discussions_in_forum(forum_entity $forum): ?int { return $this->get_db()->count_records(self::TABLE, [ 'forum' => $forum->get_id()]); } @@ -162,7 +162,7 @@ class discussion extends db_table_vault { * @param discussion_entity $discussion * @return discussion_entity|null */ - public function update_discussion(discussion_entity $discussion) : ?discussion_entity { + public function update_discussion(discussion_entity $discussion): ?discussion_entity { $discussionrecord = $this->get_legacy_factory()->to_legacy_object($discussion); if ($this->get_db()->update_record('forum_discussions', $discussionrecord)) { $records = $this->transform_db_records_to_entities([$discussionrecord]); diff --git a/mod/forum/classes/local/vaults/discussion_list.php b/mod/forum/classes/local/vaults/discussion_list.php index e099a671ae0..61a7d2148d9 100644 --- a/mod/forum/classes/local/vaults/discussion_list.php +++ b/mod/forum/classes/local/vaults/discussion_list.php @@ -89,7 +89,7 @@ class discussion_list extends db_table_vault { * * @return string */ - protected function get_table_alias() : string { + protected function get_table_alias(): string { return 'd'; } @@ -98,7 +98,7 @@ class discussion_list extends db_table_vault { * * @return string */ - protected function get_favourite_alias() : string { + protected function get_favourite_alias(): string { return 'favalias'; } @@ -111,7 +111,7 @@ class discussion_list extends db_table_vault { * * @return string */ - protected function generate_get_records_sql(string $wheresql = null, ?string $sortsql = null, ?int $userid = null) : string { + protected function generate_get_records_sql(string $wheresql = null, ?string $sortsql = null, ?int $userid = null): string { $alias = $this->get_table_alias(); $includefavourites = $userid ? true : false; @@ -192,7 +192,7 @@ class discussion_list extends db_table_vault { * @param string|null $wheresql Where conditions for the SQL * @return string */ - protected function generate_count_records_sql(string $wheresql = null) : string { + protected function generate_count_records_sql(string $wheresql = null): string { $alias = $this->get_table_alias(); $db = $this->get_db(); @@ -208,7 +208,7 @@ class discussion_list extends db_table_vault { * * @return array */ - protected function get_preprocessors() : array { + protected function get_preprocessors(): array { return array_merge( parent::get_preprocessors(), [ @@ -251,7 +251,7 @@ class discussion_list extends db_table_vault { * @param int|null $sortmethod * @return string */ - protected function get_keyfield(?int $sortmethod) : string { + protected function get_keyfield(?int $sortmethod): string { global $CFG; switch ($sortmethod) { @@ -302,7 +302,7 @@ class discussion_list extends db_table_vault { * @param int|null $sortmethod * @return string */ - protected function get_sort_direction(?int $sortmethod) : string { + protected function get_sort_direction(?int $sortmethod): string { switch ($sortmethod) { case self::SORTORDER_LASTPOST_ASC: case self::SORTORDER_CREATED_ASC: @@ -329,7 +329,7 @@ class discussion_list extends db_table_vault { * @param bool|null $includefavourites * @return string */ - private function get_sort_order(?int $sortmethod, bool $includefavourites = true) : string { + private function get_sort_order(?int $sortmethod, bool $includefavourites = true): string { $alias = $this->get_table_alias(); // TODO consider user favourites... diff --git a/mod/forum/classes/local/vaults/forum.php b/mod/forum/classes/local/vaults/forum.php index d16a0997cb6..841de3aa380 100644 --- a/mod/forum/classes/local/vaults/forum.php +++ b/mod/forum/classes/local/vaults/forum.php @@ -52,7 +52,7 @@ class forum extends db_table_vault { * * @return string */ - protected function get_table_alias() : string { + protected function get_table_alias(): string { return 'f'; } @@ -64,7 +64,7 @@ class forum extends db_table_vault { * @param int|null $userid The user ID * @return string */ - protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null) : string { + protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null): string { $db = $this->get_db(); $alias = $this->get_table_alias(); @@ -98,7 +98,7 @@ class forum extends db_table_vault { * * @return array */ - protected function get_preprocessors() : array { + protected function get_preprocessors(): array { return array_merge( parent::get_preprocessors(), [ @@ -116,7 +116,7 @@ class forum extends db_table_vault { * @param array $results The DB records * @return forum_entity[] */ - protected function from_db_records(array $results) : array { + protected function from_db_records(array $results): array { $entityfactory = $this->get_entity_factory(); return array_map(function(array $result) use ($entityfactory) { @@ -136,7 +136,7 @@ class forum extends db_table_vault { * @param int $id The course module id * @return forum_entity|null */ - public function get_from_course_module_id(int $id) : ?forum_entity { + public function get_from_course_module_id(int $id): ?forum_entity { $records = $this->get_from_course_module_ids([$id]); return count($records) ? array_shift($records) : null; } @@ -147,7 +147,7 @@ class forum extends db_table_vault { * @param int[] $ids The course module ids * @return forum_entity[] */ - public function get_from_course_module_ids(array $ids) : array { + public function get_from_course_module_ids(array $ids): array { $alias = $this->get_table_alias(); list($insql, $params) = $this->get_db()->get_in_or_equal($ids); $wheresql = 'cm.id ' . $insql; @@ -163,7 +163,7 @@ class forum extends db_table_vault { * @param int $id The course module id * @return forum_entity|null */ - public function get_from_post_id(int $id) : ?forum_entity { + public function get_from_post_id(int $id): ?forum_entity { $alias = $this->get_table_alias(); $thistable = new dml_table(self::TABLE, $alias, $alias); $coursemoduletable = new dml_table('course_modules', 'cm', 'cm_'); diff --git a/mod/forum/classes/local/vaults/post.php b/mod/forum/classes/local/vaults/post.php index da0ad2981cb..d587fe35fd2 100644 --- a/mod/forum/classes/local/vaults/post.php +++ b/mod/forum/classes/local/vaults/post.php @@ -58,7 +58,7 @@ class post extends db_table_vault { * * @return string */ - protected function get_table_alias() : string { + protected function get_table_alias(): string { return 'p'; } @@ -70,7 +70,7 @@ class post extends db_table_vault { * @param int|null $userid The user ID * @return string */ - protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null) : string { + protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null): string { $table = self::TABLE; $alias = $this->get_table_alias(); $fields = $alias . '.*'; @@ -112,7 +112,7 @@ class post extends db_table_vault { int $discussionid, bool $canseeprivatereplies, string $orderby = 'created ASC' - ) : array { + ): array { return $this->get_from_discussion_ids($user, [$discussionid], $canseeprivatereplies, $orderby); } @@ -130,7 +130,7 @@ class post extends db_table_vault { array $discussionids, bool $canseeprivatereplies, string $orderby = '' - ) : array { + ): array { if (empty($discussionids)) { return []; } @@ -233,7 +233,7 @@ class post extends db_table_vault { post_entity $post, bool $canseeprivatereplies, string $orderby = 'created ASC' - ) : array { + ): array { $alias = $this->get_table_alias(); [ @@ -306,7 +306,7 @@ class post extends db_table_vault { * @param bool $canseeprivatereplies Whether this user can see all private replies or not * @return int[] The number of replies for each discussion returned in an associative array */ - public function get_reply_count_for_discussion_ids(stdClass $user, array $discussionids, bool $canseeprivatereplies) : array { + public function get_reply_count_for_discussion_ids(stdClass $user, array $discussionids, bool $canseeprivatereplies): array { if (empty($discussionids)) { return []; } @@ -336,7 +336,7 @@ class post extends db_table_vault { * @return int The number of replies for each discussion returned in an associative array */ public function get_reply_count_for_post_id_in_discussion_id( - stdClass $user, int $postid, int $discussionid, bool $canseeprivatereplies) : int { + stdClass $user, int $postid, int $discussionid, bool $canseeprivatereplies): int { [ 'where' => $privatewhere, 'params' => $privateparams, @@ -363,7 +363,7 @@ class post extends db_table_vault { * @param int $postid The ID to check for * @return int $count */ - private function count_children_from_parent_recursively(array $postparents, int $postid) : int { + private function count_children_from_parent_recursively(array $postparents, int $postid): int { if (!isset($postparents[$postid])) { // Post not found at all. return 0; @@ -387,7 +387,7 @@ class post extends db_table_vault { * @param bool $canseeprivatereplies Whether this user can see all private replies or not * @return int[] The count of unread posts for each discussion returned in an associative array */ - public function get_unread_count_for_discussion_ids(stdClass $user, array $discussionids, bool $canseeprivatereplies) : array { + public function get_unread_count_for_discussion_ids(stdClass $user, array $discussionids, bool $canseeprivatereplies): array { global $CFG; if (empty($discussionids)) { @@ -425,7 +425,7 @@ class post extends db_table_vault { * @throws \dml_exception */ public function get_latest_posts_for_discussion_ids( - stdClass $user, array $discussionids, bool $canseeprivatereplies) : array { + stdClass $user, array $discussionids, bool $canseeprivatereplies): array { if (empty($discussionids)) { return []; @@ -491,7 +491,7 @@ class post extends db_table_vault { * @param int[] $discussionids The list of discussions to fetch counts for * @return post_entity[] The post object of the first post for each discussions returned in an associative array */ - public function get_first_post_for_discussion_ids(array $discussionids) : array { + public function get_first_post_for_discussion_ids(array $discussionids): array { if (empty($discussionids)) { return []; diff --git a/mod/forum/classes/local/vaults/post_read_receipt_collection.php b/mod/forum/classes/local/vaults/post_read_receipt_collection.php index 6d8aea57e39..214e2884414 100644 --- a/mod/forum/classes/local/vaults/post_read_receipt_collection.php +++ b/mod/forum/classes/local/vaults/post_read_receipt_collection.php @@ -48,7 +48,7 @@ class post_read_receipt_collection extends db_table_vault { * * @return string */ - protected function get_table_alias() : string { + protected function get_table_alias(): string { return 'fr'; } @@ -60,7 +60,7 @@ class post_read_receipt_collection extends db_table_vault { * @param int|null $userid The user ID * @return string */ - protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null) : string { + protected function generate_get_records_sql(string $wheresql = null, string $sortsql = null, ?int $userid = null): string { $selectsql = 'SELECT * FROM {' . self::TABLE . '} ' . $this->get_table_alias(); $selectsql .= $wheresql ? ' WHERE ' . $wheresql : ''; $selectsql .= $sortsql ? ' ORDER BY ' . $sortsql : ''; diff --git a/mod/forum/classes/local/vaults/preprocessors/extract_context.php b/mod/forum/classes/local/vaults/preprocessors/extract_context.php index baad55dac69..e3ac2eb1cf8 100644 --- a/mod/forum/classes/local/vaults/preprocessors/extract_context.php +++ b/mod/forum/classes/local/vaults/preprocessors/extract_context.php @@ -42,7 +42,7 @@ class extract_context { * @param stdClass[] $records The list of records which have context properties * @return context[] List of contexts matching the records. */ - public function execute(array $records) : array { + public function execute(array $records): array { return array_map(function($record) { $contextid = $record->ctxid; context_helper::preload_from_record($record); diff --git a/mod/forum/classes/local/vaults/preprocessors/extract_record.php b/mod/forum/classes/local/vaults/preprocessors/extract_record.php index 2bccefd93a8..41388b70ab2 100644 --- a/mod/forum/classes/local/vaults/preprocessors/extract_record.php +++ b/mod/forum/classes/local/vaults/preprocessors/extract_record.php @@ -59,7 +59,7 @@ class extract_record { * @param stdClass[] $records The list of records to process * @return stdClass[] The extracted records */ - public function execute(array $records) : array { + public function execute(array $records): array { return array_map(function($record) { return $this->table->extract_from_result($record); }, $records); diff --git a/mod/forum/classes/local/vaults/preprocessors/extract_user.php b/mod/forum/classes/local/vaults/preprocessors/extract_user.php index ae01ce21fbd..82a9510c6f4 100644 --- a/mod/forum/classes/local/vaults/preprocessors/extract_user.php +++ b/mod/forum/classes/local/vaults/preprocessors/extract_user.php @@ -60,7 +60,7 @@ class extract_user { * @param stdClass[] $records The DB records * @return stdClass[] The list of extracted users */ - public function execute(array $records) : array { + public function execute(array $records): array { $idalias = $this->idalias; $alias = $this->alias; diff --git a/mod/forum/classes/privacy/provider.php b/mod/forum/classes/privacy/provider.php index f6dfe7165c4..d6dd6795d4c 100644 --- a/mod/forum/classes/privacy/provider.php +++ b/mod/forum/classes/privacy/provider.php @@ -67,7 +67,7 @@ class provider implements * @param collection $items The initialised collection to add items to. * @return collection A listing of user data stored through this system. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { // The 'forum' table does not store any specific user data. $items->add_database_table('forum_digests', [ 'forum' => 'privacy:metadata:forum_digests:forum', @@ -165,7 +165,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $contextlist = new \core_privacy\local\request\contextlist(); $params = [ diff --git a/mod/forum/classes/privacy/subcontext_info.php b/mod/forum/classes/privacy/subcontext_info.php index 0a02743ed35..312f35432de 100644 --- a/mod/forum/classes/privacy/subcontext_info.php +++ b/mod/forum/classes/privacy/subcontext_info.php @@ -43,7 +43,7 @@ trait subcontext_info { * @param \stdClass $discussion The discussion * @return array */ - protected static function get_discussion_area(\stdClass $discussion) : Array { + protected static function get_discussion_area(\stdClass $discussion): Array { $pathparts = []; if (!empty($discussion->groupname)) { $pathparts[] = get_string('groups'); @@ -69,7 +69,7 @@ trait subcontext_info { * @param \stdClass $post The post. * @return array */ - protected static function get_post_area(\stdClass $post) : Array { + protected static function get_post_area(\stdClass $post): Array { $parts = [ $post->created, $post->subject, diff --git a/mod/forum/classes/task/send_user_digests.php b/mod/forum/classes/task/send_user_digests.php index f63d1b165ba..83c871b7a89 100644 --- a/mod/forum/classes/task/send_user_digests.php +++ b/mod/forum/classes/task/send_user_digests.php @@ -336,7 +336,7 @@ class send_user_digests extends \core\task\adhoc_task { * @param int $userid user id which queue elements are going to be removed. * @param int $timemodified up time limit of the queue elements to be removed. */ - protected function empty_queue(int $userid, int $timemodified) : void { + protected function empty_queue(int $userid, int $timemodified): void { global $DB; $DB->delete_records_select('forum_queue', "userid = :userid AND timemodified < :timemodified", [ diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 1f25fa4f5f7..fae6620c12a 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -6579,7 +6579,7 @@ function forum_post_is_visible_privately($post, $cm) { * @param \stdClass $parent * @return bool */ -function forum_user_can_reply_privately(\context_module $context, \stdClass $parent) : bool { +function forum_user_can_reply_privately(\context_module $context, \stdClass $parent): bool { if ($parent->privatereplyto) { // You cannot reply privately to a post which is, itself, a private reply. return false; @@ -6763,7 +6763,7 @@ function mod_forum_count_all_discussions(\mod_forum\local\entities\forum $forum, * @param int $groupid The groupid requested * @return array The list of groups to show */ -function mod_forum_get_groups_from_groupid(\mod_forum\local\entities\forum $forum, stdClass $user, ?int $groupid) : ?array { +function mod_forum_get_groups_from_groupid(\mod_forum\local\entities\forum $forum, stdClass $user, ?int $groupid): ?array { $effectivegroupmode = $forum->get_effective_group_mode(); if (empty($effectivegroupmode)) { diff --git a/mod/forum/report/summary/classes/privacy/provider.php b/mod/forum/report/summary/classes/privacy/provider.php index 5670f15fec1..b87ffd828a2 100644 --- a/mod/forum/report/summary/classes/privacy/provider.php +++ b/mod/forum/report/summary/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/forum/tests/exporters_post_test.php b/mod/forum/tests/exporters_post_test.php index ef2c33a51cd..ffda97bc2c6 100644 --- a/mod/forum/tests/exporters_post_test.php +++ b/mod/forum/tests/exporters_post_test.php @@ -500,7 +500,7 @@ class test_capability_manager extends capability_manager { * @param post_entity $post The post * @return bool */ - public function can_view_post(\stdClass $user, discussion_entity $discussion, post_entity $post) : bool { + public function can_view_post(\stdClass $user, discussion_entity $discussion, post_entity $post): bool { return $this->view; } @@ -512,7 +512,7 @@ class test_capability_manager extends capability_manager { * @param post_entity $post The post * @return bool */ - public function can_edit_post(\stdClass $user, discussion_entity $discussion, post_entity $post) : bool { + public function can_edit_post(\stdClass $user, discussion_entity $discussion, post_entity $post): bool { return $this->edit; } @@ -526,7 +526,7 @@ class test_capability_manager extends capability_manager { * @return bool */ public function can_delete_post(\stdClass $user, discussion_entity $discussion, post_entity $post, - bool $hasreplies = false) : bool { + bool $hasreplies = false): bool { return $this->delete; } @@ -538,7 +538,7 @@ class test_capability_manager extends capability_manager { * @param post_entity $post The post * @return bool */ - public function can_split_post(\stdClass $user, discussion_entity $discussion, post_entity $post) : bool { + public function can_split_post(\stdClass $user, discussion_entity $discussion, post_entity $post): bool { return $this->split; } @@ -550,7 +550,7 @@ class test_capability_manager extends capability_manager { * @param post_entity $post The post * @return bool */ - public function can_reply_to_post(\stdClass $user, discussion_entity $discussion, post_entity $post) : bool { + public function can_reply_to_post(\stdClass $user, discussion_entity $discussion, post_entity $post): bool { return $this->reply; } @@ -561,7 +561,7 @@ class test_capability_manager extends capability_manager { * @param post_entity $post The post * @return bool */ - public function can_export_post(\stdClass $user, post_entity $post) : bool { + public function can_export_post(\stdClass $user, post_entity $post): bool { return $this->export; } @@ -571,7 +571,7 @@ class test_capability_manager extends capability_manager { * @param \stdClass $user The user * @return bool */ - public function can_manually_control_post_read_status(\stdClass $user) : bool { + public function can_manually_control_post_read_status(\stdClass $user): bool { return $this->controlreadstatus; } @@ -581,7 +581,7 @@ class test_capability_manager extends capability_manager { * @param post_entity $post * @return bool */ - public function can_reply_privately_to_post(\stdClass $user, post_entity $post) : bool { + public function can_reply_privately_to_post(\stdClass $user, post_entity $post): bool { return $this->canreplyprivatelytopost; } @@ -590,7 +590,7 @@ class test_capability_manager extends capability_manager { * @param \stdClass $user * @return bool */ - public function can_self_enrol(\stdClass $user) : bool { + public function can_self_enrol(\stdClass $user): bool { return $this->canenrol; } } diff --git a/mod/forum/tests/generator/lib.php b/mod/forum/tests/generator/lib.php index bb071a02477..2a078c1b9a4 100644 --- a/mod/forum/tests/generator/lib.php +++ b/mod/forum/tests/generator/lib.php @@ -368,7 +368,7 @@ class mod_forum_generator extends testing_module_generator { * @param int $timecreated The post time created timestamp if it's to be displayed * @return string */ - public function get_author_subheading_html(stdClass $exportedauthor, int $timecreated) : string { + public function get_author_subheading_html(stdClass $exportedauthor, int $timecreated): string { $fullname = $exportedauthor->fullname; $profileurl = $exportedauthor->urls['profile'] ?? null; $name = $profileurl ? "{$fullname}" : $fullname; diff --git a/mod/glossary/classes/analytics/indicator/cognitive_depth.php b/mod/glossary/classes/analytics/indicator/cognitive_depth.php index 379dd8673f1..e8064cc559a 100644 --- a/mod/glossary/classes/analytics/indicator/cognitive_depth.php +++ b/mod/glossary/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_glossary'); } diff --git a/mod/glossary/classes/analytics/indicator/social_breadth.php b/mod/glossary/classes/analytics/indicator/social_breadth.php index 4c669aa0026..d07ba8542ba 100644 --- a/mod/glossary/classes/analytics/indicator/social_breadth.php +++ b/mod/glossary/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_glossary'); } diff --git a/mod/glossary/classes/privacy/provider.php b/mod/glossary/classes/privacy/provider.php index 5f52b06f1e6..56343951524 100644 --- a/mod/glossary/classes/privacy/provider.php +++ b/mod/glossary/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @param collection $items a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { $items->add_database_table( 'glossary_entries', [ @@ -79,7 +79,7 @@ class provider implements * @param int $userid the userid. * @return contextlist the list of contexts containing user info for the user. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // Glossary entries. diff --git a/mod/h5pactivity/classes/local/grader.php b/mod/h5pactivity/classes/local/grader.php index 85feba7c540..24a20a257cf 100644 --- a/mod/h5pactivity/classes/local/grader.php +++ b/mod/h5pactivity/classes/local/grader.php @@ -187,7 +187,7 @@ class grader { * dategraded, * datesubmitted */ - private function get_user_grades_for_deletion (int $userid = 0): array { + private function get_user_grades_for_deletion(int $userid = 0): array { $grades = []; if ($userid) { diff --git a/mod/h5pactivity/classes/output/attempt.php b/mod/h5pactivity/classes/output/attempt.php index 6168e969924..24880ea0e75 100644 --- a/mod/h5pactivity/classes/output/attempt.php +++ b/mod/h5pactivity/classes/output/attempt.php @@ -177,7 +177,7 @@ class attempt implements renderable, templatable { * @param stdClass $duration object with (h)hours, (m)minutes and (s)seconds * @return string the long format duration */ - private function format_duration (stdClass $duration): string { + private function format_duration(stdClass $duration): string { $result = []; if ($duration->h) { $result[] = get_string('numhours', 'moodle', $duration->h); @@ -199,7 +199,7 @@ class attempt implements renderable, templatable { * @param stdClass $duration object with (h)hours, (m)minutes and (s)seconds * @return string the short format duration */ - private function format_duration_short (stdClass $duration): string { + private function format_duration_short(stdClass $duration): string { $result = []; if ($duration->h || $duration->m) { $result[] = ($duration->h * 60 + $duration->m)."'"; @@ -219,7 +219,7 @@ class attempt implements renderable, templatable { * @param int $seconds number of second * @return stdClass with (h)hours, (m)minutes and (s)seconds */ - private function extract_duration (int $seconds): stdClass { + private function extract_duration(int $seconds): stdClass { $h = floor($seconds / 3600); $m = floor(($seconds - $h * 3600) / 60); $s = $seconds - ($h * 3600 + $m * 60); diff --git a/mod/h5pactivity/classes/privacy/provider.php b/mod/h5pactivity/classes/privacy/provider.php index ffe0925300a..4769b3bf807 100644 --- a/mod/h5pactivity/classes/privacy/provider.php +++ b/mod/h5pactivity/classes/privacy/provider.php @@ -45,7 +45,7 @@ class provider implements * @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('h5pactivity_attempts', [ 'userid' => 'privacy:metadata:userid', 'attempt' => 'privacy:metadata:attempt', @@ -71,7 +71,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {h5pactivity_attempts} ss JOIN {modules} m diff --git a/mod/h5pactivity/lib.php b/mod/h5pactivity/lib.php index 6d8a6056f9d..831d93f1245 100644 --- a/mod/h5pactivity/lib.php +++ b/mod/h5pactivity/lib.php @@ -768,7 +768,7 @@ function h5pactivity_print_recent_mod_activity(stdClass $activity, int $courseid * @param int $courseid Limit the search to this course * @return array $recentactivity recent activity in a course. */ -function h5pactivity_fetch_recent_activity(array $submissions, int $courseid) : array { +function h5pactivity_fetch_recent_activity(array $submissions, int $courseid): array { global $USER; $course = get_course($courseid); diff --git a/mod/imscp/classes/analytics/indicator/cognitive_depth.php b/mod/imscp/classes/analytics/indicator/cognitive_depth.php index 5c85527b667..6585741c064 100644 --- a/mod/imscp/classes/analytics/indicator/cognitive_depth.php +++ b/mod/imscp/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_imscp'); } diff --git a/mod/imscp/classes/analytics/indicator/social_breadth.php b/mod/imscp/classes/analytics/indicator/social_breadth.php index c93351039c1..812566e4da8 100644 --- a/mod/imscp/classes/analytics/indicator/social_breadth.php +++ b/mod/imscp/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_imscp'); } diff --git a/mod/imscp/classes/privacy/provider.php b/mod/imscp/classes/privacy/provider.php index 58ed9e2ef89..d4e86ea61a5 100644 --- a/mod/imscp/classes/privacy/provider.php +++ b/mod/imscp/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/label/classes/analytics/indicator/cognitive_depth.php b/mod/label/classes/analytics/indicator/cognitive_depth.php index fc1f3c41b18..cc7cd39a46c 100644 --- a/mod/label/classes/analytics/indicator/cognitive_depth.php +++ b/mod/label/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_label'); } diff --git a/mod/label/classes/analytics/indicator/social_breadth.php b/mod/label/classes/analytics/indicator/social_breadth.php index a59263e03af..767fc28501b 100644 --- a/mod/label/classes/analytics/indicator/social_breadth.php +++ b/mod/label/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_label'); } diff --git a/mod/label/classes/privacy/provider.php b/mod/label/classes/privacy/provider.php index 5d6ac61ecb1..0ea7ea02826 100644 --- a/mod/label/classes/privacy/provider.php +++ b/mod/label/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/mod/lesson/classes/analytics/indicator/cognitive_depth.php b/mod/lesson/classes/analytics/indicator/cognitive_depth.php index fe2600746a7..ebe434cba53 100644 --- a/mod/lesson/classes/analytics/indicator/cognitive_depth.php +++ b/mod/lesson/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_lesson'); } diff --git a/mod/lesson/classes/analytics/indicator/social_breadth.php b/mod/lesson/classes/analytics/indicator/social_breadth.php index f0737151be3..c165137a9c4 100644 --- a/mod/lesson/classes/analytics/indicator/social_breadth.php +++ b/mod/lesson/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_lesson'); } diff --git a/mod/lesson/classes/local/numeric/helper.php b/mod/lesson/classes/local/numeric/helper.php index 01ad8f80b7f..72e96b24f47 100644 --- a/mod/lesson/classes/local/numeric/helper.php +++ b/mod/lesson/classes/local/numeric/helper.php @@ -60,7 +60,7 @@ class helper { * @param string|number $value The value to be formatted * @return string $formattedvalue Formatted value OR $value if not numeric */ - public static function lesson_format_numeric_value($value) : string { + public static function lesson_format_numeric_value($value): string { $formattedvalue = $value; if (strpos($value, ':')) { list($min, $max) = explode(':', $value); diff --git a/mod/lesson/classes/privacy/provider.php b/mod/lesson/classes/privacy/provider.php index 61efd9db245..8621d75d6ec 100644 --- a/mod/lesson/classes/privacy/provider.php +++ b/mod/lesson/classes/privacy/provider.php @@ -63,7 +63,7 @@ class provider implements * @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('lesson_attempts', [ 'userid' => 'privacy:metadata:attempts:userid', 'pageid' => 'privacy:metadata:attempts:pageid', @@ -120,7 +120,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $contextlist = new \core_privacy\local\request\contextlist(); $sql = " diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 672cefe0dcd..68e35488b0d 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -5026,7 +5026,7 @@ abstract class lesson_page extends lesson_base { * @param stdClass $data The form data to update. * @return stdClass The updated fom data. */ - public function update_form_data(stdClass $data) : stdClass { + public function update_form_data(stdClass $data): stdClass { return $data; } } diff --git a/mod/lesson/pagetypes/numerical.php b/mod/lesson/pagetypes/numerical.php index c5c79553279..d15cb731d7a 100644 --- a/mod/lesson/pagetypes/numerical.php +++ b/mod/lesson/pagetypes/numerical.php @@ -325,7 +325,7 @@ class lesson_page_type_numerical extends lesson_page { * @param stdClass $data The form data to update. * @return stdClass The updated fom data. */ - public function update_form_data(stdClass $data) : stdClass { + public function update_form_data(stdClass $data): stdClass { $answercount = count($this->get_answers()); // If no answers provided, then we don't need to check anything. @@ -403,7 +403,7 @@ class lesson_add_page_form_numerical extends lesson_add_page_form_base { * * @return object|void */ - public function get_data() : ?stdClass { + public function get_data(): ?stdClass { $data = parent::get_data(); if (!empty($data->answer_editor)) { @@ -421,7 +421,7 @@ class lesson_add_page_form_numerical extends lesson_add_page_form_base { * * @return object submitted data; NULL if not valid or not submitted or cancelled */ - public function get_submitted_data() : ?stdClass { + public function get_submitted_data(): ?stdClass { $data = parent::get_submitted_data(); if (!empty($data->answer_editor)) { diff --git a/mod/lesson/pagetypes/shortanswer.php b/mod/lesson/pagetypes/shortanswer.php index bc7ce1fa632..4dc8c0680d3 100644 --- a/mod/lesson/pagetypes/shortanswer.php +++ b/mod/lesson/pagetypes/shortanswer.php @@ -385,7 +385,7 @@ class lesson_page_type_shortanswer extends lesson_page { * @param stdClass $data The form data to update. * @return stdClass The updated fom data. */ - public function update_form_data(stdClass $data) : stdClass { + public function update_form_data(stdClass $data): stdClass { $answercount = count($this->get_answers()); // Check for other answer entry. $lastanswer = $data->{'answer_editor[' . ($answercount - 1) . ']'}; diff --git a/mod/lti/classes/analytics/indicator/cognitive_depth.php b/mod/lti/classes/analytics/indicator/cognitive_depth.php index feb31ffaaec..4c1cd955200 100644 --- a/mod/lti/classes/analytics/indicator/cognitive_depth.php +++ b/mod/lti/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_lti'); } diff --git a/mod/lti/classes/analytics/indicator/social_breadth.php b/mod/lti/classes/analytics/indicator/social_breadth.php index 896d294698e..8ca70c40084 100644 --- a/mod/lti/classes/analytics/indicator/social_breadth.php +++ b/mod/lti/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_lti'); } diff --git a/mod/lti/classes/local/ltiopenid/registration_helper.php b/mod/lti/classes/local/ltiopenid/registration_helper.php index 5889ee78e7d..a96c62bc6f4 100644 --- a/mod/lti/classes/local/ltiopenid/registration_helper.php +++ b/mod/lti/classes/local/ltiopenid/registration_helper.php @@ -443,7 +443,7 @@ class registration_helper { * * @return mixed Tool Proxy details */ - public function get_tool_proxy(int $proxyid) : array { + public function get_tool_proxy(int $proxyid): array { return lti_get_tool_proxy($proxyid); } } diff --git a/mod/lti/classes/privacy/provider.php b/mod/lti/classes/privacy/provider.php index a96697608ef..b4afbbb6691 100644 --- a/mod/lti/classes/privacy/provider.php +++ b/mod/lti/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @param collection $items a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { $items->add_external_location_link( 'lti_provider', [ @@ -114,7 +114,7 @@ class provider implements * @param int $userid the userid. * @return contextlist the list of contexts containing user info for the user. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { // Fetch all LTI submissions. $sql = "SELECT c.id FROM {context} c diff --git a/mod/lti/classes/reportbuilder/local/entities/tool_types.php b/mod/lti/classes/reportbuilder/local/entities/tool_types.php index 52c689bd06e..04a130fe54e 100644 --- a/mod/lti/classes/reportbuilder/local/entities/tool_types.php +++ b/mod/lti/classes/reportbuilder/local/entities/tool_types.php @@ -179,7 +179,7 @@ class tool_types extends base { "{$tablealias}.ltiversion" )) ->add_joins($this->get_joins()) - ->set_options_callback(static function() : array { + ->set_options_callback(static function(): array { return ['LTI-1p0' => 'Legacy LTI', '1.3.0' => "LTI Advantage"]; }) ]; diff --git a/mod/lti/edit_form.php b/mod/lti/edit_form.php index c10718fce26..3fc992e491a 100644 --- a/mod/lti/edit_form.php +++ b/mod/lti/edit_form.php @@ -412,7 +412,7 @@ class mod_lti_edit_types_form extends moodleform { * @param int $parentid * @return array category tree */ - public function lti_build_category_tree(array $elements, int $parentid = 0) : array { + public function lti_build_category_tree(array $elements, int $parentid = 0): array { $branch = []; foreach ($elements as $element) { diff --git a/mod/lti/locallib.php b/mod/lti/locallib.php index d627374ff83..3817c7772d4 100644 --- a/mod/lti/locallib.php +++ b/mod/lti/locallib.php @@ -460,7 +460,7 @@ function lti_get_jwt_claim_mapping() { * @return object|null * @since Moodle 3.9 */ -function lti_get_instance_type(object $instance) : ?object { +function lti_get_instance_type(object $instance): ?object { if (empty($instance->typeid)) { if (!$tool = lti_get_tool_by_url_match($instance->toolurl, $instance->course)) { $tool = lti_get_tool_by_url_match($instance->securetoolurl, $instance->course); @@ -1422,7 +1422,7 @@ function params_to_string(object $params) { * * @return stdClass Form config for the item */ -function content_item_to_form(object $tool, object $typeconfig, object $item) : stdClass { +function content_item_to_form(object $tool, object $typeconfig, object $item): stdClass { global $OUTPUT; $config = new stdClass(); @@ -2880,7 +2880,7 @@ function lti_update_type($type, $config) { * @param string $lticoursecategories Comma separated list of course categories. * @return void */ -function lti_type_add_categories(int $typeid, string $lticoursecategories = '') : void { +function lti_type_add_categories(int $typeid, string $lticoursecategories = ''): void { global $DB; $coursecategories = explode(',', $lticoursecategories); foreach ($coursecategories as $coursecategory) { diff --git a/mod/lti/service/basicoutcomes/classes/privacy/provider.php b/mod/lti/service/basicoutcomes/classes/privacy/provider.php index a31ea9b1028..0d47d5c0c13 100644 --- a/mod/lti/service/basicoutcomes/classes/privacy/provider.php +++ b/mod/lti/service/basicoutcomes/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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->link_external_location('External LTI provider.', [ 'userid' => 'privacy:metadata:userid', 'grade' => 'privacy:metadata:grade', @@ -64,7 +64,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php b/mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php index d17d4ea3484..55b6e623e11 100644 --- a/mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php +++ b/mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php @@ -446,7 +446,7 @@ class gradebookservices extends service_base { */ public function add_standalone_lineitem(string $courseid, string $label, float $maximumscore, string $baseurl, ?int $ltilinkid, ?string $resourceid, ?string $tag, int $typeid, - int $toolproxyid = null) : int { + int $toolproxyid = null): int { global $DB; $params = array(); $params['itemname'] = $label; @@ -728,7 +728,7 @@ class gradebookservices extends service_base { * */ public static function update_coupled_gradebookservices(object $ltiinstance, - ?string $resourceid, ?string $tag, ?\moodle_url $subreviewurl, ?string $subreviewparams) : void { + ?string $resourceid, ?string $tag, ?\moodle_url $subreviewurl, ?string $subreviewparams): void { global $DB; if ($ltiinstance && $ltiinstance->typeid) { diff --git a/mod/lti/service/gradebookservices/classes/privacy/provider.php b/mod/lti/service/gradebookservices/classes/privacy/provider.php index 70dd92fed6d..4558231d8e2 100644 --- a/mod/lti/service/gradebookservices/classes/privacy/provider.php +++ b/mod/lti/service/gradebookservices/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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->link_external_location('External LTI provider.', [ 'userid' => 'privacy:metadata:userid', 'grade' => 'privacy:metadata:grade', @@ -67,7 +67,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/mod/lti/service/gradebookservices/tests/gradebookservices_test.php b/mod/lti/service/gradebookservices/tests/gradebookservices_test.php index 62913bc0084..3ac62226fdd 100644 --- a/mod/lti/service/gradebookservices/tests/gradebookservices_test.php +++ b/mod/lti/service/gradebookservices/tests/gradebookservices_test.php @@ -288,7 +288,7 @@ class gradebookservices_test extends \advanced_testcase { */ private function assert_lineitems(object $course, int $typeid, string $label, ?object $ltiinstance, ?string $resourceid, ?string $tag, - ?string $subreviewurl = null, ?string $subreviewparams = null) : void { + ?string $subreviewurl = null, ?string $subreviewparams = null): void { $gbservice = new gradebookservices(); $gradeitems = $gbservice->get_lineitems($course->id, null, null, null, null, null, $typeid); @@ -347,7 +347,7 @@ class gradebookservices_test extends \advanced_testcase { * @return object lti instance created */ private function create_graded_lti(int $typeid, object $course, ?string $resourceid, ?string $tag, - ?string $subreviewurl = null, ?string $subreviewparams = null) : object { + ?string $subreviewurl = null, ?string $subreviewparams = null): object { $lti = ['course' => $course->id, 'typeid' => $typeid, @@ -369,7 +369,7 @@ class gradebookservices_test extends \advanced_testcase { * * @return object lti instance created */ - private function create_notgraded_lti(int $typeid, object $course) : object { + private function create_notgraded_lti(int $typeid, object $course): object { $lti = ['course' => $course->id, 'typeid' => $typeid, @@ -389,7 +389,7 @@ class gradebookservices_test extends \advanced_testcase { * */ private function create_standalone_lineitem(int $courseid, int $typeid, ?string $resourceid, - ?string $tag, int $ltiinstanceid = null) : void { + ?string $tag, int $ltiinstanceid = null): void { $gbservice = new gradebookservices(); $gbservice->add_standalone_lineitem($courseid, "manualtest", diff --git a/mod/lti/service/gradebookservices/tests/lineitem_test.php b/mod/lti/service/gradebookservices/tests/lineitem_test.php index 01e5493f68b..5d2ef95935a 100644 --- a/mod/lti/service/gradebookservices/tests/lineitem_test.php +++ b/mod/lti/service/gradebookservices/tests/lineitem_test.php @@ -187,7 +187,7 @@ class lineitem_test extends \advanced_testcase { * @return object lti instance created */ private function create_graded_lti(int $typeid, object $course, ?string $resourceid, ?string $tag, - ?string $subreviewurl = null, ?string $subreviewparams = null) : object { + ?string $subreviewurl = null, ?string $subreviewparams = null): object { $lti = ['course' => $course->id, 'typeid' => $typeid, diff --git a/mod/lti/service/memberships/classes/privacy/provider.php b/mod/lti/service/memberships/classes/privacy/provider.php index 90962659406..6dacdbbb7d3 100644 --- a/mod/lti/service/memberships/classes/privacy/provider.php +++ b/mod/lti/service/memberships/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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->link_external_location('External LTI provider.', [ 'userid' => 'privacy:metadata:userid', 'useridnumber' => 'privacy:metadata:useridnumber', @@ -68,7 +68,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/mod/lti/service/profile/classes/privacy/provider.php b/mod/lti/service/profile/classes/privacy/provider.php index f3407b17ebc..1051c8af529 100644 --- a/mod/lti/service/profile/classes/privacy/provider.php +++ b/mod/lti/service/profile/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/lti/service/toolproxy/classes/privacy/provider.php b/mod/lti/service/toolproxy/classes/privacy/provider.php index e73edf00bbb..f23e654e1b5 100644 --- a/mod/lti/service/toolproxy/classes/privacy/provider.php +++ b/mod/lti/service/toolproxy/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/lti/service/toolsettings/classes/privacy/provider.php b/mod/lti/service/toolsettings/classes/privacy/provider.php index 2161181a486..fd2d9c1596b 100644 --- a/mod/lti/service/toolsettings/classes/privacy/provider.php +++ b/mod/lti/service/toolsettings/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/lti/tests/course_categories_trait.php b/mod/lti/tests/course_categories_trait.php index 6bd9abcce3f..c4ed7fd6bf8 100644 --- a/mod/lti/tests/course_categories_trait.php +++ b/mod/lti/tests/course_categories_trait.php @@ -29,7 +29,7 @@ trait mod_lti_course_categories_trait { * * @return array */ - public function setup_course_categories() : array { + public function setup_course_categories(): array { global $DB; $topcatdbrecord = $DB->get_record('course_categories', ['parent' => 0]); diff --git a/mod/page/classes/analytics/indicator/cognitive_depth.php b/mod/page/classes/analytics/indicator/cognitive_depth.php index 0874f77c4c0..3eabca963e6 100644 --- a/mod/page/classes/analytics/indicator/cognitive_depth.php +++ b/mod/page/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_page'); } diff --git a/mod/page/classes/analytics/indicator/social_breadth.php b/mod/page/classes/analytics/indicator/social_breadth.php index b9542e9cc85..2889bbfdf71 100644 --- a/mod/page/classes/analytics/indicator/social_breadth.php +++ b/mod/page/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_page'); } diff --git a/mod/page/classes/privacy/provider.php b/mod/page/classes/privacy/provider.php index 6d6b808e05c..128c6808434 100644 --- a/mod/page/classes/privacy/provider.php +++ b/mod/page/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/mod/page/lib.php b/mod/page/lib.php index 2aad2eceb1a..8f49b1102a2 100644 --- a/mod/page/lib.php +++ b/mod/page/lib.php @@ -577,7 +577,7 @@ function mod_page_core_calendar_provide_event_action(calendar_event $event, * @param array $args The path (the part after the filearea and before the filename). * @return array The itemid and the filepath inside the $args path, for the defined filearea. */ -function mod_page_get_path_from_pluginfile(string $filearea, array $args) : array { +function mod_page_get_path_from_pluginfile(string $filearea, array $args): array { // Page never has an itemid (the number represents the revision but it's not stored in database). array_shift($args); diff --git a/mod/quiz/accessrule/delaybetweenattempts/classes/privacy/provider.php b/mod/quiz/accessrule/delaybetweenattempts/classes/privacy/provider.php index 3648019c73d..e0ee6334f56 100644 --- a/mod/quiz/accessrule/delaybetweenattempts/classes/privacy/provider.php +++ b/mod/quiz/accessrule/delaybetweenattempts/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/accessrule/ipaddress/classes/privacy/provider.php b/mod/quiz/accessrule/ipaddress/classes/privacy/provider.php index 847ca4f0561..a248917e9a1 100644 --- a/mod/quiz/accessrule/ipaddress/classes/privacy/provider.php +++ b/mod/quiz/accessrule/ipaddress/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/accessrule/numattempts/classes/privacy/provider.php b/mod/quiz/accessrule/numattempts/classes/privacy/provider.php index a5c1be21193..7547083eda8 100644 --- a/mod/quiz/accessrule/numattempts/classes/privacy/provider.php +++ b/mod/quiz/accessrule/numattempts/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/accessrule/offlineattempts/classes/privacy/provider.php b/mod/quiz/accessrule/offlineattempts/classes/privacy/provider.php index 9865646e67a..f9ceb831707 100644 --- a/mod/quiz/accessrule/offlineattempts/classes/privacy/provider.php +++ b/mod/quiz/accessrule/offlineattempts/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/accessrule/openclosedate/classes/privacy/provider.php b/mod/quiz/accessrule/openclosedate/classes/privacy/provider.php index 6243299204a..0a034de5ed8 100644 --- a/mod/quiz/accessrule/openclosedate/classes/privacy/provider.php +++ b/mod/quiz/accessrule/openclosedate/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/accessrule/password/classes/privacy/provider.php b/mod/quiz/accessrule/password/classes/privacy/provider.php index 407f3faa23e..237b29c1128 100644 --- a/mod/quiz/accessrule/password/classes/privacy/provider.php +++ b/mod/quiz/accessrule/password/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/accessrule/seb/classes/config_key.php b/mod/quiz/accessrule/seb/classes/config_key.php index 53a5802c6b5..842a58f6c4f 100644 --- a/mod/quiz/accessrule/seb/classes/config_key.php +++ b/mod/quiz/accessrule/seb/classes/config_key.php @@ -55,7 +55,7 @@ class config_key { * @param string $xml A PList XML string, representing SEB config. * @return config_key This config key instance. */ - public static function generate(string $xml) : config_key { + public static function generate(string $xml): config_key { if (!empty($xml) && !helper::is_valid_seb_config($xml)) { throw new \invalid_parameter_exception('Invalid a PList XML string, representing SEB config'); } @@ -77,7 +77,7 @@ class config_key { * * @return string The Config Key hash */ - public function get_hash() : string { + public function get_hash(): string { return $this->hash; } } diff --git a/mod/quiz/accessrule/seb/classes/event/access_prevented.php b/mod/quiz/accessrule/seb/classes/event/access_prevented.php index 03dc8e4629b..4ecc489c8be 100644 --- a/mod/quiz/accessrule/seb/classes/event/access_prevented.php +++ b/mod/quiz/accessrule/seb/classes/event/access_prevented.php @@ -51,7 +51,7 @@ class access_prevented extends base { * @return base */ public static function create_strict(seb_access_manager $accessmanager, string $reason, - ?string $configkey = null, ?string $browserexamkey = null) : base { + ?string $configkey = null, ?string $browserexamkey = null): base { global $USER; $other = []; @@ -109,7 +109,7 @@ class access_prevented extends base { * * @return array Mapping of object id. */ - public static function get_objectid_mapping() : array { + public static function get_objectid_mapping(): array { return ['db' => 'quiz', 'restore' => 'quiz']; } @@ -119,7 +119,7 @@ class access_prevented extends base { * * @return array List of mapping of other ids. */ - public static function get_other_mapping() : array { + public static function get_other_mapping(): array { return [ 'cmid' => ['db' => 'course_modules', 'restore' => 'course_modules'] ]; diff --git a/mod/quiz/accessrule/seb/classes/event/template_created.php b/mod/quiz/accessrule/seb/classes/event/template_created.php index 86c51e774d3..198fca86fce 100644 --- a/mod/quiz/accessrule/seb/classes/event/template_created.php +++ b/mod/quiz/accessrule/seb/classes/event/template_created.php @@ -49,7 +49,7 @@ class template_created extends base { * @param context_system $context Context system. * @return base */ - public static function create_strict(template $template, context_system $context) : base { + public static function create_strict(template $template, context_system $context): base { global $USER; $tid = $template->get('id'); @@ -105,7 +105,7 @@ class template_created extends base { * * @return array Mapping of object id. */ - public static function get_objectid_mapping() : array { + public static function get_objectid_mapping(): array { return ['db' => 'quizaccess_seb_template', 'restore' => 'quizaccess_seb_template']; } @@ -115,7 +115,7 @@ class template_created extends base { * * @return array List of mapping of other ids. */ - public static function get_other_mapping() : array { + public static function get_other_mapping(): array { return []; } } diff --git a/mod/quiz/accessrule/seb/classes/event/template_deleted.php b/mod/quiz/accessrule/seb/classes/event/template_deleted.php index 4e122b52479..93bb69e0901 100644 --- a/mod/quiz/accessrule/seb/classes/event/template_deleted.php +++ b/mod/quiz/accessrule/seb/classes/event/template_deleted.php @@ -48,7 +48,7 @@ class template_deleted extends base { * @param context_system $context Context system. * @return base */ - public static function create_strict(string $id, context_system $context) : base { + public static function create_strict(string $id, context_system $context): base { global $USER; return self::create([ @@ -99,7 +99,7 @@ class template_deleted extends base { * * @return array Mapping of object id. */ - public static function get_objectid_mapping() : array { + public static function get_objectid_mapping(): array { return ['db' => 'quizaccess_seb_template', 'restore' => 'quizaccess_seb_template']; } @@ -109,7 +109,7 @@ class template_deleted extends base { * * @return array List of mapping of other ids. */ - public static function get_other_mapping() : array { + public static function get_other_mapping(): array { return []; } } diff --git a/mod/quiz/accessrule/seb/classes/event/template_disabled.php b/mod/quiz/accessrule/seb/classes/event/template_disabled.php index 8d8eb151035..e4556d01c1d 100644 --- a/mod/quiz/accessrule/seb/classes/event/template_disabled.php +++ b/mod/quiz/accessrule/seb/classes/event/template_disabled.php @@ -49,7 +49,7 @@ class template_disabled extends base { * @param context_system $context Context system. * @return base */ - public static function create_strict(template $template, context_system $context) : base { + public static function create_strict(template $template, context_system $context): base { global $USER; $tid = $template->get('id'); @@ -105,7 +105,7 @@ class template_disabled extends base { * * @return array Mapping of object id. */ - public static function get_objectid_mapping() : array { + public static function get_objectid_mapping(): array { return ['db' => 'quizaccess_seb_template', 'restore' => 'quizaccess_seb_template']; } @@ -115,7 +115,7 @@ class template_disabled extends base { * * @return array List of mapping of other ids. */ - public static function get_other_mapping() : array { + public static function get_other_mapping(): array { return []; } } diff --git a/mod/quiz/accessrule/seb/classes/event/template_enabled.php b/mod/quiz/accessrule/seb/classes/event/template_enabled.php index 8710ece5acd..18ade335b3a 100644 --- a/mod/quiz/accessrule/seb/classes/event/template_enabled.php +++ b/mod/quiz/accessrule/seb/classes/event/template_enabled.php @@ -49,7 +49,7 @@ class template_enabled extends base { * @param context_system $context Context system. * @return base */ - public static function create_strict(template $template, context_system $context) : base { + public static function create_strict(template $template, context_system $context): base { global $USER; $tid = $template->get('id'); @@ -105,7 +105,7 @@ class template_enabled extends base { * * @return array Mapping of object id. */ - public static function get_objectid_mapping() : array { + public static function get_objectid_mapping(): array { return ['db' => 'quizaccess_seb_template', 'restore' => 'quizaccess_seb_template']; } @@ -115,7 +115,7 @@ class template_enabled extends base { * * @return array List of mapping of other ids. */ - public static function get_other_mapping() : array { + public static function get_other_mapping(): array { return []; } } diff --git a/mod/quiz/accessrule/seb/classes/event/template_updated.php b/mod/quiz/accessrule/seb/classes/event/template_updated.php index d94a7118fd2..42fa353516a 100644 --- a/mod/quiz/accessrule/seb/classes/event/template_updated.php +++ b/mod/quiz/accessrule/seb/classes/event/template_updated.php @@ -49,7 +49,7 @@ class template_updated extends base { * @param context_system $context Context system. * @return base */ - public static function create_strict(template $template, context_system $context) : base { + public static function create_strict(template $template, context_system $context): base { global $USER; $tid = $template->get('id'); @@ -105,7 +105,7 @@ class template_updated extends base { * * @return array Mapping of object id. */ - public static function get_objectid_mapping() : array { + public static function get_objectid_mapping(): array { return ['db' => 'quizaccess_seb_template', 'restore' => 'quizaccess_seb_template']; } @@ -115,7 +115,7 @@ class template_updated extends base { * * @return array List of mapping of other ids. */ - public static function get_other_mapping() : array { + public static function get_other_mapping(): array { return []; } } diff --git a/mod/quiz/accessrule/seb/classes/helper.php b/mod/quiz/accessrule/seb/classes/helper.php index 11a4d5c4fc5..9cd263e8918 100644 --- a/mod/quiz/accessrule/seb/classes/helper.php +++ b/mod/quiz/accessrule/seb/classes/helper.php @@ -66,7 +66,7 @@ class helper { * @param string $sebconfig * @return bool */ - public static function is_valid_seb_config(string $sebconfig) : bool { + public static function is_valid_seb_config(string $sebconfig): bool { $result = true; set_error_handler(function($errno, $errstr, $errfile, $errline ){ @@ -93,7 +93,7 @@ class helper { * @param int|null $expiretime Unix timestamp * @return array */ - public static function get_seb_file_headers(int $expiretime = null) : array { + public static function get_seb_file_headers(int $expiretime = null): array { if (is_null($expiretime)) { $expiretime = time(); } @@ -113,7 +113,7 @@ class helper { * @param string $cmid The course module ID for a quiz with config. * @return string SEB config string. */ - public static function get_seb_config_content(string $cmid) : string { + public static function get_seb_config_content(string $cmid): string { // Try and get the course module. $cm = get_coursemodule_from_id('quiz', $cmid, 0, false, MUST_EXIST); diff --git a/mod/quiz/accessrule/seb/classes/link_generator.php b/mod/quiz/accessrule/seb/classes/link_generator.php index 05f204adac0..8a2e3ee57f4 100644 --- a/mod/quiz/accessrule/seb/classes/link_generator.php +++ b/mod/quiz/accessrule/seb/classes/link_generator.php @@ -45,7 +45,7 @@ class link_generator { * @param bool $secure Whether to use HTTPS or HTTP protocol. * @return string A URL. */ - public static function get_link(string $cmid, bool $seb = false, bool $secure = true) : string { + public static function get_link(string $cmid, bool $seb = false, bool $secure = true): string { // Check if course module exists. get_coursemodule_from_id('quiz', $cmid, 0, false, MUST_EXIST); diff --git a/mod/quiz/accessrule/seb/classes/local/table/template_list.php b/mod/quiz/accessrule/seb/classes/local/table/template_list.php index a405b69eb0b..5833234c970 100644 --- a/mod/quiz/accessrule/seb/classes/local/table/template_list.php +++ b/mod/quiz/accessrule/seb/classes/local/table/template_list.php @@ -86,7 +86,7 @@ class template_list extends \flexible_table { * @param \quizaccess_seb\template $data Template for this row. * @return string */ - protected function col_name(template $data) : string { + protected function col_name(template $data): string { return \html_writer::link( new \moodle_url(template_controller::get_base_url(), [ 'id' => $data->get('id'), @@ -102,7 +102,7 @@ class template_list extends \flexible_table { * @param \quizaccess_seb\template $data Template for this row. * @return string */ - protected function col_description(template $data) : string { + protected function col_description(template $data): string { return $data->get('description'); } @@ -132,7 +132,7 @@ class template_list extends \flexible_table { * @param \quizaccess_seb\template $data Template for this row. * @return string */ - protected function col_actions(template $data) : string { + protected function col_actions(template $data): string { $actions = []; $actions[] = helper::format_icon_link( diff --git a/mod/quiz/accessrule/seb/classes/property_list.php b/mod/quiz/accessrule/seb/classes/property_list.php index d6f47c88b81..c479acea4bf 100644 --- a/mod/quiz/accessrule/seb/classes/property_list.php +++ b/mod/quiz/accessrule/seb/classes/property_list.php @@ -197,7 +197,7 @@ class property_list { * * @return string XML ready for creating an XML file. */ - public function to_xml() : string { + public function to_xml(): string { return $this->cfpropertylist->toXML(); } @@ -225,7 +225,7 @@ class property_list { * * @return string A json encoded string. */ - public function to_json() : string { + public function to_json(): string { // Create a clone of the PList, so main list isn't mutated. $jsonplist = new CFPropertyList(); $jsonplist->parse($this->cfpropertylist->toXML(), CFPropertyList::FORMAT_XML); @@ -383,7 +383,7 @@ class property_list { * @param array $array Array containing CFType objects. * @return array Standard PHP array. */ - private function array_serialize_cftypes(array $array) : array { + private function array_serialize_cftypes(array $array): array { $array = new CFDictionary($array); // Convert back to CFDictionary so serialization is recursive. return $array->toArray(); // Serialize. } diff --git a/mod/quiz/accessrule/seb/classes/seb_access_manager.php b/mod/quiz/accessrule/seb/classes/seb_access_manager.php index d195155b190..6664419fa1e 100644 --- a/mod/quiz/accessrule/seb/classes/seb_access_manager.php +++ b/mod/quiz/accessrule/seb/classes/seb_access_manager.php @@ -146,7 +146,7 @@ class seb_access_manager { * * @return bool If required. */ - public function seb_required() : bool { + public function seb_required(): bool { if (!$this->quizsettings) { return false; } else { @@ -221,7 +221,7 @@ class seb_access_manager { * * @return \mod_quiz\quiz_settings */ - public function get_quiz() : quiz_settings { + public function get_quiz(): quiz_settings { return $this->quiz; } diff --git a/mod/quiz/accessrule/seb/classes/seb_quiz_settings.php b/mod/quiz/accessrule/seb/classes/seb_quiz_settings.php index fb2d043dc33..1e338b49786 100644 --- a/mod/quiz/accessrule/seb/classes/seb_quiz_settings.php +++ b/mod/quiz/accessrule/seb/classes/seb_quiz_settings.php @@ -63,7 +63,7 @@ class seb_quiz_settings extends persistent { * * @return array */ - protected static function define_properties() : array { + protected static function define_properties(): array { return [ 'quizid' => [ 'type' => PARAM_INT, @@ -209,7 +209,7 @@ class seb_quiz_settings extends persistent { * @param int $quizid Quiz id. * @return string|null */ - public static function get_config_by_quiz_id(int $quizid) : ?string { + public static function get_config_by_quiz_id(int $quizid): ?string { $config = self::get_config_cache()->get($quizid); if ($config !== false) { @@ -231,7 +231,7 @@ class seb_quiz_settings extends persistent { * @param int $quizid Quiz id. * @return string|null */ - public static function get_config_key_by_quiz_id(int $quizid) : ?string { + public static function get_config_key_by_quiz_id(int $quizid): ?string { $configkey = self::get_config_key_cache()->get($quizid); if ($configkey !== false) { @@ -252,7 +252,7 @@ class seb_quiz_settings extends persistent { * * @return \cache_application */ - private static function get_config_key_cache() : \cache_application { + private static function get_config_key_cache(): \cache_application { return \cache::make('quizaccess_seb', 'configkey'); } @@ -261,7 +261,7 @@ class seb_quiz_settings extends persistent { * * @return \cache_application */ - private static function get_config_cache() : \cache_application { + private static function get_config_cache(): \cache_application { return \cache::make('quizaccess_seb', 'config'); } @@ -270,7 +270,7 @@ class seb_quiz_settings extends persistent { * * @return \cache_application */ - private static function get_quiz_settings_cache() : \cache_application { + private static function get_quiz_settings_cache(): \cache_application { return \cache::make('quizaccess_seb', 'quizsettings'); } @@ -333,7 +333,7 @@ class seb_quiz_settings extends persistent { * * @return array */ - protected function get_allowedbrowserexamkeys() : array { + protected function get_allowedbrowserexamkeys(): array { $keysstring = $this->raw_get('allowedbrowserexamkeys'); $keysstring = empty($keysstring) ? '' : $keysstring; return $this->split_keys($keysstring); @@ -420,7 +420,7 @@ class seb_quiz_settings extends persistent { * * @return string|null */ - public function get_config_key() : ?string { + public function get_config_key(): ?string { $this->process_configs(); return $this->configkey; @@ -431,7 +431,7 @@ class seb_quiz_settings extends persistent { * * @return string|null */ - public function get_config() : ?string { + public function get_config(): ?string { $this->process_configs(); return $this->config; @@ -622,7 +622,7 @@ class seb_quiz_settings extends persistent { * @param bool $isregex Regex or simple. * @return CFDictionary A PList dictionary. */ - private function create_filter_rule(string $rulestring, bool $allowed, bool $isregex) : CFDictionary { + private function create_filter_rule(string $rulestring, bool $allowed, bool $isregex): CFDictionary { $action = $allowed ? 1 : 0; return new CFDictionary([ 'action' => new CFNumber($action), @@ -637,7 +637,7 @@ class seb_quiz_settings extends persistent { * * @return array Moodle setting as key, SEB setting as value. */ - private function get_bool_seb_setting_map() : array { + private function get_bool_seb_setting_map(): array { return [ 'activateurlfiltering' => 'URLFilterEnable', 'allowspellchecking' => 'allowSpellCheck', @@ -661,7 +661,7 @@ class seb_quiz_settings extends persistent { * @param string|null $keys the allowed keys. * @return array of string, the separate keys. */ - private function split_keys($keys) : array { + private function split_keys($keys): array { $keys = preg_split('~[ \t\n\r,;]+~', $keys ?? '', -1, PREG_SPLIT_NO_EMPTY); foreach ($keys as $i => $key) { $keys[$i] = strtolower($key); diff --git a/mod/quiz/accessrule/seb/classes/settings_provider.php b/mod/quiz/accessrule/seb/classes/settings_provider.php index c0551ed711d..f7a8ffdaa10 100644 --- a/mod/quiz/accessrule/seb/classes/settings_provider.php +++ b/mod/quiz/accessrule/seb/classes/settings_provider.php @@ -430,7 +430,7 @@ class settings_provider { * @param \MoodleQuickForm $mform the wrapped MoodleQuickForm. * @return string */ - protected static function get_uploaded_seb_file_download_link(\mod_quiz_mod_form $quizform, \MoodleQuickForm $mform) : string { + protected static function get_uploaded_seb_file_download_link(\mod_quiz_mod_form $quizform, \MoodleQuickForm $mform): string { $link = ''; $file = self::get_module_context_sebconfig_file($quizform->get_coursemodule()->id); @@ -457,7 +457,7 @@ class settings_provider { * * @return array All quiz form elements to be added and their types. */ - public static function get_seb_config_elements() : array { + public static function get_seb_config_elements(): array { return [ 'seb_linkquitseb' => 'text', 'seb_userconfirmquit' => 'selectyesno', @@ -486,7 +486,7 @@ class settings_provider { * Get the types of the quiz settings elements. * @return array List of types for the setting elements. */ - public static function get_seb_config_element_types() : array { + public static function get_seb_config_element_types(): array { return [ 'seb_linkquitseb' => PARAM_RAW, 'seb_userconfirmquit' => PARAM_BOOL, @@ -558,7 +558,7 @@ class settings_provider { * @param \context $context Context used with capability checking selection options. * @return array */ - public static function get_requiresafeexambrowser_options(\context $context) : array { + public static function get_requiresafeexambrowser_options(\context $context): array { $options[self::USE_SEB_NO] = get_string('no'); if (self::can_configure_manually($context) || self::is_conflicting_permissions($context)) { @@ -584,7 +584,7 @@ class settings_provider { * Returns a list of templates. * @return array */ - protected static function get_template_options() : array { + protected static function get_template_options(): array { $templates = []; $records = template::get_records(['enabled' => 1], 'name'); if ($records) { @@ -600,7 +600,7 @@ class settings_provider { * Returns a list of options for the file manager element. * @return array */ - public static function get_filemanager_options() : array { + public static function get_filemanager_options(): array { return [ 'subdirs' => 0, 'maxfiles' => 1, @@ -615,7 +615,7 @@ class settings_provider { * * @return array List of settings and their defaults. */ - public static function get_seb_config_element_defaults() : array { + public static function get_seb_config_element_defaults(): array { return [ 'seb_linkquitseb' => '', 'seb_userconfirmquit' => 1, @@ -673,7 +673,7 @@ class settings_provider { * @param string $itemid Item ID of the file. * @return stored_file|null Returns null if no file is found. */ - public static function get_current_user_draft_file(string $itemid) : ?stored_file { + public static function get_current_user_draft_file(string $itemid): ?stored_file { global $USER; $context = context_user::instance($USER->id); $fs = get_file_storage(); @@ -689,7 +689,7 @@ class settings_provider { * @param string $cmid The course module id which is used as an itemid reference. * @return stored_file|null Returns null if no file is found. */ - public static function get_module_context_sebconfig_file(string $cmid) : ?stored_file { + public static function get_module_context_sebconfig_file(string $cmid): ?stored_file { $fs = new \file_storage(); $context = context_module::instance($cmid); @@ -708,7 +708,7 @@ class settings_provider { * @param string $cmid The cmid of for the quiz. * @return bool Always true */ - public static function save_filemanager_sebconfigfile_draftarea(string $draftitemid, string $cmid) : bool { + public static function save_filemanager_sebconfigfile_draftarea(string $draftitemid, string $cmid): bool { if ($draftitemid) { $context = context_module::instance($cmid); file_save_draft_area_files($draftitemid, $context->id, 'quizaccess_seb', 'filemanager_sebconfigfile', @@ -725,7 +725,7 @@ class settings_provider { * @param string $cmid The cmid of for the quiz. * @return bool Always true or exception if error occurred */ - public static function delete_uploaded_config_file(string $cmid) : bool { + public static function delete_uploaded_config_file(string $cmid): bool { $file = self::get_module_context_sebconfig_file($cmid); if (!empty($file)) { @@ -741,7 +741,7 @@ class settings_provider { * @param \context $context Context to check access in. * @return bool */ - public static function can_configure_seb(\context $context) : bool { + public static function can_configure_seb(\context $context): bool { return has_capability('quizaccess/seb:manage_seb_requiresafeexambrowser', $context); } @@ -751,7 +751,7 @@ class settings_provider { * @param \context $context Context to check access in. * @return bool */ - public static function can_use_seb_template(\context $context) : bool { + public static function can_use_seb_template(\context $context): bool { return has_capability('quizaccess/seb:manage_seb_templateid', $context); } @@ -761,7 +761,7 @@ class settings_provider { * @param \context $context Context to check access in. * @return bool */ - public static function can_upload_seb_file(\context $context) : bool { + public static function can_upload_seb_file(\context $context): bool { return has_capability('quizaccess/seb:manage_filemanager_sebconfigfile', $context); } @@ -771,7 +771,7 @@ class settings_provider { * @param \context $context Context to check access in. * @return bool */ - public static function can_change_seb_showsebdownloadlink(\context $context) : bool { + public static function can_change_seb_showsebdownloadlink(\context $context): bool { return has_capability('quizaccess/seb:manage_seb_showsebdownloadlink', $context); } @@ -781,7 +781,7 @@ class settings_provider { * @param \context $context Context to check access in. * @return bool */ - public static function can_change_seb_allowedbrowserexamkeys(\context $context) : bool { + public static function can_change_seb_allowedbrowserexamkeys(\context $context): bool { return has_capability('quizaccess/seb:manage_seb_allowedbrowserexamkeys', $context); } @@ -791,7 +791,7 @@ class settings_provider { * @param \context $context Context to check access in. * @return bool */ - public static function can_configure_manually(\context $context) : bool { + public static function can_configure_manually(\context $context): bool { foreach (self::get_seb_config_elements() as $name => $type) { if (self::can_manage_seb_config_setting($name, $context)) { return true; @@ -808,7 +808,7 @@ class settings_provider { * @param \context $context Context to check access in. * @return bool */ - public static function can_manage_seb_config_setting(string $settingname, \context $context) : bool { + public static function can_manage_seb_config_setting(string $settingname, \context $context): bool { $capsttocheck = []; foreach (self::get_seb_settings_map() as $type => $settings) { @@ -835,7 +835,7 @@ class settings_provider { * @param array $settings A list of settings to go through. * @return array */ - protected static function build_config_capabilities_to_check(string $settingname, array $settings) : array { + protected static function build_config_capabilities_to_check(string $settingname, array $settings): array { $capsttocheck = []; foreach ($settings as $setting => $children) { @@ -861,7 +861,7 @@ class settings_provider { * * @return array */ - public static function get_seb_settings_map() : array { + public static function get_seb_settings_map(): array { return [ self::USE_SEB_NO => [ @@ -917,7 +917,7 @@ class settings_provider { * @param int $requiresafeexambrowser SEB usage type. * @return array */ - private static function get_allowed_settings(int $requiresafeexambrowser) : array { + private static function get_allowed_settings(int $requiresafeexambrowser): array { $result = []; $map = self::get_seb_settings_map(); @@ -934,7 +934,7 @@ class settings_provider { * @param array $settings A list of settings from settings map. * @return array */ - private static function build_allowed_settings(array $settings) : array { + private static function build_allowed_settings(array $settings): array { $result = []; foreach ($settings as $name => $children) { @@ -956,7 +956,7 @@ class settings_provider { * * @return array List of rules per element. */ - public static function get_quiz_hideifs() : array { + public static function get_quiz_hideifs(): array { $hideifs = []; // We are building rules based on the settings map, that means children will be dependant on parent. @@ -1009,7 +1009,7 @@ class settings_provider { * @param string $settingname Name of the setting. * @return string */ - public static function build_setting_capability_name(string $settingname) : string { + public static function build_setting_capability_name(string $settingname): string { if (!key_exists($settingname, self::get_seb_config_elements())) { throw new \coding_exception('Incorrect SEB quiz setting ' . $settingname); } @@ -1023,7 +1023,7 @@ class settings_provider { * @param int $quizid Quiz ID. * @return bool */ - public static function is_seb_settings_locked($quizid) : bool { + public static function is_seb_settings_locked($quizid): bool { if (empty($quizid)) { return false; } @@ -1054,7 +1054,7 @@ class settings_provider { * @param stdClass $settings Quiz settings. * @return \stdClass */ - private static function filter_by_settings_map(stdClass $settings) : stdClass { + private static function filter_by_settings_map(stdClass $settings): stdClass { if (!isset($settings->seb_requiresafeexambrowser)) { return $settings; } @@ -1081,7 +1081,7 @@ class settings_provider { * @param stdClass $settings Quiz settings. * @return stdClass Filtered settings. */ - public static function filter_plugin_settings(stdClass $settings) : stdClass { + public static function filter_plugin_settings(stdClass $settings): stdClass { $settings = self::filter_by_prefix($settings); $settings = self::filter_by_settings_map($settings); diff --git a/mod/quiz/accessrule/seb/classes/template.php b/mod/quiz/accessrule/seb/classes/template.php index c92262ea9c7..db021417c4a 100644 --- a/mod/quiz/accessrule/seb/classes/template.php +++ b/mod/quiz/accessrule/seb/classes/template.php @@ -121,7 +121,7 @@ class template extends persistent { * * @return bool */ - public function can_delete() : bool { + public function can_delete(): bool { $result = true; if ($this->get('id')) { diff --git a/mod/quiz/accessrule/seb/classes/template_controller.php b/mod/quiz/accessrule/seb/classes/template_controller.php index 7613a5b6976..97bd63aa9d0 100644 --- a/mod/quiz/accessrule/seb/classes/template_controller.php +++ b/mod/quiz/accessrule/seb/classes/template_controller.php @@ -150,7 +150,7 @@ class template_controller { * Returns a text for create new record button. * @return string */ - protected function get_create_button_text() : string { + protected function get_create_button_text(): string { return get_string('addtemplate', 'quizaccess_seb'); } @@ -161,7 +161,7 @@ class template_controller { * * @return \quizaccess_seb\local\form\template */ - protected function get_form($instance) : \quizaccess_seb\local\form\template { + protected function get_form($instance): \quizaccess_seb\local\form\template { global $PAGE; return new \quizaccess_seb\local\form\template($PAGE->url->out(false), ['persistent' => $instance]); @@ -171,7 +171,7 @@ class template_controller { * View page heading string. * @return string */ - protected function get_view_heading() : string { + protected function get_view_heading(): string { return get_string('managetemplates', 'quizaccess_seb'); } @@ -179,7 +179,7 @@ class template_controller { * New record heading string. * @return string */ - protected function get_new_heading() : string { + protected function get_new_heading(): string { return get_string('newtemplate', 'quizaccess_seb'); } @@ -187,7 +187,7 @@ class template_controller { * Edit record heading string. * @return string */ - protected function get_edit_heading() : string { + protected function get_edit_heading(): string { return get_string('edittemplate', 'quizaccess_seb'); } @@ -195,7 +195,7 @@ class template_controller { * Returns base URL for the manager. * @return string */ - public static function get_base_url() : string { + public static function get_base_url(): string { return '/mod/quiz/accessrule/seb/template.php'; } diff --git a/mod/quiz/accessrule/seb/rule.php b/mod/quiz/accessrule/seb/rule.php index 8ed6029c064..d92a3e9c626 100644 --- a/mod/quiz/accessrule/seb/rule.php +++ b/mod/quiz/accessrule/seb/rule.php @@ -89,7 +89,7 @@ class quizaccess_seb extends access_rule_base { * @return array $errors the updated $errors array. */ public static function validate_settings_form_fields(array $errors, - array $data, $files, mod_quiz_mod_form $quizform) : array { + array $data, $files, mod_quiz_mod_form $quizform): array { $quizid = $data['instance']; $cmid = $data['coursemodule']; @@ -235,7 +235,7 @@ class quizaccess_seb extends access_rule_base { * used named placeholders, and the placeholder names should start with the * plugin name, to avoid collisions. */ - public static function get_settings_sql($quizid) : array { + public static function get_settings_sql($quizid): array { return [ 'seb.requiresafeexambrowser AS seb_requiresafeexambrowser, ' . 'seb.showsebtaskbar AS seb_showsebtaskbar, ' @@ -323,7 +323,7 @@ class quizaccess_seb extends access_rule_base { * * @return array */ - private function get_user_finished_attempts() : array { + private function get_user_finished_attempts(): array { global $USER; return quiz_get_user_attempts( @@ -361,7 +361,7 @@ class quizaccess_seb extends access_rule_base { * @param string $identifier Reason string identifier. * @return string */ - private function get_reason_text(string $identifier) : string { + private function get_reason_text(string $identifier): string { if (in_array($identifier, ['not_seb', 'invalid_config_key', 'invalid_browser_key'])) { return get_string($identifier, 'quizaccess_seb'); } @@ -374,7 +374,7 @@ class quizaccess_seb extends access_rule_base { * * @return string */ - private function get_invalid_key_error_message() : string { + private function get_invalid_key_error_message(): string { // Return error message with download link and links to get the seb config. return get_string('invalidkeys', 'quizaccess_seb') . $this->display_buttons($this->get_action_buttons()); @@ -385,7 +385,7 @@ class quizaccess_seb extends access_rule_base { * * @return string */ - private function get_require_seb_error_message() : string { + private function get_require_seb_error_message(): string { $message = get_string('clientrequiresseb', 'quizaccess_seb'); if ($this->should_display_download_seb_link()) { @@ -401,7 +401,7 @@ class quizaccess_seb extends access_rule_base { * * @return string empty or a button which has the configured seb quit link. */ - private function get_quit_button() : string { + private function get_quit_button(): string { $quitbutton = ''; if (empty($this->get_user_finished_attempts())) { @@ -428,7 +428,7 @@ class quizaccess_seb extends access_rule_base { * @return mixed a message, or array of messages, explaining the restriction * (may be '' if no message is appropriate). */ - public function description() : array { + public function description(): array { global $PAGE; $messages = [get_string('sebrequired', 'quizaccess_seb')]; @@ -478,7 +478,7 @@ class quizaccess_seb extends access_rule_base { * * @return string HTML code of the provided buttons. */ - private function display_buttons(string $buttonshtml, $class = '', array $attributes = null) : string { + private function display_buttons(string $buttonshtml, $class = '', array $attributes = null): string { $html = ''; if (!empty($buttonshtml)) { @@ -493,7 +493,7 @@ class quizaccess_seb extends access_rule_base { * * @return string Html block of all action buttons. */ - private function get_action_buttons() : string { + private function get_action_buttons(): string { $buttons = ''; if ($this->should_display_download_seb_link()) { @@ -522,7 +522,7 @@ class quizaccess_seb extends access_rule_base { * * @return string A link to download SafeExam Browser. */ - private function get_download_seb_button() : string { + private function get_download_seb_button(): string { global $OUTPUT; $button = ''; @@ -539,7 +539,7 @@ class quizaccess_seb extends access_rule_base { * * @return string A link to launch Safe Exam Browser. */ - private function get_launch_seb_button() : string { + private function get_launch_seb_button(): string { // Rendering as a href and not as button in a form to circumvent browser warnings for sending to URL with unknown protocol. $seblink = \quizaccess_seb\link_generator::get_link($this->quiz->cmid, true, is_https()); @@ -556,7 +556,7 @@ class quizaccess_seb extends access_rule_base { * * @return string A link to launch Safe Exam Browser. */ - private function get_download_config_button() : string { + private function get_download_config_button(): string { // Rendering as a href and not as button in a form to circumvent browser warnings for sending to URL with unknown protocol. $httplink = \quizaccess_seb\link_generator::get_link($this->quiz->cmid, false, is_https()); @@ -573,7 +573,7 @@ class quizaccess_seb extends access_rule_base { * * @return string */ - private function get_seb_download_url() : string { + private function get_seb_download_url(): string { return get_config('quizaccess_seb', 'downloadlink'); } @@ -582,7 +582,7 @@ class quizaccess_seb extends access_rule_base { * * @return bool */ - private function should_display_download_seb_link() : bool { + private function should_display_download_seb_link(): bool { return !empty($this->quiz->seb_showsebdownloadlink); } } diff --git a/mod/quiz/accessrule/seb/tests/config_key_test.php b/mod/quiz/accessrule/seb/tests/config_key_test.php index cf21162b42a..ed50bf47922 100644 --- a/mod/quiz/accessrule/seb/tests/config_key_test.php +++ b/mod/quiz/accessrule/seb/tests/config_key_test.php @@ -59,7 +59,7 @@ class config_key_test extends \advanced_testcase { * * @return array */ - public function real_ck_hash_provider() : array { + public function real_ck_hash_provider(): array { return [ 'unencrypted_mac2.1.4' => ['unencrypted_mac_001.seb', '4fa9af8ec8759eb7c680752ef4ee5eaf1a860628608fccae2715d519849f9292', ''], diff --git a/mod/quiz/accessrule/seb/tests/property_list_test.php b/mod/quiz/accessrule/seb/tests/property_list_test.php index 50eef499869..1cf90976d6e 100644 --- a/mod/quiz/accessrule/seb/tests/property_list_test.php +++ b/mod/quiz/accessrule/seb/tests/property_list_test.php @@ -281,7 +281,7 @@ class property_list_test extends \advanced_testcase { * * @return string */ - private function get_plist_xml_header() : string { + private function get_plist_xml_header(): string { return "\n" . "\n" @@ -294,7 +294,7 @@ class property_list_test extends \advanced_testcase { * * @return string */ - private function get_plist_xml_footer() : string { + private function get_plist_xml_footer(): string { return " \n" . ""; } @@ -304,7 +304,7 @@ class property_list_test extends \advanced_testcase { * * @return array Array with test data. */ - public function good_update_data_provider() : array { + public function good_update_data_provider(): array { return [ 'Update string' => ['testKeytestValue', 'testKey', 'newValue'], 'Update bool' => ['testKey', 'testKey', false], @@ -317,7 +317,7 @@ class property_list_test extends \advanced_testcase { * * @return array Array with test data. */ - public function bad_update_data_provider() : array { + public function bad_update_data_provider(): array { return [ 'Update string with bool' => ['testKeytestValue', 'testKey', true, 'testValue', @@ -379,7 +379,7 @@ class property_list_test extends \advanced_testcase { * * @return array */ - public function json_data_provider() : array { + public function json_data_provider(): array { $data = "blahblah"; $base64data = base64_encode($data); diff --git a/mod/quiz/accessrule/seb/tests/quiz_settings_test.php b/mod/quiz/accessrule/seb/tests/quiz_settings_test.php index 22432ef5b54..a1603607ea0 100644 --- a/mod/quiz/accessrule/seb/tests/quiz_settings_test.php +++ b/mod/quiz/accessrule/seb/tests/quiz_settings_test.php @@ -531,7 +531,7 @@ class quiz_settings_test extends \advanced_testcase { * * @return array */ - public function bad_browser_exam_key_provider() : array { + public function bad_browser_exam_key_provider(): array { return [ 'Short string' => ['fdsf434r', 'A key should be a 64-character hex string.'], @@ -547,7 +547,7 @@ class quiz_settings_test extends \advanced_testcase { * * @return array Test data. */ - public function filter_rules_provider() : array { + public function filter_rules_provider(): array { return [ 'enabled simple expessions' => [ (object) [ diff --git a/mod/quiz/accessrule/seb/tests/rule_test.php b/mod/quiz/accessrule/seb/tests/rule_test.php index 9860f400683..651bfa2c983 100644 --- a/mod/quiz/accessrule/seb/tests/rule_test.php +++ b/mod/quiz/accessrule/seb/tests/rule_test.php @@ -87,7 +87,7 @@ class rule_test extends \advanced_testcase { * * @return array */ - public function valid_form_data_provider() : array { + public function valid_form_data_provider(): array { return [ 'valid seb_requiresafeexambrowser' => ['seb_requiresafeexambrowser', '0'], 'valid seb_linkquitseb0' => ['seb_linkquitseb', 'http://safeexambrowser.org/macosx'], @@ -103,7 +103,7 @@ class rule_test extends \advanced_testcase { * * @return array */ - public function invalid_form_data_provider() : array { + public function invalid_form_data_provider(): array { return [ 'invalid seb_requiresafeexambrowser' => ['seb_requiresafeexambrowser', 'Uh oh!'], 'invalid seb_linkquitseb0' => ['seb_linkquitseb', '\0'], diff --git a/mod/quiz/accessrule/seb/tests/test_helper_trait.php b/mod/quiz/accessrule/seb/tests/test_helper_trait.php index 6101270b3b3..8c59bbe063c 100644 --- a/mod/quiz/accessrule/seb/tests/test_helper_trait.php +++ b/mod/quiz/accessrule/seb/tests/test_helper_trait.php @@ -88,7 +88,7 @@ trait quizaccess_seb_test_helper_trait { * @param \stdClass $settings Object containing settings. * @return \stdClass The modified settings object. */ - protected function strip_all_prefixes(\stdClass $settings) : \stdClass { + protected function strip_all_prefixes(\stdClass $settings): \stdClass { $newsettings = new \stdClass(); foreach ($settings as $name => $setting) { $newname = preg_replace("/^seb_/", "", $name); @@ -103,7 +103,7 @@ trait quizaccess_seb_test_helper_trait { * @param string $xml * @return int The user draftarea id */ - protected function create_test_draftarea_file(string $xml) : int { + protected function create_test_draftarea_file(string $xml): int { global $USER; $itemid = 0; @@ -133,7 +133,7 @@ trait quizaccess_seb_test_helper_trait { * @param string $cmid Course module id. * @return int Item ID of file. */ - protected function create_module_test_file(string $xml, string $cmid) : int { + protected function create_module_test_file(string $xml, string $cmid): int { $itemid = 0; $fs = get_file_storage(); $filerecord = [ @@ -280,7 +280,7 @@ trait quizaccess_seb_test_helper_trait { * * @return \stdClass Settings. */ - protected function get_test_settings(array $settings = []) : \stdClass { + protected function get_test_settings(array $settings = []): \stdClass { return (object) array_merge([ 'quizid' => 1, 'cmid' => 1, diff --git a/mod/quiz/accessrule/securewindow/classes/privacy/provider.php b/mod/quiz/accessrule/securewindow/classes/privacy/provider.php index cf4d557d005..1f50b00d11e 100644 --- a/mod/quiz/accessrule/securewindow/classes/privacy/provider.php +++ b/mod/quiz/accessrule/securewindow/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/accessrule/timelimit/classes/privacy/provider.php b/mod/quiz/accessrule/timelimit/classes/privacy/provider.php index 56dd1097852..27680969b34 100644 --- a/mod/quiz/accessrule/timelimit/classes/privacy/provider.php +++ b/mod/quiz/accessrule/timelimit/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/classes/analytics/indicator/cognitive_depth.php b/mod/quiz/classes/analytics/indicator/cognitive_depth.php index 608ae54cfdc..d3ec969498a 100644 --- a/mod/quiz/classes/analytics/indicator/cognitive_depth.php +++ b/mod/quiz/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_quiz'); } diff --git a/mod/quiz/classes/analytics/indicator/social_breadth.php b/mod/quiz/classes/analytics/indicator/social_breadth.php index 14b45b673b0..341e48d9b4b 100644 --- a/mod/quiz/classes/analytics/indicator/social_breadth.php +++ b/mod/quiz/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_quiz'); } diff --git a/mod/quiz/classes/output/edit_renderer.php b/mod/quiz/classes/output/edit_renderer.php index 8aea20137ac..9c85c39e115 100644 --- a/mod/quiz/classes/output/edit_renderer.php +++ b/mod/quiz/classes/output/edit_renderer.php @@ -794,7 +794,7 @@ class edit_renderer extends \plugin_renderer_base { * @param int $slot the slot on the page we are outputting. * @return string HTML to output. */ - public function get_checkbox_render(structure $structure, int $slot) : string { + public function get_checkbox_render(structure $structure, int $slot): string { $questionslot = $structure->get_displayed_number_for_slot($slot); $checkbox = new \core\output\checkbox_toggleall($this->togglegroup, false, [ @@ -816,7 +816,7 @@ class edit_renderer extends \plugin_renderer_base { * @param \moodle_url $pageurl the canonical URL of this page. * @return string HTML to output. */ - public function get_question_name_for_slot(structure $structure, int $slot, \moodle_url $pageurl) : string { + public function get_question_name_for_slot(structure $structure, int $slot, \moodle_url $pageurl): string { // Display the link to the question (or do nothing if question has no url). if ($structure->get_question_type_for_slot($slot) === 'random') { $questionname = $this->random_question($structure, $slot, $pageurl); @@ -835,7 +835,7 @@ class edit_renderer extends \plugin_renderer_base { * @param \moodle_url $pageurl the canonical URL of this page. * @return string HTML to output. */ - public function get_action_icon(structure $structure, int $slot, \moodle_url $pageurl) : string { + public function get_action_icon(structure $structure, int $slot, \moodle_url $pageurl): string { // Action icons. $qtype = $structure->get_question_type_for_slot($slot); $slotinfo = $structure->get_slot_by_number($slot); diff --git a/mod/quiz/classes/privacy/legacy_quizaccess_polyfill.php b/mod/quiz/classes/privacy/legacy_quizaccess_polyfill.php index 786befdb84f..02a9dde53b7 100644 --- a/mod/quiz/classes/privacy/legacy_quizaccess_polyfill.php +++ b/mod/quiz/classes/privacy/legacy_quizaccess_polyfill.php @@ -43,7 +43,7 @@ trait legacy_quizaccess_polyfill { * @param \stdClass $user The user to export data for * @return \stdClass The data to be exported for this access rule. */ - public static function export_quizaccess_user_data(\mod_quiz\quiz_settings $quiz, \stdClass $user) : \stdClass { + public static function export_quizaccess_user_data(\mod_quiz\quiz_settings $quiz, \stdClass $user): \stdClass { return static::_export_quizaccess_user_data($quiz, $user); } diff --git a/mod/quiz/classes/privacy/provider.php b/mod/quiz/classes/privacy/provider.php index c0ca490e9ab..b7e6984c71f 100644 --- a/mod/quiz/classes/privacy/provider.php +++ b/mod/quiz/classes/privacy/provider.php @@ -63,7 +63,7 @@ class provider implements * @param collection $items The collection to add metadata to. * @return collection The array of metadata */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { // The table 'quiz' stores a record for each quiz. // It does not contain user personal data, but data is returned from it for contextual requirements. @@ -140,7 +140,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $resultset = new contextlist(); // Users who attempted the quiz. diff --git a/mod/quiz/classes/privacy/quizaccess_provider.php b/mod/quiz/classes/privacy/quizaccess_provider.php index 385e80d0c9a..248a40866c0 100644 --- a/mod/quiz/classes/privacy/quizaccess_provider.php +++ b/mod/quiz/classes/privacy/quizaccess_provider.php @@ -44,7 +44,7 @@ interface quizaccess_provider extends \core_privacy\local\request\plugin\subplug * @param \stdClass $user The user to export data for * @return \stdClass The data to be exported for this access rule. */ - public static function export_quizaccess_user_data(\mod_quiz\quiz_settings $quiz, \stdClass $user) : \stdClass; + public static function export_quizaccess_user_data(\mod_quiz\quiz_settings $quiz, \stdClass $user): \stdClass; /** * Delete all data for all users in the specified quiz. diff --git a/mod/quiz/classes/quiz_attempt.php b/mod/quiz/classes/quiz_attempt.php index eab5e36fbc8..09ed517812d 100644 --- a/mod/quiz/classes/quiz_attempt.php +++ b/mod/quiz/classes/quiz_attempt.php @@ -1116,7 +1116,7 @@ class quiz_attempt { * @param int $page the page number (starting with 0) in the attempt. * @return string attempt page title. */ - public function attempt_page_title(int $page) : string { + public function attempt_page_title(int $page): string { if ($this->get_num_pages() > 1) { $a = new stdClass(); $a->name = $this->get_quiz_name(); @@ -1149,7 +1149,7 @@ class quiz_attempt { * * @return string summary page title. */ - public function summary_page_title() : string { + public function summary_page_title(): string { return get_string('attemptsummarytitle', 'quiz', $this->get_quiz_name()); } @@ -1178,7 +1178,7 @@ class quiz_attempt { * @param bool $showall whether the review page contains the entire attempt on one page. * @return string title of the review page. */ - public function review_page_title(int $page, bool $showall = false) : string { + public function review_page_title(int $page, bool $showall = false): string { if (!$showall && $this->get_num_pages() > 1) { $a = new stdClass(); $a->name = $this->get_quiz_name(); diff --git a/mod/quiz/report/grading/classes/privacy/provider.php b/mod/quiz/report/grading/classes/privacy/provider.php index de4cd0e8864..27e4b712551 100644 --- a/mod/quiz/report/grading/classes/privacy/provider.php +++ b/mod/quiz/report/grading/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements * @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_user_preference('quiz_grading_pagesize', 'privacy:preference:pagesize'); $collection->add_user_preference('quiz_grading_order', 'privacy:preference:order'); diff --git a/mod/quiz/report/overview/classes/privacy/provider.php b/mod/quiz/report/overview/classes/privacy/provider.php index 2e01395137d..23447c969c8 100644 --- a/mod/quiz/report/overview/classes/privacy/provider.php +++ b/mod/quiz/report/overview/classes/privacy/provider.php @@ -47,7 +47,7 @@ class provider implements * @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_user_preference('quiz_overview_slotmarks', 'privacy:metadata:preference:quiz_overview_slotmarks'); return $collection; diff --git a/mod/quiz/report/responses/classes/privacy/provider.php b/mod/quiz/report/responses/classes/privacy/provider.php index 95e213b6da0..a934e68dc5f 100644 --- a/mod/quiz/report/responses/classes/privacy/provider.php +++ b/mod/quiz/report/responses/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('quiz_report_responses_qtext', 'privacy:preference:qtext'); $collection->add_user_preference('quiz_report_responses_resp', 'privacy:preference:resp'); $collection->add_user_preference('quiz_report_responses_right', 'privacy:preference:right'); diff --git a/mod/quiz/report/statistics/classes/privacy/provider.php b/mod/quiz/report/statistics/classes/privacy/provider.php index 07cbcc15ec4..efdc1348146 100644 --- a/mod/quiz/report/statistics/classes/privacy/provider.php +++ b/mod/quiz/report/statistics/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/quiz/report/statistics/statistics_table.php b/mod/quiz/report/statistics/statistics_table.php index d4ed71ab357..a8442b45d9d 100644 --- a/mod/quiz/report/statistics/statistics_table.php +++ b/mod/quiz/report/statistics/statistics_table.php @@ -137,7 +137,7 @@ class quiz_statistics_table extends flexible_table { /** * Open a div tag to wrap statistics table. */ - public function wrap_html_start() { + public function wrap_html_start() { // Horrible Moodle 2.0 wide-content work-around. if (!$this->is_downloading()) { echo html_writer::start_tag('div', ['id' => 'tablecontainer', diff --git a/mod/resource/classes/analytics/indicator/cognitive_depth.php b/mod/resource/classes/analytics/indicator/cognitive_depth.php index e91986c6d5d..36c3f3f8b7c 100644 --- a/mod/resource/classes/analytics/indicator/cognitive_depth.php +++ b/mod/resource/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_resource'); } diff --git a/mod/resource/classes/analytics/indicator/social_breadth.php b/mod/resource/classes/analytics/indicator/social_breadth.php index 33fbbcbc6a6..f77498d3c8f 100644 --- a/mod/resource/classes/analytics/indicator/social_breadth.php +++ b/mod/resource/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_resource'); } diff --git a/mod/resource/classes/privacy/provider.php b/mod/resource/classes/privacy/provider.php index 257240ee670..7993a9dd452 100644 --- a/mod/resource/classes/privacy/provider.php +++ b/mod/resource/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/mod/resource/lib.php b/mod/resource/lib.php index 7c0cd8b8305..a81216293e0 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -596,7 +596,7 @@ function mod_resource_core_calendar_provide_event_action(calendar_event $event, * @param array $args The path (the part after the filearea and before the filename). * @return array The itemid and the filepath inside the $args path, for the defined filearea. */ -function mod_resource_get_path_from_pluginfile(string $filearea, array $args) : array { +function mod_resource_get_path_from_pluginfile(string $filearea, array $args): array { // Resource never has an itemid (the number represents the revision but it's not stored in database). array_shift($args); diff --git a/mod/scorm/classes/analytics/indicator/cognitive_depth.php b/mod/scorm/classes/analytics/indicator/cognitive_depth.php index 42f37e22e1f..5eaed9ef7bb 100644 --- a/mod/scorm/classes/analytics/indicator/cognitive_depth.php +++ b/mod/scorm/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_scorm'); } diff --git a/mod/scorm/classes/analytics/indicator/social_breadth.php b/mod/scorm/classes/analytics/indicator/social_breadth.php index a4ba3a6be6c..6a1b026de1e 100644 --- a/mod/scorm/classes/analytics/indicator/social_breadth.php +++ b/mod/scorm/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_scorm'); } diff --git a/mod/scorm/classes/privacy/provider.php b/mod/scorm/classes/privacy/provider.php index 14cb1103c82..36b6254a32c 100644 --- a/mod/scorm/classes/privacy/provider.php +++ b/mod/scorm/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @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('scorm_attempt', [ 'userid' => 'privacy:metadata:userid', 'attempt' => 'privacy:metadata:attempt', @@ -82,7 +82,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {%s} ss JOIN {modules} m diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index c23092032c4..f7b2783d1f9 100644 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -1801,7 +1801,7 @@ function mod_scorm_core_calendar_get_valid_event_timestart_range(\calendar_event * @param array $args The path (the part after the filearea and before the filename). * @return array The itemid and the filepath inside the $args path, for the defined filearea. */ -function mod_scorm_get_path_from_pluginfile(string $filearea, array $args) : array { +function mod_scorm_get_path_from_pluginfile(string $filearea, array $args): array { // SCORM never has an itemid (the number represents the revision but it's not stored in database). array_shift($args); diff --git a/mod/scorm/report/basic/classes/privacy/provider.php b/mod/scorm/report/basic/classes/privacy/provider.php index 1f0c72c6c0a..a2b1679f29d 100644 --- a/mod/scorm/report/basic/classes/privacy/provider.php +++ b/mod/scorm/report/basic/classes/privacy/provider.php @@ -46,7 +46,7 @@ class provider implements * @param collection $collection The initialised item 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 { // User preferences shared between different scorm reports. $collection->add_user_preference('scorm_report_pagesize', 'privacy:metadata:preference:scorm_report_pagesize'); diff --git a/mod/scorm/report/graphs/classes/privacy/provider.php b/mod/scorm/report/graphs/classes/privacy/provider.php index d68c521c8e7..35fddb16c76 100644 --- a/mod/scorm/report/graphs/classes/privacy/provider.php +++ b/mod/scorm/report/graphs/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/scorm/report/interactions/classes/privacy/provider.php b/mod/scorm/report/interactions/classes/privacy/provider.php index 06c10dbb0cb..fd1856e1051 100644 --- a/mod/scorm/report/interactions/classes/privacy/provider.php +++ b/mod/scorm/report/interactions/classes/privacy/provider.php @@ -46,7 +46,7 @@ class provider implements * @param collection $collection The initialised item 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 { // User preferences shared between different scorm reports. $collection->add_user_preference('scorm_report_pagesize', 'privacy:metadata:preference:scorm_report_pagesize'); diff --git a/mod/scorm/report/objectives/classes/privacy/provider.php b/mod/scorm/report/objectives/classes/privacy/provider.php index 48465c7a35c..b7a30986925 100644 --- a/mod/scorm/report/objectives/classes/privacy/provider.php +++ b/mod/scorm/report/objectives/classes/privacy/provider.php @@ -46,7 +46,7 @@ class provider implements * @param collection $collection The initialised item 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 { // User preferences shared between different scorm reports. $collection->add_user_preference('scorm_report_pagesize', 'privacy:metadata:preference:scorm_report_pagesize'); diff --git a/mod/survey/classes/analytics/indicator/cognitive_depth.php b/mod/survey/classes/analytics/indicator/cognitive_depth.php index 1065cd25fd1..5d0e60af2fe 100644 --- a/mod/survey/classes/analytics/indicator/cognitive_depth.php +++ b/mod/survey/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_survey'); } diff --git a/mod/survey/classes/analytics/indicator/social_breadth.php b/mod/survey/classes/analytics/indicator/social_breadth.php index 5673b0e4137..1f4e78734e6 100644 --- a/mod/survey/classes/analytics/indicator/social_breadth.php +++ b/mod/survey/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_survey'); } diff --git a/mod/survey/classes/privacy/provider.php b/mod/survey/classes/privacy/provider.php index d31ffb99c1b..0e1ea6fee96 100644 --- a/mod/survey/classes/privacy/provider.php +++ b/mod/survey/classes/privacy/provider.php @@ -58,7 +58,7 @@ class provider implements * @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('survey_answers', [ 'userid' => 'privacy:metadata:answers:userid', 'question' => 'privacy:metadata:answers:question', @@ -81,7 +81,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $contextlist = new \core_privacy\local\request\contextlist(); // While we should not have an analysis without answers, it's safer to gather contexts by looking at both tables. diff --git a/mod/survey/renderer.php b/mod/survey/renderer.php index db873a08740..3c2fd6b9938 100644 --- a/mod/survey/renderer.php +++ b/mod/survey/renderer.php @@ -33,7 +33,7 @@ class mod_survey_renderer extends plugin_renderer_base { * @param \mod_survey\output\actionbar $actionbar Data for the template * @return bool|string rendered HTML string from the template. */ - public function response_actionbar( \mod_survey\output\actionbar $actionbar) { + public function response_actionbar(\mod_survey\output\actionbar $actionbar) { return $this->render_from_template('mod_survey/response_action_bar', $actionbar->export_for_template($this)); } } diff --git a/mod/url/classes/analytics/indicator/cognitive_depth.php b/mod/url/classes/analytics/indicator/cognitive_depth.php index 8bcfca1650a..0a4cfc66ff2 100644 --- a/mod/url/classes/analytics/indicator/cognitive_depth.php +++ b/mod/url/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_url'); } diff --git a/mod/url/classes/analytics/indicator/social_breadth.php b/mod/url/classes/analytics/indicator/social_breadth.php index 458a2d88353..7fd6d68fe97 100644 --- a/mod/url/classes/analytics/indicator/social_breadth.php +++ b/mod/url/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_url'); } diff --git a/mod/url/classes/privacy/provider.php b/mod/url/classes/privacy/provider.php index 7c7f79a4346..6eba809d248 100644 --- a/mod/url/classes/privacy/provider.php +++ b/mod/url/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/mod/wiki/classes/analytics/indicator/cognitive_depth.php b/mod/wiki/classes/analytics/indicator/cognitive_depth.php index 343ebec0480..e4025a1b26f 100644 --- a/mod/wiki/classes/analytics/indicator/cognitive_depth.php +++ b/mod/wiki/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_wiki'); } diff --git a/mod/wiki/classes/analytics/indicator/social_breadth.php b/mod/wiki/classes/analytics/indicator/social_breadth.php index aaf590f4ae4..d3faa158f08 100644 --- a/mod/wiki/classes/analytics/indicator/social_breadth.php +++ b/mod/wiki/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_wiki'); } diff --git a/mod/wiki/classes/privacy/provider.php b/mod/wiki/classes/privacy/provider.php index 469ef286742..c7ae2763d76 100644 --- a/mod/wiki/classes/privacy/provider.php +++ b/mod/wiki/classes/privacy/provider.php @@ -55,7 +55,7 @@ class provider implements * @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('wiki_subwikis', [ 'userid' => 'privacy:metadata:wiki_subwikis:userid', @@ -102,7 +102,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); $contextlist->add_from_sql('SELECT ctx.id diff --git a/mod/workshop/allocation/manual/classes/privacy/provider.php b/mod/workshop/allocation/manual/classes/privacy/provider.php index d732ba5b7ac..239f31eecd7 100644 --- a/mod/workshop/allocation/manual/classes/privacy/provider.php +++ b/mod/workshop/allocation/manual/classes/privacy/provider.php @@ -44,7 +44,7 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l * @param collection $collection Collection of items to add metadata to. * @return collection Collection with our added items. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_user_preference('workshopallocation_manual_perpage', 'privacy:metadata:preference:perpage'); diff --git a/mod/workshop/allocation/random/classes/privacy/provider.php b/mod/workshop/allocation/random/classes/privacy/provider.php index b84b420fa66..6dba383bea8 100644 --- a/mod/workshop/allocation/random/classes/privacy/provider.php +++ b/mod/workshop/allocation/random/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/workshop/allocation/scheduled/classes/privacy/provider.php b/mod/workshop/allocation/scheduled/classes/privacy/provider.php index b94fcc805ff..22d26ec39b9 100644 --- a/mod/workshop/allocation/scheduled/classes/privacy/provider.php +++ b/mod/workshop/allocation/scheduled/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/workshop/classes/analytics/indicator/cognitive_depth.php b/mod/workshop/classes/analytics/indicator/cognitive_depth.php index 0f0b437b57a..5383a59939f 100644 --- a/mod/workshop/classes/analytics/indicator/cognitive_depth.php +++ b/mod/workshop/classes/analytics/indicator/cognitive_depth.php @@ -42,7 +42,7 @@ class cognitive_depth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:cognitivedepth', 'mod_workshop'); } diff --git a/mod/workshop/classes/analytics/indicator/social_breadth.php b/mod/workshop/classes/analytics/indicator/social_breadth.php index 45a3d2d85d8..19f84ea90e9 100644 --- a/mod/workshop/classes/analytics/indicator/social_breadth.php +++ b/mod/workshop/classes/analytics/indicator/social_breadth.php @@ -42,7 +42,7 @@ class social_breadth extends activity_base { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:socialbreadth', 'mod_workshop'); } diff --git a/mod/workshop/classes/privacy/provider.php b/mod/workshop/classes/privacy/provider.php index 5bd88708192..51fe89d04a1 100644 --- a/mod/workshop/classes/privacy/provider.php +++ b/mod/workshop/classes/privacy/provider.php @@ -57,7 +57,7 @@ class provider implements * @param collection $collection Collection of items to add metadata to. * @return collection Collection with our added items. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_database_table('workshop_submissions', [ 'workshopid' => 'privacy:metadata:workshopid', @@ -137,7 +137,7 @@ class provider implements * @param int $userid ID of the user. * @return contextlist List of contexts containing the user's personal data. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); $sql = "SELECT ctx.id diff --git a/mod/workshop/eval/best/classes/privacy/provider.php b/mod/workshop/eval/best/classes/privacy/provider.php index 501727655d6..4f94260555e 100644 --- a/mod/workshop/eval/best/classes/privacy/provider.php +++ b/mod/workshop/eval/best/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/mod/workshop/form/accumulative/classes/privacy/provider.php b/mod/workshop/form/accumulative/classes/privacy/provider.php index e90445e5acf..2c4f0d3cb73 100644 --- a/mod/workshop/form/accumulative/classes/privacy/provider.php +++ b/mod/workshop/form/accumulative/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements \core_privacy\local\metadata\null_provider, \mod_works * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/mod/workshop/form/comments/classes/privacy/provider.php b/mod/workshop/form/comments/classes/privacy/provider.php index e8defd7cd9e..0e9ff2360aa 100644 --- a/mod/workshop/form/comments/classes/privacy/provider.php +++ b/mod/workshop/form/comments/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements \core_privacy\local\metadata\null_provider, \mod_works * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/mod/workshop/form/numerrors/classes/privacy/provider.php b/mod/workshop/form/numerrors/classes/privacy/provider.php index fc7bbc5ed7c..015b5bcefe3 100644 --- a/mod/workshop/form/numerrors/classes/privacy/provider.php +++ b/mod/workshop/form/numerrors/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements \core_privacy\local\metadata\null_provider, \mod_works * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/mod/workshop/form/rubric/classes/privacy/provider.php b/mod/workshop/form/rubric/classes/privacy/provider.php index 9450cb75761..f4e142746b0 100644 --- a/mod/workshop/form/rubric/classes/privacy/provider.php +++ b/mod/workshop/form/rubric/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements \core_privacy\local\metadata\null_provider, \mod_works * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index 0ace939303c..9d7feeccf6b 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -1820,7 +1820,7 @@ function mod_workshop_core_calendar_provide_event_action(calendar_event $event, * @param stdClass $workshop The module instance to get the range from * @return array Returns an array with min and max date. */ -function mod_workshop_core_calendar_get_valid_event_timestart_range(\calendar_event $event, \stdClass $workshop) : array { +function mod_workshop_core_calendar_get_valid_event_timestart_range(\calendar_event $event, \stdClass $workshop): array { $mindate = null; $maxdate = null; @@ -1897,7 +1897,7 @@ function mod_workshop_core_calendar_get_valid_event_timestart_range(\calendar_ev * @param \calendar_event $event * @param stdClass $workshop The module instance to get the range from */ -function mod_workshop_core_calendar_event_timestart_updated(\calendar_event $event, \stdClass $workshop) : void { +function mod_workshop_core_calendar_event_timestart_updated(\calendar_event $event, \stdClass $workshop): void { global $DB; $courseid = $event->courseid; @@ -2187,7 +2187,7 @@ function workshop_check_updates_since(cm_info $cm, $from, $filter = array()) { * @param array $args The path (the part after the filearea and before the filename). * @return array|null The itemid and the filepath inside the $args path, for the defined filearea. */ -function mod_workshop_get_path_from_pluginfile(string $filearea, array $args) : ?array { +function mod_workshop_get_path_from_pluginfile(string $filearea, array $args): ?array { if ($filearea !== 'instructauthors' && $filearea !== 'instructreviewers' && $filearea !== 'conclusion') { return null; } diff --git a/my/classes/privacy/provider.php b/my/classes/privacy/provider.php index 4aef2a4bba5..db3e9ffe10c 100644 --- a/my/classes/privacy/provider.php +++ b/my/classes/privacy/provider.php @@ -46,7 +46,7 @@ class provider implements * @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_user_preference( 'user_home_page_preference', 'privacy:metadata:core_my:preference:user_home_page_preference' diff --git a/notes/classes/privacy/provider.php b/notes/classes/privacy/provider.php index 1a661beb261..34986857f3e 100644 --- a/notes/classes/privacy/provider.php +++ b/notes/classes/privacy/provider.php @@ -54,7 +54,7 @@ class provider implements * @param collection $items a reference to the collection to use to store the metadata. * @return collection the updated collection of metadata items. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { // The core_notes components utilises the shared mdl_post table. $items->add_database_table( 'post', @@ -78,7 +78,7 @@ class provider implements * @param int $userid the userid. * @return contextlist the list of contexts containing user info for the user. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { global $DB; $contextlist = new contextlist(); diff --git a/payment/classes/account.php b/payment/classes/account.php index 9b703c8bf0e..4e1e240475f 100644 --- a/payment/classes/account.php +++ b/payment/classes/account.php @@ -47,7 +47,7 @@ class account extends persistent { * * @return array */ - protected static function define_properties() : array { + protected static function define_properties(): array { return array( 'name' => [ 'type' => PARAM_TEXT, diff --git a/payment/gateway/paypal/classes/privacy/provider.php b/payment/gateway/paypal/classes/privacy/provider.php index b736d7b10e7..a8b63d8aa08 100644 --- a/payment/gateway/paypal/classes/privacy/provider.php +++ b/payment/gateway/paypal/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements \core_privacy\local\metadata\null_provider, paygw_prov * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } diff --git a/plagiarism/classes/privacy/provider.php b/plagiarism/classes/privacy/provider.php index b2ef9a3335a..2157f5ee68e 100644 --- a/plagiarism/classes/privacy/provider.php +++ b/plagiarism/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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->link_plugintype('plagiarism', 'privacy:metadata:plagiarism'); return $collection; diff --git a/portfolio/classes/privacy/provider.php b/portfolio/classes/privacy/provider.php index 059294dcd4a..a68d84bcf23 100644 --- a/portfolio/classes/privacy/provider.php +++ b/portfolio/classes/privacy/provider.php @@ -55,7 +55,7 @@ class provider implements * @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('portfolio_instance_user', [ 'instance' => 'privacy:metadata:instance', 'userid' => 'privacy:metadata:userid', @@ -88,7 +88,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {context} ctx WHERE ctx.instanceid = :userid AND ctx.contextlevel = :usercontext diff --git a/portfolio/download/classes/privacy/provider.php b/portfolio/download/classes/privacy/provider.php index c9445ecbaf8..f0bcf514107 100644 --- a/portfolio/download/classes/privacy/provider.php +++ b/portfolio/download/classes/privacy/provider.php @@ -42,7 +42,7 @@ class provider implements * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'privacy:metadata'; } } diff --git a/portfolio/flickr/classes/privacy/provider.php b/portfolio/flickr/classes/privacy/provider.php index 090b1eb83f0..0e2b596dcb9 100644 --- a/portfolio/flickr/classes/privacy/provider.php +++ b/portfolio/flickr/classes/privacy/provider.php @@ -45,7 +45,7 @@ class provider implements * @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 { return $collection->add_external_location_link('flickr.com', ['data' => 'privacy:metadata:data'], 'privacy:metadata'); } diff --git a/portfolio/googledocs/classes/privacy/provider.php b/portfolio/googledocs/classes/privacy/provider.php index 9fe739a7358..b63c356e88f 100644 --- a/portfolio/googledocs/classes/privacy/provider.php +++ b/portfolio/googledocs/classes/privacy/provider.php @@ -45,7 +45,7 @@ class provider implements * @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 { return $collection->add_external_location_link('docs.google.com', ['data' => 'privacy:metadata:data'], 'privacy:metadata'); } diff --git a/portfolio/mahara/classes/privacy/provider.php b/portfolio/mahara/classes/privacy/provider.php index a8731be01e0..259f09bc84e 100644 --- a/portfolio/mahara/classes/privacy/provider.php +++ b/portfolio/mahara/classes/privacy/provider.php @@ -45,7 +45,7 @@ class provider implements * @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 { return $collection->add_external_location_link('mahara', ['data' => 'privacy:metadata:data'], 'privacy:metadata'); } diff --git a/privacy/classes/local/legacy_polyfill.php b/privacy/classes/local/legacy_polyfill.php index 5d0c8b6a642..6329753d6a3 100644 --- a/privacy/classes/local/legacy_polyfill.php +++ b/privacy/classes/local/legacy_polyfill.php @@ -43,7 +43,7 @@ trait legacy_polyfill { * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return static::_get_reason(); } @@ -53,7 +53,7 @@ trait legacy_polyfill { * @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 { return static::_get_metadata($collection); } @@ -72,7 +72,7 @@ trait legacy_polyfill { * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return static::_get_contexts_for_userid($userid); } diff --git a/privacy/classes/local/metadata/null_provider.php b/privacy/classes/local/metadata/null_provider.php index e57a57f8320..8c239a180ba 100644 --- a/privacy/classes/local/metadata/null_provider.php +++ b/privacy/classes/local/metadata/null_provider.php @@ -36,5 +36,5 @@ interface null_provider { * * @return string */ - public static function get_reason() : string ; + public static function get_reason(): string ; } diff --git a/privacy/classes/local/metadata/provider.php b/privacy/classes/local/metadata/provider.php index 21060b7add8..d39f240a836 100644 --- a/privacy/classes/local/metadata/provider.php +++ b/privacy/classes/local/metadata/provider.php @@ -39,5 +39,5 @@ interface provider { * @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 ; } diff --git a/privacy/classes/local/metadata/types/plugintype_link.php b/privacy/classes/local/metadata/types/plugintype_link.php index 08e3b94c8cc..2e89f78d2cc 100644 --- a/privacy/classes/local/metadata/types/plugintype_link.php +++ b/privacy/classes/local/metadata/types/plugintype_link.php @@ -83,7 +83,7 @@ class plugintype_link implements type { * * @return array */ - public function get_privacy_fields() : array { + public function get_privacy_fields(): array { return $this->privacyfields; } diff --git a/privacy/classes/local/metadata/types/subsystem_link.php b/privacy/classes/local/metadata/types/subsystem_link.php index 05e5a3a5fcb..45c2e482169 100644 --- a/privacy/classes/local/metadata/types/subsystem_link.php +++ b/privacy/classes/local/metadata/types/subsystem_link.php @@ -84,7 +84,7 @@ class subsystem_link implements type { * * @return array */ - public function get_privacy_fields() : array { + public function get_privacy_fields(): array { return $this->privacyfields; } diff --git a/privacy/classes/local/request/approved_contextlist.php b/privacy/classes/local/request/approved_contextlist.php index 7704332746a..9efe3c418aa 100644 --- a/privacy/classes/local/request/approved_contextlist.php +++ b/privacy/classes/local/request/approved_contextlist.php @@ -58,7 +58,7 @@ class approved_contextlist extends contextlist_base { * @param \stdClass $user The user record. * @return $this */ - protected function set_user(\stdClass $user) : approved_contextlist { + protected function set_user(\stdClass $user): approved_contextlist { $this->user = $user; return $this; @@ -69,7 +69,7 @@ class approved_contextlist extends contextlist_base { * * @return \stdClass */ - public function get_user() : \stdClass { + public function get_user(): \stdClass { return $this->user; } } diff --git a/privacy/classes/local/request/approved_userlist.php b/privacy/classes/local/request/approved_userlist.php index 47126ccb592..e213c2819a4 100644 --- a/privacy/classes/local/request/approved_userlist.php +++ b/privacy/classes/local/request/approved_userlist.php @@ -53,7 +53,7 @@ class approved_userlist extends userlist_base { * @param userlist $userlist The source list * @return approved_userlist The newly created approved userlist. */ - public static function create_from_userlist(userlist $userlist) : approved_userlist { + public static function create_from_userlist(userlist $userlist): approved_userlist { $newlist = new static($userlist->get_context(), $userlist->get_component(), $userlist->get_userids()); return $newlist; diff --git a/privacy/classes/local/request/content_writer.php b/privacy/classes/local/request/content_writer.php index da60079b7a5..b760d6e32f7 100644 --- a/privacy/classes/local/request/content_writer.php +++ b/privacy/classes/local/request/content_writer.php @@ -47,7 +47,7 @@ interface content_writer { * @param \context $context The context to use * @return content_writer */ - public function set_context(\context $context) : content_writer ; + public function set_context(\context $context): content_writer ; /** * Export the supplied data within the current context, at the supplied subcontext. @@ -56,7 +56,7 @@ interface content_writer { * @param \stdClass $data The data to be exported * @return content_writer */ - public function export_data(array $subcontext, \stdClass $data) : content_writer ; + public function export_data(array $subcontext, \stdClass $data): content_writer ; /** * Export metadata about the supplied subcontext. @@ -69,7 +69,7 @@ interface content_writer { * @param string $description The description of the value. * @return content_writer */ - public function export_metadata(array $subcontext, string $name, $value, string $description) : content_writer ; + public function export_metadata(array $subcontext, string $name, $value, string $description): content_writer ; /** * Export a piece of related data. @@ -79,7 +79,7 @@ interface content_writer { * @param \stdClass $data The related data to export. * @return content_writer */ - public function export_related_data(array $subcontext, $name, $data) : content_writer ; + public function export_related_data(array $subcontext, $name, $data): content_writer ; /** * Export a piece of data in a custom format. @@ -89,7 +89,7 @@ interface content_writer { * @param string $filecontent The content to be exported. * @return content_writer */ - public function export_custom_file(array $subcontext, $filename, $filecontent) : content_writer ; + public function export_custom_file(array $subcontext, $filename, $filecontent): content_writer ; /** * Prepare a text area by processing pluginfile URLs within it. @@ -101,7 +101,7 @@ interface content_writer { * @param string $text The text to be processed * @return string The processed string */ - public function rewrite_pluginfile_urls(array $subcontext, $component, $filearea, $itemid, $text) : string; + public function rewrite_pluginfile_urls(array $subcontext, $component, $filearea, $itemid, $text): string; /** * Export all files within the specified component, filearea, itemid combination. @@ -112,7 +112,7 @@ interface content_writer { * @param string $itemid Which item those files belong to. * @return content_writer */ - public function export_area_files(array $subcontext, $component, $filearea, $itemid) : content_writer ; + public function export_area_files(array $subcontext, $component, $filearea, $itemid): content_writer ; /** * Export the specified file in the target location. @@ -121,7 +121,7 @@ interface content_writer { * @param \stored_file $file The file to be exported. * @return content_writer */ - public function export_file(array $subcontext, \stored_file $file) : content_writer ; + public function export_file(array $subcontext, \stored_file $file): content_writer ; /** * Export the specified user preference. @@ -132,12 +132,12 @@ interface content_writer { * @param string $description A description of the value * @return content_writer */ - public function export_user_preference(string $component, string $key, string $value, string $description) : content_writer ; + public function export_user_preference(string $component, string $key, string $value, string $description): content_writer ; /** * Perform any required finalisation steps and return the location of the finalised export. * * @return string */ - public function finalise_content() : string ; + public function finalise_content(): string ; } diff --git a/privacy/classes/local/request/contextlist.php b/privacy/classes/local/request/contextlist.php index b9b2cd09cf7..98a37dac131 100644 --- a/privacy/classes/local/request/contextlist.php +++ b/privacy/classes/local/request/contextlist.php @@ -43,7 +43,7 @@ class contextlist extends contextlist_base { * @param array $params The set of SQL parameters * @return $this */ - public function add_from_sql(string $sql, array $params) : contextlist { + public function add_from_sql(string $sql, array $params): contextlist { global $DB; $fields = \context_helper::get_preload_record_columns_sql('ctx'); @@ -87,7 +87,7 @@ class contextlist extends contextlist_base { * * @return $this */ - public function add_system_context() : contextlist { + public function add_system_context(): contextlist { return $this->add_from_sql(SYSCONTEXTID, []); } @@ -97,7 +97,7 @@ class contextlist extends contextlist_base { * @param int $userid * @return $this */ - public function add_user_context(int $userid) : contextlist { + public function add_user_context(int $userid): contextlist { $sql = "SELECT DISTINCT ctx.id FROM {context} ctx WHERE ctx.contextlevel = :contextlevel @@ -111,7 +111,7 @@ class contextlist extends contextlist_base { * @param array $userids * @return $this */ - public function add_user_contexts(array $userids) : contextlist { + public function add_user_contexts(array $userids): contextlist { global $DB; list($useridsql, $useridparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED); @@ -137,7 +137,7 @@ class contextlist extends contextlist_base { * @param string $sql The SQL to guess from * @return string The field name or a numeric value representing the context id */ - protected function guess_id_field_from_sql(string $sql) : string { + protected function guess_id_field_from_sql(string $sql): string { // We are not interested in any subquery/view/conditions for the purpose of this method, so // let's reduce the query to the interesting parts by recursively cleaning all // contents within parenthesis. If there are problems (null), we keep the text unmodified. diff --git a/privacy/classes/local/request/contextlist_base.php b/privacy/classes/local/request/contextlist_base.php index 1c48a03c99b..2bd4cadcf79 100644 --- a/privacy/classes/local/request/contextlist_base.php +++ b/privacy/classes/local/request/contextlist_base.php @@ -71,7 +71,7 @@ abstract class contextlist_base implements * * @return int[] */ - public function get_contextids() : array { + public function get_contextids(): array { return $this->contextids; } @@ -81,7 +81,7 @@ abstract class contextlist_base implements * * @return \context[] */ - public function get_contexts() : array { + public function get_contexts(): array { $contexts = []; foreach ($this->contextids as $contextid) { // It is possible that this context has been deleted and we now have subsequent calls being made with this @@ -112,7 +112,7 @@ abstract class contextlist_base implements * * @return string the component name associated with this contextlist. */ - public function get_component() : string { + public function get_component(): string { return $this->component; } diff --git a/privacy/classes/local/request/contextlist_collection.php b/privacy/classes/local/request/contextlist_collection.php index cefd36c2d76..960439d77c6 100644 --- a/privacy/classes/local/request/contextlist_collection.php +++ b/privacy/classes/local/request/contextlist_collection.php @@ -64,7 +64,7 @@ class contextlist_collection implements \Iterator, \Countable { * * @return int */ - public function get_userid() : int { + public function get_userid(): int { return $this->userid; } @@ -94,7 +94,7 @@ class contextlist_collection implements \Iterator, \Countable { * @return array the associative array of contextlists in this collection, indexed by component name. * E.g. mod_assign => contextlist, core_comment => contextlist. */ - public function get_contextlists() : array { + public function get_contextlists(): array { return $this->contextlists; } diff --git a/privacy/classes/local/request/core_user_data_provider.php b/privacy/classes/local/request/core_user_data_provider.php index 462a4b294cf..479abfd8d70 100644 --- a/privacy/classes/local/request/core_user_data_provider.php +++ b/privacy/classes/local/request/core_user_data_provider.php @@ -44,7 +44,7 @@ interface core_user_data_provider extends core_data_provider { * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist; + public static function get_contexts_for_userid(int $userid): contextlist; /** * Export all user data for the specified user, in the specified contexts. diff --git a/privacy/classes/local/request/helper.php b/privacy/classes/local/request/helper.php index 9836e68b059..d7033d8da05 100644 --- a/privacy/classes/local/request/helper.php +++ b/privacy/classes/local/request/helper.php @@ -51,7 +51,7 @@ class helper { * @param contextlist $contextlist The contextlist being appended to. * @return contextlist The final contextlist */ - public static function add_shared_contexts_to_contextlist_for(int $userid, contextlist $contextlist) : contextlist { + public static function add_shared_contexts_to_contextlist_for(int $userid, contextlist $contextlist): contextlist { if (strpos($contextlist->get_component(), 'mod_') === 0) { // Activity modules support data stored by core about them - for example, activity completion. $contextlist = static::add_shared_contexts_to_contextlist_for_course_module($userid, $contextlist); @@ -127,7 +127,7 @@ class helper { * @param \stdClass $user The user being written. * @return \stdClass */ - public static function get_context_data(\context $context, \stdClass $user) : \stdClass { + public static function get_context_data(\context $context, \stdClass $user): \stdClass { global $DB; $basedata = (object) []; @@ -164,7 +164,7 @@ class helper { * @param contextlist $contextlist The contextlist being appended to. * @return contextlist The final contextlist */ - protected static function add_shared_contexts_to_contextlist_for_course_module(int $userid, contextlist $contextlist) : contextlist { + protected static function add_shared_contexts_to_contextlist_for_course_module(int $userid, contextlist $contextlist): contextlist { // Fetch all contexts where the user has activity completion enabled. $sql = "SELECT c.id @@ -193,7 +193,7 @@ class helper { * @param \stdClass $user The user being written. * @return \stdClass */ - protected static function get_context_module_data(\context_module $context, \stdClass $user) : \stdClass { + protected static function get_context_module_data(\context_module $context, \stdClass $user): \stdClass { global $DB; $coursecontext = $context->get_course_context(); @@ -240,7 +240,7 @@ class helper { * @param \stdClass $user The user being written. * @return \stdClass General data about this block instance. */ - protected static function get_context_block_data(\context_block $context, \stdClass $user) : \stdClass { + protected static function get_context_block_data(\context_block $context, \stdClass $user): \stdClass { global $DB; $block = $DB->get_record('block_instances', ['id' => $context->instanceid]); diff --git a/privacy/classes/local/request/moodle_content_writer.php b/privacy/classes/local/request/moodle_content_writer.php index 099cf71324e..9d2bb352359 100644 --- a/privacy/classes/local/request/moodle_content_writer.php +++ b/privacy/classes/local/request/moodle_content_writer.php @@ -70,7 +70,7 @@ class moodle_content_writer implements content_writer { * * @param \context $context The context to use */ - public function set_context(\context $context) : content_writer { + public function set_context(\context $context): content_writer { $this->context = $context; return $this; @@ -83,7 +83,7 @@ class moodle_content_writer implements content_writer { * @param \stdClass $data The data to be exported * @return content_writer */ - public function export_data(array $subcontext, \stdClass $data) : content_writer { + public function export_data(array $subcontext, \stdClass $data): content_writer { $path = $this->get_path($subcontext, 'data.json'); $this->write_data($path, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); @@ -102,7 +102,7 @@ class moodle_content_writer implements content_writer { * @param string $description The description of the value. * @return content_writer */ - public function export_metadata(array $subcontext, string $key, $value, string $description) : content_writer { + public function export_metadata(array $subcontext, string $key, $value, string $description): content_writer { $path = $this->get_full_path($subcontext, 'metadata.json'); if (file_exists($path)) { @@ -130,7 +130,7 @@ class moodle_content_writer implements content_writer { * @param \stdClass $data The related data to export. * @return content_writer */ - public function export_related_data(array $subcontext, $name, $data) : content_writer { + public function export_related_data(array $subcontext, $name, $data): content_writer { return $this->export_custom_file($subcontext, "{$name}.json", json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); } @@ -142,7 +142,7 @@ class moodle_content_writer implements content_writer { * @param string $filename The name of the file to be exported. * @param string $filecontent The content to be exported. */ - public function export_custom_file(array $subcontext, $filename, $filecontent) : content_writer { + public function export_custom_file(array $subcontext, $filename, $filecontent): content_writer { $filename = clean_param($filename, PARAM_FILE); $path = $this->get_path($subcontext, $filename); $this->write_data($path, $filecontent); @@ -185,7 +185,7 @@ class moodle_content_writer implements content_writer { * @param string $filearea The filearea within that component. * @param string $itemid Which item those files belong to. */ - public function export_area_files(array $subcontext, $component, $filearea, $itemid) : content_writer { + public function export_area_files(array $subcontext, $component, $filearea, $itemid): content_writer { $fs = get_file_storage(); $files = $fs->get_area_files($this->context->id, $component, $filearea, $itemid); foreach ($files as $file) { @@ -201,7 +201,7 @@ class moodle_content_writer implements content_writer { * @param array $subcontext The location within the current context that this data belongs. * @param \stored_file $file The file to be exported. */ - public function export_file(array $subcontext, \stored_file $file) : content_writer { + public function export_file(array $subcontext, \stored_file $file): content_writer { if (!$file->is_directory()) { $pathitems = array_merge( $subcontext, @@ -226,7 +226,7 @@ class moodle_content_writer implements content_writer { * @param string $description A description of the value * @return content_writer */ - public function export_user_preference(string $component, string $key, string $value, string $description) : content_writer { + public function export_user_preference(string $component, string $key, string $value, string $description): content_writer { $subcontext = [ get_string('userpreferences'), ]; @@ -254,7 +254,7 @@ class moodle_content_writer implements content_writer { * @return array The context path. * @throws \coding_exception */ - protected function get_context_path() : array { + protected function get_context_path(): array { $path = []; $contexts = array_reverse($this->context->get_parent_contexts(true)); foreach ($contexts as $context) { @@ -274,7 +274,7 @@ class moodle_content_writer implements content_writer { * @param string $name The intended filename, including any extensions. * @return string The fully-qualfiied file path. */ - protected function get_path(array $subcontext, string $name) : string { + protected function get_path(array $subcontext, string $name): string { $subcontext = shorten_filenames($subcontext, MAX_FILENAME_SIZE, true); $name = shorten_filename($name, MAX_FILENAME_SIZE, true); @@ -324,7 +324,7 @@ class moodle_content_writer implements content_writer { * @param string $name The intended filename, including any extensions. * @return string The fully-qualfiied file path. */ - protected function get_full_path(array $subcontext, string $name) : string { + protected function get_full_path(array $subcontext, string $name): string { $path = array_merge( [$this->path], [$this->get_path($subcontext, $name)] @@ -346,7 +346,7 @@ class moodle_content_writer implements content_writer { * @param string $itemid Which item those files belong to. * @return string The path */ - protected function get_files_target_path($component, $filearea, $itemid) : string { + protected function get_files_target_path($component, $filearea, $itemid): string { // We do not need to include the component because we organise things by context. $parts = ['_files', $filearea]; @@ -366,7 +366,7 @@ class moodle_content_writer implements content_writer { * @param string $itemid Which item those files belong to. * @return string The url */ - protected function get_files_target_url($component, $filearea, $itemid) : string { + protected function get_files_target_url($component, $filearea, $itemid): string { // We do not need to include the component because we organise things by context. $parts = ['_files', $filearea]; @@ -422,7 +422,7 @@ class moodle_content_writer implements content_writer { * * @return array returns a tree, tree key, and a list of all files. */ - protected function prepare_for_export() : Array { + protected function prepare_for_export(): Array { $tree = []; $treekey = []; $allfiles = []; @@ -477,7 +477,7 @@ class moodle_content_writer implements content_writer { * @param array $currentkey The current short path of the tree. * @return array An array of objects that has additional data. */ - protected function make_tree_object(array $tree, array $treekey, array $currentkey = []) : Array { + protected function make_tree_object(array $tree, array $treekey, array $currentkey = []): Array { $newtree = []; // Try to extract the context id and then add the context object. $addcontext = function($index, $object) { @@ -595,7 +595,7 @@ class moodle_content_writer implements content_writer { * @param string $component The component name e.g. tool_log * @return bool Whether this component is installed. */ - protected function check_plugin_is_installed(string $component) : Bool { + protected function check_plugin_is_installed(string $component): Bool { if (!isset($this->checkedplugins[$component])) { $pluginmanager = \core_plugin_manager::instance(); $plugin = $pluginmanager->get_plugin_info($component); @@ -680,7 +680,7 @@ class moodle_content_writer implements content_writer { * * @return string */ - public function finalise_content() : string { + public function finalise_content(): string { $this->write_html_data(); $exportfile = make_request_directory() . '/export.zip'; @@ -700,7 +700,7 @@ class moodle_content_writer implements content_writer { * @param array $array Array which items are to be condensed into a multidimensional array. * @return array The multidimensional array. */ - protected function condense_array(array $array) : Array { + protected function condense_array(array $array): Array { if (count($array) === 2) { return [$array[0] => $array[1]]; } @@ -717,7 +717,7 @@ class moodle_content_writer implements content_writer { * @return string contents of the file. * @throws \moodle_exception If the file cannot be opened. */ - protected function get_file_content(string $filepath) : String { + protected function get_file_content(string $filepath): String { $content = file_get_contents($filepath); if ($content === false) { throw new \moodle_exception('cannotopenfile', 'error', '', $filepath); diff --git a/privacy/classes/local/request/userlist.php b/privacy/classes/local/request/userlist.php index 171ccc07eb1..c119deeca40 100644 --- a/privacy/classes/local/request/userlist.php +++ b/privacy/classes/local/request/userlist.php @@ -44,7 +44,7 @@ class userlist extends userlist_base { * @param array $params The set of SQL parameters * @return $this */ - public function add_from_sql(string $fieldname, string $sql, array $params) : userlist { + public function add_from_sql(string $fieldname, string $sql, array $params): userlist { global $DB; // Able to guess a field name. @@ -65,7 +65,7 @@ class userlist extends userlist_base { * @param int $userid * @return $this */ - public function add_user(int $userid) : userlist { + public function add_user(int $userid): userlist { $this->add_users([$userid]); return $this; @@ -77,7 +77,7 @@ class userlist extends userlist_base { * @param int[] $userids * @return $this */ - public function add_users(array $userids) : userlist { + public function add_users(array $userids): userlist { global $DB; if (!empty($userids)) { @@ -96,7 +96,7 @@ class userlist extends userlist_base { * @param string $component the frankenstyle component name. * @return $this */ - public function set_component($component) : userlist_base { + public function set_component($component): userlist_base { parent::set_component($component); return $this; diff --git a/privacy/classes/local/request/userlist_base.php b/privacy/classes/local/request/userlist_base.php index 0e2566e6b61..32d3eb906d3 100644 --- a/privacy/classes/local/request/userlist_base.php +++ b/privacy/classes/local/request/userlist_base.php @@ -77,7 +77,7 @@ abstract class userlist_base implements * @param array $userids The list of users. * @return $this */ - protected function set_userids(array $userids) : userlist_base { + protected function set_userids(array $userids): userlist_base { $this->userids = array_values(array_unique($userids)); return $this; @@ -89,7 +89,7 @@ abstract class userlist_base implements * @param array $userids The list of users. * @return $this */ - protected function add_userids(array $userids) : userlist_base { + protected function add_userids(array $userids): userlist_base { $this->set_userids(array_merge($this->get_userids(), $userids)); return $this; @@ -100,7 +100,7 @@ abstract class userlist_base implements * * @return int[] */ - public function get_userids() : array { + public function get_userids(): array { return $this->userids; } @@ -109,7 +109,7 @@ abstract class userlist_base implements * * @return \stdClass[] */ - public function get_users() : array { + public function get_users(): array { $users = []; foreach ($this->userids as $userid) { if ($user = \core_user::get_user($userid)) { @@ -126,7 +126,7 @@ abstract class userlist_base implements * @param string $component the frankenstyle component name. * @return $this */ - protected function set_component($component) : userlist_base { + protected function set_component($component): userlist_base { $this->component = $component; return $this; @@ -137,7 +137,7 @@ abstract class userlist_base implements * * @return string the component name associated with this userlist. */ - public function get_component() : string { + public function get_component(): string { return $this->component; } @@ -216,7 +216,7 @@ abstract class userlist_base implements * * @return \context */ - public function get_context() : \context { + public function get_context(): \context { return $this->context; } } diff --git a/privacy/classes/local/request/userlist_collection.php b/privacy/classes/local/request/userlist_collection.php index 1438e94ea8a..a351a363aa5 100644 --- a/privacy/classes/local/request/userlist_collection.php +++ b/privacy/classes/local/request/userlist_collection.php @@ -64,7 +64,7 @@ class userlist_collection implements \Iterator, \Countable { * * @return int */ - public function get_context() : \context { + public function get_context(): \context { return $this->context; } @@ -74,7 +74,7 @@ class userlist_collection implements \Iterator, \Countable { * @param userlist_base $userlist the userlist to export. * @return $this */ - public function add_userlist(userlist_base $userlist) : userlist_collection { + public function add_userlist(userlist_base $userlist): userlist_collection { $component = $userlist->get_component(); if (isset($this->userlists[$component])) { throw new \moodle_exception("A userlist has already been added for the '{$component}' component"); @@ -91,7 +91,7 @@ class userlist_collection implements \Iterator, \Countable { * @return array the associative array of userlists in this collection, indexed by component name. * E.g. mod_assign => userlist, core_comment => userlist. */ - public function get_userlists() : array { + public function get_userlists(): array { return $this->userlists; } diff --git a/privacy/classes/local/request/writer.php b/privacy/classes/local/request/writer.php index 80d77ca281f..0c50111ff6f 100644 --- a/privacy/classes/local/request/writer.php +++ b/privacy/classes/local/request/writer.php @@ -55,7 +55,7 @@ class writer { * * @return content_writer */ - protected function get_writer_instance() : content_writer { + protected function get_writer_instance(): content_writer { if (null === $this->realwriter) { if (PHPUNIT_TEST) { $this->realwriter = new \core_privacy\tests\request\content_writer(static::instance()); @@ -109,7 +109,7 @@ class writer { * @param \context $context The context to apply * @return content_writer The content_writer */ - public static function with_context(\context $context) : content_writer { + public static function with_context(\context $context): content_writer { return static::instance() ->get_writer_instance() ->set_context($context); @@ -129,7 +129,7 @@ class writer { string $key, string $value, string $description - ) : content_writer { + ): content_writer { return static::with_context(\context_system::instance()) ->export_user_preference($component, $key, $value, $description); } diff --git a/privacy/classes/manager.php b/privacy/classes/manager.php index 6ec6abdedc5..2a5e12b8930 100644 --- a/privacy/classes/manager.php +++ b/privacy/classes/manager.php @@ -140,7 +140,7 @@ class manager { * @param string $component frankenstyle component name, e.g. 'mod_assign' * @return bool true if the component is compliant, false otherwise. */ - public function component_is_compliant(string $component) : bool { + public function component_is_compliant(string $component): bool { // Components which don't store user data need only implement the null_provider. if ($this->component_implements($component, null_provider::class)) { return true; @@ -165,7 +165,7 @@ class manager { * @param string $component Frankenstyle component name. * @return string The key to retrieve the language string for the null provider reason. */ - public function get_null_provider_reason(string $component) : string { + public function get_null_provider_reason(string $component): string { if ($this->component_implements($component, null_provider::class)) { $reason = $this->handled_component_class_callback($component, null_provider::class, 'get_reason', []); return empty($reason) ? 'privacy:reason' : $reason; @@ -196,7 +196,7 @@ class manager { * * @return collection[] The array of collection objects, indexed by frankenstyle component name. */ - public function get_metadata_for_components() : array { + public function get_metadata_for_components(): array { // Get the metadata, and put into an assoc array indexed by component name. $metadata = []; foreach ($this->get_component_list() as $component) { @@ -216,7 +216,7 @@ class manager { * @param int $userid the id of the user we're fetching contexts for. * @return contextlist_collection the collection of contextlist items for the respective components. */ - public function get_contexts_for_userid(int $userid) : contextlist_collection { + public function get_contexts_for_userid(int $userid): contextlist_collection { $progress = static::get_log_tracer(); $components = $this->get_component_list(); @@ -262,7 +262,7 @@ class manager { * @param \context $context The context to search * @return userlist_collection the collection of userlist items for the respective components. */ - public function get_users_in_context(\context $context) : \core_privacy\local\request\userlist_collection { + public function get_users_in_context(\context $context): \core_privacy\local\request\userlist_collection { $progress = static::get_log_tracer(); $components = $this->get_component_list(); @@ -539,7 +539,7 @@ class manager { * @param string $interface the name of the interface we want to check. * @return bool True if an implementation was found, false otherwise. */ - protected function component_implements(string $component, string $interface) : bool { + protected function component_implements(string $component, string $interface): bool { $providerclass = $this->get_provider_classname($component); if (class_exists($providerclass)) { $rc = new \ReflectionClass($providerclass); diff --git a/privacy/classes/output/exported_html_page.php b/privacy/classes/output/exported_html_page.php index 8dbea89d78d..e9e9659b330 100644 --- a/privacy/classes/output/exported_html_page.php +++ b/privacy/classes/output/exported_html_page.php @@ -74,7 +74,7 @@ class exported_html_page implements renderable, templatable { * @param renderer_base $output * @return array */ - public function export_for_template(renderer_base $output) : Array { + public function export_for_template(renderer_base $output): Array { return [ 'navigation' => $this->navigationdata, 'systemname' => $this->systemname, diff --git a/privacy/classes/output/exported_navigation_page.php b/privacy/classes/output/exported_navigation_page.php index 49819dd147b..daf5f12e4a5 100644 --- a/privacy/classes/output/exported_navigation_page.php +++ b/privacy/classes/output/exported_navigation_page.php @@ -91,7 +91,7 @@ class exported_navigation_page implements renderable, templatable { * @param renderer_base $output * @return array navigation data for the template. */ - public function export_for_template(renderer_base $output) : Array { + public function export_for_template(renderer_base $output): Array { $data = $this->create_navigation($this->tree); return ['navigation' => $data]; } diff --git a/privacy/classes/privacy/provider.php b/privacy/classes/privacy/provider.php index 7af8f2d8dbc..83d38102b8e 100644 --- a/privacy/classes/privacy/provider.php +++ b/privacy/classes/privacy/provider.php @@ -41,7 +41,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'; } } diff --git a/privacy/classes/tests/request/content_writer.php b/privacy/classes/tests/request/content_writer.php index 3ad7c498869..bd80f474668 100644 --- a/privacy/classes/tests/request/content_writer.php +++ b/privacy/classes/tests/request/content_writer.php @@ -157,7 +157,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * * @param \context $context The context to use */ - public function set_context(\context $context) : \core_privacy\local\request\content_writer { + public function set_context(\context $context): \core_privacy\local\request\content_writer { $this->context = $context; if (isset($this->data->{$this->context->id}) && empty((array) $this->data->{$this->context->id})) { @@ -210,7 +210,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * * @return \context */ - public function get_current_context() : \context { + public function get_current_context(): \context { return $this->context; } @@ -220,7 +220,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * @param array $subcontext The location within the current context that this data belongs. * @param \stdClass $data The data to be exported */ - public function export_data(array $subcontext, \stdClass $data) : \core_privacy\local\request\content_writer { + public function export_data(array $subcontext, \stdClass $data): \core_privacy\local\request\content_writer { $current = $this->fetch_root($this->data, $subcontext); $current->data = $data; @@ -248,8 +248,12 @@ class content_writer implements \core_privacy\local\request\content_writer { * @param string $description The description of the value. * @return $this */ - public function export_metadata(array $subcontext, string $key, $value, string $description) - : \core_privacy\local\request\content_writer { + public function export_metadata( + array $subcontext, + string $key, + $value, + string $description + ): \core_privacy\local\request\content_writer { $current = $this->fetch_root($this->metadata, $subcontext); $current->data[$key] = (object) [ 'value' => $value, @@ -300,7 +304,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * @param string $name The name of the file to be exported. * @param \stdClass $data The related data to export. */ - public function export_related_data(array $subcontext, $name, $data) : \core_privacy\local\request\content_writer { + public function export_related_data(array $subcontext, $name, $data): \core_privacy\local\request\content_writer { $current = $this->fetch_root($this->relateddata, $subcontext); $current->data[$name] = $data; @@ -335,7 +339,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * @param string $filename The name of the file to be exported. * @param string $filecontent The content to be exported. */ - public function export_custom_file(array $subcontext, $filename, $filecontent) : \core_privacy\local\request\content_writer { + public function export_custom_file(array $subcontext, $filename, $filecontent): \core_privacy\local\request\content_writer { $filename = clean_param($filename, PARAM_FILE); $current = $this->fetch_root($this->customfiles, $subcontext); @@ -393,7 +397,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * @param string $filearea The filearea within that component. * @param string $itemid Which item those files belong to. */ - public function export_area_files(array $subcontext, $component, $filearea, $itemid) : \core_privacy\local\request\content_writer { + public function export_area_files(array $subcontext, $component, $filearea, $itemid): \core_privacy\local\request\content_writer { $fs = get_file_storage(); $files = $fs->get_area_files($this->context->id, $component, $filearea, $itemid); foreach ($files as $file) { @@ -409,7 +413,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * @param array $subcontext The location within the current context that this data belongs. * @param \stored_file $file The file to be exported. */ - public function export_file(array $subcontext, \stored_file $file) : \core_privacy\local\request\content_writer { + public function export_file(array $subcontext, \stored_file $file): \core_privacy\local\request\content_writer { if (!$file->is_directory()) { $filepath = $file->get_filepath(); // Directory separator in the stored_file class should always be '/'. The following line is just a fail safe. @@ -449,7 +453,7 @@ class content_writer implements \core_privacy\local\request\content_writer { string $key, string $value, string $description - ) : \core_privacy\local\request\content_writer { + ): \core_privacy\local\request\content_writer { $prefs = $this->fetch_root($this->userprefs, []); if (!isset($prefs->{$component})) { @@ -500,7 +504,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * * @return string */ - public function finalise_content() : string { + public function finalise_content(): string { return 'mock_path'; } diff --git a/privacy/tests/fixtures/mock_mod_with_user_data_provider.php b/privacy/tests/fixtures/mock_mod_with_user_data_provider.php index 7569a7a5e33..0c813e47920 100644 --- a/privacy/tests/fixtures/mock_mod_with_user_data_provider.php +++ b/privacy/tests/fixtures/mock_mod_with_user_data_provider.php @@ -39,7 +39,7 @@ class provider implements \core_privacy\local\metadata\null_provider, \core_priv * * @return string */ - public static function get_reason() : string { + public static function get_reason(): string { return 'notimplemented'; } diff --git a/privacy/tests/fixtures/mock_plugin_subplugin_provider.php b/privacy/tests/fixtures/mock_plugin_subplugin_provider.php index 1984cfae0c7..d8ea44dd55c 100644 --- a/privacy/tests/fixtures/mock_plugin_subplugin_provider.php +++ b/privacy/tests/fixtures/mock_plugin_subplugin_provider.php @@ -38,7 +38,7 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l * @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 = new collection('testcomponent3'); $collection->add_database_table('testtable', ['testfield1', 'testfield2'], 'testsummary'); return $collection; diff --git a/privacy/tests/fixtures/mock_provider.php b/privacy/tests/fixtures/mock_provider.php index 09df481dde8..120d2bb8f11 100644 --- a/privacy/tests/fixtures/mock_provider.php +++ b/privacy/tests/fixtures/mock_provider.php @@ -37,7 +37,7 @@ class provider implements \core_privacy\local\metadata\provider, \core_privacy\l /** * @return array The array of metadata. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection = new collection('testcomponent'); $collection->add_database_table('testtable', ['testfield1', 'testfield2'], 'testsummary'); return $collection; diff --git a/privacy/tests/fixtures/provider_a.php b/privacy/tests/fixtures/provider_a.php index 9f88acfbdfb..9aa7241a6e6 100644 --- a/privacy/tests/fixtures/provider_a.php +++ b/privacy/tests/fixtures/provider_a.php @@ -47,7 +47,7 @@ class provider implements * @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_subsystem_link('core_files'); return $collection; } @@ -58,7 +58,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { $c = new \core_privacy\local\request\contextlist(); $c->add_system_context(); diff --git a/privacy/tests/fixtures/provider_throwing_exception.php b/privacy/tests/fixtures/provider_throwing_exception.php index 6c6c5fc5efd..77656b6bd32 100644 --- a/privacy/tests/fixtures/provider_throwing_exception.php +++ b/privacy/tests/fixtures/provider_throwing_exception.php @@ -45,7 +45,7 @@ class provider implements * @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 { throw new \coding_exception(__FUNCTION__); } @@ -55,7 +55,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist { + public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist { throw new \coding_exception(__FUNCTION__); } diff --git a/privacy/tests/userlist_base_test.php b/privacy/tests/userlist_base_test.php index 0a5e7bfe8ba..2fa0273b2a3 100644 --- a/privacy/tests/userlist_base_test.php +++ b/privacy/tests/userlist_base_test.php @@ -256,7 +256,7 @@ class test_userlist_base extends userlist_base { * * @param int[] $contexids The list of contextids to use. */ - public function set_userids(array $userids) : userlist_base { + public function set_userids(array $userids): userlist_base { return parent::set_userids($userids); } } diff --git a/question/bank/columnsortorder/classes/column_manager.php b/question/bank/columnsortorder/classes/column_manager.php index c731f9820fa..534039384ac 100644 --- a/question/bank/columnsortorder/classes/column_manager.php +++ b/question/bank/columnsortorder/classes/column_manager.php @@ -119,7 +119,7 @@ class column_manager extends column_manager_base { * @param ?array $columns Column order to set. Null value clears the setting. * @param bool $global save this as a global default, rather than a user preference? */ - public static function set_column_order(?array $columns, bool $global = false) : void { + public static function set_column_order(?array $columns, bool $global = false): void { if (!is_null($columns)) { $columns = implode(',', $columns); } @@ -132,7 +132,7 @@ class column_manager extends column_manager_base { * @param ?array $columns List of hidden columns. Null value clears the setting. * @param bool $global save this as a global default, rather than a user preference? */ - public static function set_hidden_columns(?array $columns, bool $global = false) : void { + public static function set_hidden_columns(?array $columns, bool $global = false): void { if (!is_null($columns)) { $columns = implode(',', $columns); } @@ -145,7 +145,7 @@ class column_manager extends column_manager_base { * @param ?string $sizes columns with width. Null value clears the setting. * @param bool $global save this as a global default, rather than a user preference? */ - public static function set_column_size(?string $sizes, bool $global = false) : void { + public static function set_column_size(?string $sizes, bool $global = false): void { self::save_preference('colsize', $sizes, $global); } diff --git a/question/bank/customfields/classes/customfield/question_handler.php b/question/bank/customfields/classes/customfield/question_handler.php index 3ee8c641ae0..772e20ce7d1 100644 --- a/question/bank/customfields/classes/customfield/question_handler.php +++ b/question/bank/customfields/classes/customfield/question_handler.php @@ -55,7 +55,7 @@ class question_handler extends \core_customfield\handler { * @param int $itemid Always zero. * @return \qbank_customfields\customfield\question_handler */ - public static function create(int $itemid = 0) : \core_customfield\handler { + public static function create(int $itemid = 0): \core_customfield\handler { if (static::$singleton === null) { self::$singleton = new static(0); } @@ -78,7 +78,7 @@ class question_handler extends \core_customfield\handler { * * @return bool true if the current can configure custom fields, false otherwise */ - public function can_configure() : bool { + public function can_configure(): bool { return has_capability('qbank/customfields:configurecustomfields', $this->get_configuration_context()); } @@ -89,7 +89,7 @@ class question_handler extends \core_customfield\handler { * @param int $instanceid id of the question to test edit permission * @return bool true if the current can edit custom fields, false otherwise */ - public function can_edit(field_controller $field, int $instanceid = 0) : bool { + public function can_edit(field_controller $field, int $instanceid = 0): bool { if ($instanceid) { $context = $this->get_instance_context($instanceid); } else { @@ -107,7 +107,7 @@ class question_handler extends \core_customfield\handler { * @param int $instanceid id of the question to test edit permission * @return bool true if the current can edit custom fields, false otherwise */ - public function can_view(field_controller $field, int $instanceid) : bool { + public function can_view(field_controller $field, int $instanceid): bool { $visibility = $field->get_configdata_property('visibility'); if ($visibility == self::NOTVISIBLE) { return false; @@ -128,7 +128,7 @@ class question_handler extends \core_customfield\handler { * @param \context $context The context the field is being displayed in. * @return bool true if the current can edit custom fields, false otherwise. */ - public function can_view_type(field_controller $field, \context $context) : bool { + public function can_view_type(field_controller $field, \context $context): bool { $visibility = $field->get_configdata_property('visibility'); if ($visibility == self::NOTVISIBLE) { return false; @@ -155,7 +155,7 @@ class question_handler extends \core_customfield\handler { * * @return \context */ - protected function get_parent_context() : \context { + protected function get_parent_context(): \context { if ($this->parentcontext) { return $this->parentcontext; } else { @@ -168,7 +168,7 @@ class question_handler extends \core_customfield\handler { * * @return \context the context for configuration */ - public function get_configuration_context() : \context { + public function get_configuration_context(): \context { return \context_system::instance(); } @@ -177,7 +177,7 @@ class question_handler extends \core_customfield\handler { * * @return \moodle_url The URL to configure custom fields for this component */ - public function get_configuration_url() : \moodle_url { + public function get_configuration_url(): \moodle_url { return new \moodle_url('/question/customfield.php'); } @@ -188,7 +188,7 @@ class question_handler extends \core_customfield\handler { * @return \context the context for the given record * @throws \coding_exception */ - public function get_instance_context(int $instanceid = 0) : \context { + public function get_instance_context(int $instanceid = 0): \context { if ($instanceid > 0) { $questiondata = \question_bank::load_question_data($instanceid); $contextid = $questiondata->contextid; @@ -248,7 +248,7 @@ class question_handler extends \core_customfield\handler { * @param object $fielddata The field data used for display. * @return string The HTML to display in the table column. */ - public function display_custom_field_table(object $fielddata) : string { + public function display_custom_field_table(object $fielddata): string { global $PAGE; $output = $PAGE->get_renderer('qbank_customfields'); @@ -263,7 +263,7 @@ class question_handler extends \core_customfield\handler { * @param array $catfielddata Array of categories and field names and values. * @return string The HTML to display. */ - public function display_custom_categories_fields(array $catfielddata) : string { + public function display_custom_categories_fields(array $catfielddata): string { global $PAGE; $output = $PAGE->get_renderer('qbank_customfields'); diff --git a/question/bank/editquestion/classes/external/update_question_version_status.php b/question/bank/editquestion/classes/external/update_question_version_status.php index dc8fcfbd65e..2070e918285 100644 --- a/question/bank/editquestion/classes/external/update_question_version_status.php +++ b/question/bank/editquestion/classes/external/update_question_version_status.php @@ -104,7 +104,7 @@ class update_question_version_status extends external_api { /** * Returns description of method result value. */ - public static function execute_returns() { + public static function execute_returns() { return new external_single_structure([ 'status' => new external_value(PARAM_BOOL, 'status: true if success'), 'statusname' => new external_value(PARAM_RAW, 'statusname: name of the status'), diff --git a/question/bank/editquestion/classes/output/renderer.php b/question/bank/editquestion/classes/output/renderer.php index b4fed061e08..4fd55e4c6c4 100644 --- a/question/bank/editquestion/classes/output/renderer.php +++ b/question/bank/editquestion/classes/output/renderer.php @@ -43,7 +43,7 @@ class renderer extends \plugin_renderer_base { * @param \renderable $qbankchooser The chooser. * @return string */ - public function render_qbank_chooser (\renderable $qbankchooser) { + public function render_qbank_chooser(\renderable $qbankchooser) { return $this->render_from_template('qbank_editquestion/qbank_chooser', $qbankchooser->export_for_template($this)); } @@ -55,7 +55,7 @@ class renderer extends \plugin_renderer_base { * @deprecated since Moodle 4.3. Use {@see add_new_question} renderable instead * @todo Final deprecation in Moodle 4.7 */ - public function render_create_new_question_button ($addquestiondata) { + public function render_create_new_question_button($addquestiondata) { debugging('render_create_new_question_button() is deprecated. ' . 'Pass the add_new_question renderable to render() instead.'); return $this->render_from_template('qbank_editquestion/add_new_question', $addquestiondata); diff --git a/question/bank/managecategories/classes/question_category_list.php b/question/bank/managecategories/classes/question_category_list.php index 23f1b4d3994..194633a4bf9 100644 --- a/question/bank/managecategories/classes/question_category_list.php +++ b/question/bank/managecategories/classes/question_category_list.php @@ -91,7 +91,7 @@ class question_category_list extends moodle_list { /** * Set the array of records of list items. */ - public function get_records() : void { + public function get_records(): void { $this->records = helper::get_categories_for_contexts($this->context->id, $this->sortby); } @@ -102,7 +102,7 @@ class question_category_list extends moodle_list { * @param \list_item $item The item which its top level parent is going to be returned. * @return int */ - public function get_top_level_parent_id($item) : int { + public function get_top_level_parent_id($item): int { // Put the item at the highest level it can go. $topcategory = question_get_top_category($item->item->contextid, true); return $topcategory->id; @@ -117,7 +117,7 @@ class question_category_list extends moodle_list { * @param integer $movedown id of item to move down * @return void */ - public function process_actions($left, $right, $moveup, $movedown) : void { + public function process_actions($left, $right, $moveup, $movedown): void { $category = new stdClass(); if (!empty($left)) { // Moved Left (In to another category). diff --git a/question/bank/managecategories/classes/question_category_list_item.php b/question/bank/managecategories/classes/question_category_list_item.php index d699fac39d3..e8f334b64d5 100644 --- a/question/bank/managecategories/classes/question_category_list_item.php +++ b/question/bank/managecategories/classes/question_category_list_item.php @@ -34,7 +34,7 @@ class question_category_list_item extends \list_item { * @param bool $last Is the last on the list. * @param \list_item $lastitem Last item. */ - public function set_icon_html($first, $last, $lastitem) : void { + public function set_icon_html($first, $last, $lastitem): void { global $CFG; $category = $this->item; $url = new moodle_url('/question/bank/managecategories/category.php', @@ -75,7 +75,7 @@ class question_category_list_item extends \list_item { * @return string Item html. * @throws \moodle_exception */ - public function item_html($extraargs = []) : string { + public function item_html($extraargs = []): string { global $PAGE, $OUTPUT; $str = $extraargs['str']; $category = $this->item; diff --git a/question/bank/previewquestion/classes/helper.php b/question/bank/previewquestion/classes/helper.php index c24e498943f..3b0849a428e 100644 --- a/question/bank/previewquestion/classes/helper.php +++ b/question/bank/previewquestion/classes/helper.php @@ -284,7 +284,7 @@ class helper { * @param string $questionbankentryid Entry to check against * @return bool */ - public static function is_latest(string $version, string $questionbankentryid) : bool { + public static function is_latest(string $version, string $questionbankentryid): bool { global $DB; $sql = 'SELECT MAX(version) AS max @@ -304,7 +304,7 @@ class helper { * @param string $questionbankentryid Question bank entry id * @return array $questionids Array containing question id as key and version as value. */ - public static function load_versions(string $questionbankentryid) : array { + public static function load_versions(string $questionbankentryid): array { global $DB; $questionids = []; diff --git a/question/bank/statistics/tests/helper_test.php b/question/bank/statistics/tests/helper_test.php index 92e3c2d44b5..d8c467e5d39 100644 --- a/question/bank/statistics/tests/helper_test.php +++ b/question/bank/statistics/tests/helper_test.php @@ -322,8 +322,8 @@ class helper_test extends \advanced_testcase { array $expectedquiz1facilities, array $quiz2attempts, array $expectedquiz2facilities, - array $expectedaveragefacilities) - : void { + array $expectedaveragefacilities + ): void { $this->resetAfterTest(); list($quiz1, $quiz2, $questions) = $this->prepare_and_submit_quizzes($quiz1attempts, $quiz2attempts); diff --git a/question/bank/tagquestion/classes/external/submit_tags.php b/question/bank/tagquestion/classes/external/submit_tags.php index c6087af5f78..0d69ad5af71 100644 --- a/question/bank/tagquestion/classes/external/submit_tags.php +++ b/question/bank/tagquestion/classes/external/submit_tags.php @@ -127,7 +127,7 @@ class submit_tags extends external_api { /** * Returns description of method result value. */ - public static function execute_returns() { + public static function execute_returns() { return new external_single_structure([ 'status' => new external_value(PARAM_BOOL, 'status: true if success') ]); diff --git a/question/bank/viewquestionname/lib.php b/question/bank/viewquestionname/lib.php index ff6f3d50b67..a4fa1fc6b42 100644 --- a/question/bank/viewquestionname/lib.php +++ b/question/bank/viewquestionname/lib.php @@ -45,7 +45,7 @@ use core_external\util as external_util; * @param string $newvalue the changed question title * @return \core\output\inplace_editable */ -function qbank_viewquestionname_inplace_editable ($itemtype, $itemid, $newvalue) : \core\output\inplace_editable { +function qbank_viewquestionname_inplace_editable ($itemtype, $itemid, $newvalue): \core\output\inplace_editable { if ($itemtype === 'questionname') { global $CFG, $DB; require_once($CFG->libdir . '/questionlib.php'); diff --git a/question/behaviour/adaptive/classes/privacy/provider.php b/question/behaviour/adaptive/classes/privacy/provider.php index 8153fb5af93..5018c443f16 100644 --- a/question/behaviour/adaptive/classes/privacy/provider.php +++ b/question/behaviour/adaptive/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/adaptivenopenalty/classes/privacy/provider.php b/question/behaviour/adaptivenopenalty/classes/privacy/provider.php index d12c6b86604..13e8241826b 100644 --- a/question/behaviour/adaptivenopenalty/classes/privacy/provider.php +++ b/question/behaviour/adaptivenopenalty/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/deferredcbm/classes/privacy/provider.php b/question/behaviour/deferredcbm/classes/privacy/provider.php index e5f58726703..f3ba845fdb8 100644 --- a/question/behaviour/deferredcbm/classes/privacy/provider.php +++ b/question/behaviour/deferredcbm/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/deferredfeedback/classes/privacy/provider.php b/question/behaviour/deferredfeedback/classes/privacy/provider.php index 2e0ae870b53..b3cf013b6cd 100644 --- a/question/behaviour/deferredfeedback/classes/privacy/provider.php +++ b/question/behaviour/deferredfeedback/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/immediatecbm/classes/privacy/provider.php b/question/behaviour/immediatecbm/classes/privacy/provider.php index 7373ed5971a..c54a64f405d 100644 --- a/question/behaviour/immediatecbm/classes/privacy/provider.php +++ b/question/behaviour/immediatecbm/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/immediatefeedback/classes/privacy/provider.php b/question/behaviour/immediatefeedback/classes/privacy/provider.php index fdf380bb632..b9ac4f5a5e8 100644 --- a/question/behaviour/immediatefeedback/classes/privacy/provider.php +++ b/question/behaviour/immediatefeedback/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/informationitem/classes/privacy/provider.php b/question/behaviour/informationitem/classes/privacy/provider.php index 97f9c10c59c..ee07e1ae998 100644 --- a/question/behaviour/informationitem/classes/privacy/provider.php +++ b/question/behaviour/informationitem/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/interactive/classes/privacy/provider.php b/question/behaviour/interactive/classes/privacy/provider.php index 7608ec5e575..72c811aa1e2 100644 --- a/question/behaviour/interactive/classes/privacy/provider.php +++ b/question/behaviour/interactive/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/interactivecountback/classes/privacy/provider.php b/question/behaviour/interactivecountback/classes/privacy/provider.php index 698d048dcc6..00698ab25a5 100644 --- a/question/behaviour/interactivecountback/classes/privacy/provider.php +++ b/question/behaviour/interactivecountback/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/manualgraded/classes/privacy/provider.php b/question/behaviour/manualgraded/classes/privacy/provider.php index dfcaf51d5d4..0407a54cfbe 100644 --- a/question/behaviour/manualgraded/classes/privacy/provider.php +++ b/question/behaviour/manualgraded/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/behaviour/manualgraded/tests/walkthrough_test.php b/question/behaviour/manualgraded/tests/walkthrough_test.php index f829c3ce689..457fb445771 100644 --- a/question/behaviour/manualgraded/tests/walkthrough_test.php +++ b/question/behaviour/manualgraded/tests/walkthrough_test.php @@ -608,7 +608,7 @@ class walkthrough_test extends \qbehaviour_walkthrough_test_base { $this->manual_grade('Comment', '10.1', FORMAT_HTML); } - public function test_manual_graded_displays_proper_comment_format () { + public function test_manual_graded_displays_proper_comment_format() { global $PAGE; diff --git a/question/behaviour/missing/classes/privacy/provider.php b/question/behaviour/missing/classes/privacy/provider.php index d58f8304730..f1a1cbe3d8c 100644 --- a/question/behaviour/missing/classes/privacy/provider.php +++ b/question/behaviour/missing/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/classes/external.php b/question/classes/external.php index 782345c612b..72e125e71ff 100644 --- a/question/classes/external.php +++ b/question/classes/external.php @@ -223,7 +223,7 @@ class core_question_external extends external_api { * @see \qbank_tagquestion\external\qbank_tagquestion_external * @todo Final deprecation on Moodle 4.4 MDL-72438 */ - public static function submit_tags_form_returns() { + public static function submit_tags_form_returns() { return new external_single_structure([ 'status' => new external_value(PARAM_BOOL, 'status: true if success') ]); @@ -346,7 +346,7 @@ class core_question_external extends external_api { /** * Returns description of method result value. */ - public static function get_random_question_summaries_returns() { + public static function get_random_question_summaries_returns() { return new external_single_structure([ 'totalcount' => new external_value(PARAM_INT, 'total number of questions in result set'), 'questions' => new external_multiple_structure( diff --git a/question/classes/local/bank/edit_menu_column.php b/question/classes/local/bank/edit_menu_column.php index 796a12eb0c5..db1e6e9996d 100644 --- a/question/classes/local/bank/edit_menu_column.php +++ b/question/classes/local/bank/edit_menu_column.php @@ -69,7 +69,7 @@ class edit_menu_column extends column_base { echo $OUTPUT->render($menu); } - public function get_required_fields():array { + public function get_required_fields(): array { return ['q.qtype']; } diff --git a/question/classes/privacy/provider.php b/question/classes/privacy/provider.php index 7434ca5869e..59798447ebb 100644 --- a/question/classes/privacy/provider.php +++ b/question/classes/privacy/provider.php @@ -73,7 +73,7 @@ class provider implements * @param collection $items The collection to add metadata to. * @return collection The array of metadata */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { // Other tables link against it. // The 'question_usages' table does not contain any user data. @@ -335,7 +335,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // A user may have created or updated a question. @@ -390,7 +390,7 @@ class provider implements * @param int $userid The user to search. * @return \qubaid_join */ - public static function get_related_question_usages_for_user(string $prefix, string $component, string $joinfield, int $userid) : \qubaid_join { + public static function get_related_question_usages_for_user(string $prefix, string $component, string $joinfield, int $userid): \qubaid_join { return new \qubaid_join(" JOIN {question_usages} {$prefix}_qu ON {$prefix}_qu.id = {$joinfield} AND {$prefix}_qu.component = :{$prefix}_usagecomponent diff --git a/question/format/aiken/classes/privacy/provider.php b/question/format/aiken/classes/privacy/provider.php index e67322886ab..3b25a6121ce 100644 --- a/question/format/aiken/classes/privacy/provider.php +++ b/question/format/aiken/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/format/blackboard_six/classes/privacy/provider.php b/question/format/blackboard_six/classes/privacy/provider.php index d488a1a0ff3..f7076cac540 100644 --- a/question/format/blackboard_six/classes/privacy/provider.php +++ b/question/format/blackboard_six/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/format/gift/classes/privacy/provider.php b/question/format/gift/classes/privacy/provider.php index 84029201bef..18f1abef3c9 100644 --- a/question/format/gift/classes/privacy/provider.php +++ b/question/format/gift/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/format/missingword/classes/privacy/provider.php b/question/format/missingword/classes/privacy/provider.php index 89e7ee113b2..ee9e58c9a6e 100644 --- a/question/format/missingword/classes/privacy/provider.php +++ b/question/format/missingword/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/format/multianswer/classes/privacy/provider.php b/question/format/multianswer/classes/privacy/provider.php index ead533712e9..8b636eb99b2 100644 --- a/question/format/multianswer/classes/privacy/provider.php +++ b/question/format/multianswer/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/format/xhtml/classes/privacy/provider.php b/question/format/xhtml/classes/privacy/provider.php index 0bc69a2176c..4715953553f 100644 --- a/question/format/xhtml/classes/privacy/provider.php +++ b/question/format/xhtml/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/format/xml/classes/privacy/provider.php b/question/format/xml/classes/privacy/provider.php index 727edb4c2ac..45299841542 100644 --- a/question/format/xml/classes/privacy/provider.php +++ b/question/format/xml/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/tests/local/statistics/statistics_bulk_loader_test.php b/question/tests/local/statistics/statistics_bulk_loader_test.php index 8fd078bc443..6d51575a752 100644 --- a/question/tests/local/statistics/statistics_bulk_loader_test.php +++ b/question/tests/local/statistics/statistics_bulk_loader_test.php @@ -341,8 +341,8 @@ class statistics_bulk_loader_test extends advanced_testcase { array $expectedquiz1facilities, array $quiz2attempts, array $expectedquiz2facilities, - array $expectedaveragefacilities) - : void { + array $expectedaveragefacilities + ): void { $this->resetAfterTest(); list($quiz1, $quiz2, $questions) = $this->prepare_and_submit_quizzes($quiz1attempts, $quiz2attempts); diff --git a/question/type/calculated/classes/privacy/provider.php b/question/type/calculated/classes/privacy/provider.php index 339d9327ce0..97c2c916f55 100644 --- a/question/type/calculated/classes/privacy/provider.php +++ b/question/type/calculated/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/type/calculatedmulti/classes/privacy/provider.php b/question/type/calculatedmulti/classes/privacy/provider.php index dea8a6027e1..850c0748328 100644 --- a/question/type/calculatedmulti/classes/privacy/provider.php +++ b/question/type/calculatedmulti/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/type/calculatedsimple/classes/privacy/provider.php b/question/type/calculatedsimple/classes/privacy/provider.php index 9b520a24544..dcd1324424d 100644 --- a/question/type/calculatedsimple/classes/privacy/provider.php +++ b/question/type/calculatedsimple/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/type/ddimageortext/classes/privacy/provider.php b/question/type/ddimageortext/classes/privacy/provider.php index e28ff175cb0..092fbb0012f 100644 --- a/question/type/ddimageortext/classes/privacy/provider.php +++ b/question/type/ddimageortext/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('qtype_ddimageortext_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_ddimageortext_penalty', 'privacy:preference:penalty'); $collection->add_user_preference('qtype_ddimageortext_shuffleanswers', 'privacy:preference:shuffleanswers'); diff --git a/question/type/ddmarker/classes/privacy/provider.php b/question/type/ddmarker/classes/privacy/provider.php index a99efe153b5..bc8f803682b 100644 --- a/question/type/ddmarker/classes/privacy/provider.php +++ b/question/type/ddmarker/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('qtype_ddmarker_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_ddmarker_penalty', 'privacy:preference:penalty'); $collection->add_user_preference('qtype_ddmarker_shuffleanswers', 'privacy:preference:shuffleanswers'); diff --git a/question/type/ddwtos/classes/privacy/provider.php b/question/type/ddwtos/classes/privacy/provider.php index ddd1590518d..8ed76889cff 100644 --- a/question/type/ddwtos/classes/privacy/provider.php +++ b/question/type/ddwtos/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('qtype_ddwtos_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_ddwtos_penalty', 'privacy:preference:penalty'); $collection->add_user_preference('qtype_ddwtos_shuffleanswers', 'privacy:preference:shuffleanswers'); diff --git a/question/type/description/classes/privacy/provider.php b/question/type/description/classes/privacy/provider.php index b1949ad66ab..51ebc52358b 100644 --- a/question/type/description/classes/privacy/provider.php +++ b/question/type/description/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/type/essay/classes/privacy/provider.php b/question/type/essay/classes/privacy/provider.php index 53915397437..4d71f87abe3 100644 --- a/question/type/essay/classes/privacy/provider.php +++ b/question/type/essay/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('qtype_essay_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_essay_responseformat', 'privacy:preference:responseformat'); $collection->add_user_preference('qtype_essay_responserequired', 'privacy:preference:responserequired'); diff --git a/question/type/gapselect/classes/privacy/provider.php b/question/type/gapselect/classes/privacy/provider.php index a9aa3cbb45a..77efe28567f 100644 --- a/question/type/gapselect/classes/privacy/provider.php +++ b/question/type/gapselect/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('qtype_gapselect_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_gapselect_penalty', 'privacy:preference:penalty'); $collection->add_user_preference('qtype_gapselect_shuffleanswers', 'privacy:preference:shuffleanswers'); diff --git a/question/type/match/classes/privacy/provider.php b/question/type/match/classes/privacy/provider.php index e4d8cb99998..15d6afc72e3 100644 --- a/question/type/match/classes/privacy/provider.php +++ b/question/type/match/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('qtype_match_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_match_penalty', 'privacy:preference:penalty'); $collection->add_user_preference('qtype_match_shuffleanswers', 'privacy:preference:shuffleanswers'); diff --git a/question/type/missingtype/classes/privacy/provider.php b/question/type/missingtype/classes/privacy/provider.php index f4bee6b6360..b1d51be30af 100644 --- a/question/type/missingtype/classes/privacy/provider.php +++ b/question/type/missingtype/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/type/multianswer/classes/privacy/provider.php b/question/type/multianswer/classes/privacy/provider.php index 2bc8bd877ad..5658865ddd9 100644 --- a/question/type/multianswer/classes/privacy/provider.php +++ b/question/type/multianswer/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index 039bfc61d9a..b9b18b3abeb 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -609,7 +609,7 @@ function qtype_multianswer_extract_question($text) { * @param object $question The multianswer question to validate as returned by qtype_multianswer_extract_question * @return array Array of error messages with questions field names as keys. */ -function qtype_multianswer_validate_question(stdClass $question) : array { +function qtype_multianswer_validate_question(stdClass $question): array { $errors = array(); if (!isset($question->options->questions)) { $errors['questiontext'] = get_string('questionsmissing', 'qtype_multianswer'); diff --git a/question/type/multichoice/classes/privacy/provider.php b/question/type/multichoice/classes/privacy/provider.php index 8be1a51b013..8cfce070977 100644 --- a/question/type/multichoice/classes/privacy/provider.php +++ b/question/type/multichoice/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_user_preference('qtype_multichoice_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_multichoice_penalty', 'privacy:preference:penalty'); $collection->add_user_preference('qtype_multichoice_single', 'privacy:preference:single'); diff --git a/question/type/multichoice/tests/upgrade_old_attempt_data_test.php b/question/type/multichoice/tests/upgrade_old_attempt_data_test.php index fafac81ad8b..c55f3f84f02 100644 --- a/question/type/multichoice/tests/upgrade_old_attempt_data_test.php +++ b/question/type/multichoice/tests/upgrade_old_attempt_data_test.php @@ -1921,7 +1921,7 @@ public function test_multichoice_deferredfeedback_qsession140() { $this->compare_qas($expectedqa, $qa); } - public function test_multichoice_deferredfeedback_qsession4307870 () { + public function test_multichoice_deferredfeedback_qsession4307870() { $quiz = (object) array( 'id' => '4070', 'course' => '5139', diff --git a/question/type/numerical/classes/privacy/provider.php b/question/type/numerical/classes/privacy/provider.php index 8039877bad9..c4e7d25d91b 100644 --- a/question/type/numerical/classes/privacy/provider.php +++ b/question/type/numerical/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_user_preference('qtype_numerical_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_numerical_penalty', 'privacy:preference:penalty'); $collection->add_user_preference('qtype_numerical_unitrole', 'privacy:preference:unitrole'); diff --git a/question/type/numerical/questiontype.php b/question/type/numerical/questiontype.php index 37d29dafbb7..1cbed5df3e7 100644 --- a/question/type/numerical/questiontype.php +++ b/question/type/numerical/questiontype.php @@ -57,7 +57,7 @@ class qtype_numerical extends question_type { * @param string $x a string * @return bool whether $x is a number that the numerical question type can interpret. */ - public static function is_valid_number(string $x) : bool { + public static function is_valid_number(string $x): bool { $ap = new qtype_numerical_answer_processor(array()); list($value, $unit) = $ap->apply_units($x); return !is_null($value) && !$unit; diff --git a/question/type/random/classes/privacy/provider.php b/question/type/random/classes/privacy/provider.php index 04a32966014..7b9d3c36f48 100644 --- a/question/type/random/classes/privacy/provider.php +++ b/question/type/random/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/type/randomsamatch/classes/privacy/provider.php b/question/type/randomsamatch/classes/privacy/provider.php index f743c2bd67a..f4fc895c7da 100644 --- a/question/type/randomsamatch/classes/privacy/provider.php +++ b/question/type/randomsamatch/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/question/type/shortanswer/classes/privacy/provider.php b/question/type/shortanswer/classes/privacy/provider.php index 27b890c0260..a22d17f2162 100644 --- a/question/type/shortanswer/classes/privacy/provider.php +++ b/question/type/shortanswer/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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_user_preference('qtype_shortanswer_defaultmark', 'privacy:preference:defaultmark'); $collection->add_user_preference('qtype_shortanswer_penalty', 'privacy:preference:penalty'); $collection->add_user_preference('qtype_shortanswer_usecase', 'privacy:preference:usecase'); diff --git a/rating/classes/privacy/provider.php b/rating/classes/privacy/provider.php index 864ec4f4872..bb68ea95fe1 100644 --- a/rating/classes/privacy/provider.php +++ b/rating/classes/privacy/provider.php @@ -56,7 +56,7 @@ class provider implements * @param collection $collection The initialised collection to add items to. * @return collection A listing of user data stored through the subsystem. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { // The table 'rating' cotains data that a user has entered. // It stores the user-entered rating alongside a mapping to describe what was mapped. $collection->add_database_table('rating', [ diff --git a/report/backups/classes/privacy/provider.php b/report/backups/classes/privacy/provider.php index bab05ac8da7..f8c20db411b 100644 --- a/report/backups/classes/privacy/provider.php +++ b/report/backups/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/competency/classes/privacy/provider.php b/report/competency/classes/privacy/provider.php index e2966980e57..01892840ea9 100644 --- a/report/competency/classes/privacy/provider.php +++ b/report/competency/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/completion/classes/privacy/provider.php b/report/completion/classes/privacy/provider.php index b1b1c68ddbf..09969217f69 100644 --- a/report/completion/classes/privacy/provider.php +++ b/report/completion/classes/privacy/provider.php @@ -39,7 +39,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'; } } diff --git a/report/configlog/classes/privacy/provider.php b/report/configlog/classes/privacy/provider.php index cee5d89cd2e..057827b2551 100644 --- a/report/configlog/classes/privacy/provider.php +++ b/report/configlog/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/courseoverview/classes/privacy/provider.php b/report/courseoverview/classes/privacy/provider.php index ead2dacbcce..532a4e36ea4 100644 --- a/report/courseoverview/classes/privacy/provider.php +++ b/report/courseoverview/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/eventlist/classes/privacy/provider.php b/report/eventlist/classes/privacy/provider.php index 88697e0d8fc..66ecd0f2dfa 100644 --- a/report/eventlist/classes/privacy/provider.php +++ b/report/eventlist/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/infectedfiles/classes/privacy/provider.php b/report/infectedfiles/classes/privacy/provider.php index 3631c1d2c97..00d77b37b4c 100644 --- a/report/infectedfiles/classes/privacy/provider.php +++ b/report/infectedfiles/classes/privacy/provider.php @@ -48,7 +48,7 @@ class provider implements * @param collection $collection the collection object to add data to. * @return collection The populated collection. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $collection->add_database_table( 'infected_files', [ @@ -68,7 +68,7 @@ class provider implements * @param int $userid The userid to get contexts for. * @return request\contextlist the context list for the user. */ - public static function get_contexts_for_userid(int $userid) : request\contextlist { + public static function get_contexts_for_userid(int $userid): request\contextlist { $contextlist = new request\contextlist(); // The system context is the only context where information is stored. diff --git a/report/infectedfiles/classes/table/infectedfiles_table.php b/report/infectedfiles/classes/table/infectedfiles_table.php index 8e3fee288cd..86b92d78fd6 100644 --- a/report/infectedfiles/classes/table/infectedfiles_table.php +++ b/report/infectedfiles/classes/table/infectedfiles_table.php @@ -105,7 +105,7 @@ class infectedfiles_table extends \table_sql implements \renderable { * @param bool $count When true, return the count SQL. * @return array containing sql to use and an array of params. */ - protected function get_sql_and_params($count = false) : array { + protected function get_sql_and_params($count = false): array { if ($count) { $select = "COUNT(1)"; } else { @@ -152,7 +152,7 @@ class infectedfiles_table extends \table_sql implements \renderable { * @param \stdClass $row the row from sql. * @return string the authors name. */ - protected function col_author($row) : string { + protected function col_author($row): string { // Get user fullname from ID. $user = \core_user::get_user($row->userid); $url = new \moodle_url('/user/profile.php', ['id' => $row->userid]); @@ -177,7 +177,7 @@ class infectedfiles_table extends \table_sql implements \renderable { * @throws \coding_exception * @throws \moodle_exception */ - protected function col_actions($row) : string { + protected function col_actions($row): string { global $OUTPUT; $filename = $row->quarantinedfile; $fileid = $row->id; @@ -219,7 +219,7 @@ class infectedfiles_table extends \table_sql implements \renderable { * @param \stdClass $row an incident record. * @return string time created in user-friendly format. */ - protected function col_timecreated($row) : string { + protected function col_timecreated($row): string { return userdate($row->timecreated); } diff --git a/report/insights/classes/privacy/provider.php b/report/insights/classes/privacy/provider.php index be7f83bd24c..17063bc72a9 100644 --- a/report/insights/classes/privacy/provider.php +++ b/report/insights/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/log/classes/privacy/provider.php b/report/log/classes/privacy/provider.php index 2df51db7596..ae4487b4260 100644 --- a/report/log/classes/privacy/provider.php +++ b/report/log/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/loglive/classes/privacy/provider.php b/report/loglive/classes/privacy/provider.php index f0dd1e97445..f497e9fc45e 100644 --- a/report/loglive/classes/privacy/provider.php +++ b/report/loglive/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/outline/classes/privacy/provider.php b/report/outline/classes/privacy/provider.php index 3ddcbd34419..9b35e168552 100644 --- a/report/outline/classes/privacy/provider.php +++ b/report/outline/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/participation/classes/privacy/provider.php b/report/participation/classes/privacy/provider.php index b29f19d1812..048d5581aa3 100644 --- a/report/participation/classes/privacy/provider.php +++ b/report/participation/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/performance/classes/privacy/provider.php b/report/performance/classes/privacy/provider.php index 8f6e62ac4fe..d24aeba5a3d 100644 --- a/report/performance/classes/privacy/provider.php +++ b/report/performance/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/progress/classes/privacy/provider.php b/report/progress/classes/privacy/provider.php index 3c61a6ddbe4..ce0924efe06 100644 --- a/report/progress/classes/privacy/provider.php +++ b/report/progress/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/report/questioninstances/classes/privacy/provider.php b/report/questioninstances/classes/privacy/provider.php index 7056ecb9863..9dd562ccf85 100644 --- a/report/questioninstances/classes/privacy/provider.php +++ b/report/questioninstances/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/security/classes/privacy/provider.php b/report/security/classes/privacy/provider.php index ef328e76544..dc403b1f637 100644 --- a/report/security/classes/privacy/provider.php +++ b/report/security/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/report/stats/classes/privacy/provider.php b/report/stats/classes/privacy/provider.php index 900b7ed5a3c..5176bd9754d 100644 --- a/report/stats/classes/privacy/provider.php +++ b/report/stats/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @param collection $collection A list of information about this component * @return collection The collection object filled out with information about this component. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $statsuserdaily = [ 'courseid' => 'privacy:metadata:courseid', 'userid' => 'privacy:metadata:userid', @@ -91,7 +91,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $params = ['userid' => $userid, 'contextcourse' => CONTEXT_COURSE]; $sql = "SELECT ctx.id FROM {context} ctx diff --git a/report/status/classes/privacy/provider.php b/report/status/classes/privacy/provider.php index a686b907c28..c8c712ccb60 100644 --- a/report/status/classes/privacy/provider.php +++ b/report/status/classes/privacy/provider.php @@ -41,7 +41,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'; } } diff --git a/report/usersessions/classes/privacy/provider.php b/report/usersessions/classes/privacy/provider.php index 87f9546114f..8b90656af58 100644 --- a/report/usersessions/classes/privacy/provider.php +++ b/report/usersessions/classes/privacy/provider.php @@ -40,7 +40,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'; } } \ No newline at end of file diff --git a/reportbuilder/classes/local/filters/number.php b/reportbuilder/classes/local/filters/number.php index 8ef02a45f49..35348326264 100644 --- a/reportbuilder/classes/local/filters/number.php +++ b/reportbuilder/classes/local/filters/number.php @@ -111,7 +111,7 @@ class number extends base { * @param array $values * @return array array of two elements - SQL query and named parameters */ - public function get_sql_filter(array $values) : array { + public function get_sql_filter(array $values): array { $operator = (int) ($values["{$this->name}_operator"] ?? self::ANY_VALUE); $value1 = $values["{$this->name}_value1"] ?? null; diff --git a/reportbuilder/classes/local/filters/text.php b/reportbuilder/classes/local/filters/text.php index c7210e78a47..f543272a9e0 100644 --- a/reportbuilder/classes/local/filters/text.php +++ b/reportbuilder/classes/local/filters/text.php @@ -61,7 +61,7 @@ class text extends base { * * @return array of comparison operators */ - private function get_operators() : array { + private function get_operators(): array { $operators = [ self::ANY_VALUE => get_string('filterisanyvalue', 'core_reportbuilder'), self::CONTAINS => get_string('filtercontains', 'core_reportbuilder'), diff --git a/reportbuilder/classes/local/helpers/report.php b/reportbuilder/classes/local/helpers/report.php index b979443896e..4e69f704861 100644 --- a/reportbuilder/classes/local/helpers/report.php +++ b/reportbuilder/classes/local/helpers/report.php @@ -406,7 +406,7 @@ class report { * * @deprecated since Moodle 4.1 - please do not use this function any more, {@see custom_report_column_cards_exporter} */ - public static function get_available_columns(report_model $persistent) : array { + public static function get_available_columns(report_model $persistent): array { debugging('The function ' . __FUNCTION__ . '() is deprecated, please do not use it any more. ' . 'See \'custom_report_column_cards_exporter\' class for replacement', DEBUG_DEVELOPER); diff --git a/reportbuilder/classes/local/models/audience.php b/reportbuilder/classes/local/models/audience.php index 108bda04d64..0f1a4359703 100644 --- a/reportbuilder/classes/local/models/audience.php +++ b/reportbuilder/classes/local/models/audience.php @@ -43,7 +43,7 @@ class audience extends persistent { * * @return array */ - protected static function define_properties() : array { + protected static function define_properties(): array { return [ 'reportid' => [ 'type' => PARAM_INT, diff --git a/reportbuilder/classes/local/models/schedule.php b/reportbuilder/classes/local/models/schedule.php index 233d9af21c9..393bddd893f 100644 --- a/reportbuilder/classes/local/models/schedule.php +++ b/reportbuilder/classes/local/models/schedule.php @@ -78,7 +78,7 @@ class schedule extends persistent { * * @return array */ - protected static function define_properties() : array { + protected static function define_properties(): array { return [ 'reportid' => [ 'type' => PARAM_INT, diff --git a/reportbuilder/tests/local/entities/user_test.php b/reportbuilder/tests/local/entities/user_test.php index 2a54e9c3cf2..f45be4efd72 100644 --- a/reportbuilder/tests/local/entities/user_test.php +++ b/reportbuilder/tests/local/entities/user_test.php @@ -52,7 +52,7 @@ class user_test extends advanced_testcase { /** * Test getting all user identity columns */ - public function test_get_identity_columns() : void { + public function test_get_identity_columns(): void { $this->resetAfterTest(); $this->setAdminUser(); @@ -99,7 +99,7 @@ class user_test extends advanced_testcase { /** * Test getting all user identity filters */ - public function test_get_identity_filters() : void { + public function test_get_identity_filters(): void { $this->resetAfterTest(); $this->setAdminUser(); diff --git a/repository/areafiles/classes/privacy/provider.php b/repository/areafiles/classes/privacy/provider.php index dfdbe725298..60771cb7ce2 100644 --- a/repository/areafiles/classes/privacy/provider.php +++ b/repository/areafiles/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/classes/privacy/provider.php b/repository/classes/privacy/provider.php index 983f908ce13..b7c8045738b 100644 --- a/repository/classes/privacy/provider.php +++ b/repository/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @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( 'repository_instances', [ @@ -78,7 +78,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // The repository_instances data is associated at the user context level, so retrieve the user's context id. diff --git a/repository/contentbank/classes/privacy/provider.php b/repository/contentbank/classes/privacy/provider.php index ae13ce47680..edfc6d9f501 100644 --- a/repository/contentbank/classes/privacy/provider.php +++ b/repository/contentbank/classes/privacy/provider.php @@ -38,7 +38,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'; } } diff --git a/repository/coursefiles/classes/privacy/provider.php b/repository/coursefiles/classes/privacy/provider.php index ea3cc6e7acc..503e492375a 100644 --- a/repository/coursefiles/classes/privacy/provider.php +++ b/repository/coursefiles/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/dropbox/classes/privacy/provider.php b/repository/dropbox/classes/privacy/provider.php index d004839b069..98b38af34d6 100644 --- a/repository/dropbox/classes/privacy/provider.php +++ b/repository/dropbox/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_external_location_link( 'dropbox.com', [ @@ -68,7 +68,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/repository/equella/classes/privacy/provider.php b/repository/equella/classes/privacy/provider.php index 2b85397e5a2..918e9a5f14f 100644 --- a/repository/equella/classes/privacy/provider.php +++ b/repository/equella/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/filesystem/classes/privacy/provider.php b/repository/filesystem/classes/privacy/provider.php index 800a254c255..2fee00f3a6f 100644 --- a/repository/filesystem/classes/privacy/provider.php +++ b/repository/filesystem/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/flickr/classes/privacy/provider.php b/repository/flickr/classes/privacy/provider.php index 226781ac2ab..ef5e6805d7c 100644 --- a/repository/flickr/classes/privacy/provider.php +++ b/repository/flickr/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @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_external_location_link( 'flickr.com', [ @@ -81,7 +81,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/repository/flickr_public/classes/privacy/provider.php b/repository/flickr_public/classes/privacy/provider.php index 8cba6608203..be6c55b5fab 100644 --- a/repository/flickr_public/classes/privacy/provider.php +++ b/repository/flickr_public/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_external_location_link( 'flickr.com', [ @@ -71,7 +71,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/repository/flickr_public/lib.php b/repository/flickr_public/lib.php index fe7f9dd1f92..e3606dbce94 100644 --- a/repository/flickr_public/lib.php +++ b/repository/flickr_public/lib.php @@ -241,7 +241,7 @@ class repository_flickr_public extends repository { return $this->print_login(); } - public function license4moodle ($license_id) { + public function license4moodle($license_id) { $license = array( '0' => 'allrightsreserved', '1' => 'cc-nc-sa', diff --git a/repository/googledocs/classes/privacy/provider.php b/repository/googledocs/classes/privacy/provider.php index a7c4f60c89b..cc7781258fa 100644 --- a/repository/googledocs/classes/privacy/provider.php +++ b/repository/googledocs/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_external_location_link( 'drive.google.com', [ @@ -70,7 +70,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/repository/local/classes/privacy/provider.php b/repository/local/classes/privacy/provider.php index 4052c95d500..cdf6d9e8780 100644 --- a/repository/local/classes/privacy/provider.php +++ b/repository/local/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/merlot/classes/privacy/provider.php b/repository/merlot/classes/privacy/provider.php index eab828e7dce..adfd818cf06 100644 --- a/repository/merlot/classes/privacy/provider.php +++ b/repository/merlot/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_external_location_link( 'merlot.org', [ @@ -70,7 +70,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/repository/nextcloud/classes/issuer_management.php b/repository/nextcloud/classes/issuer_management.php index 8db9a2b9a2a..3dc20eed7e9 100644 --- a/repository/nextcloud/classes/issuer_management.php +++ b/repository/nextcloud/classes/issuer_management.php @@ -77,7 +77,7 @@ class issuer_management { * @return array parseurl [scheme => https/http, host=>'hostname', port=>443, path=>'path'] * @throws configuration_exception if an endpoint is undefined */ - public static function parse_endpoint_url(string $endpointname, \core\oauth2\issuer $issuer) : array { + public static function parse_endpoint_url(string $endpointname, \core\oauth2\issuer $issuer): array { $url = $issuer->get_endpoint_url($endpointname); if (empty($url)) { throw new configuration_exception(get_string('endpointnotdefined', 'repository_nextcloud', $endpointname)); diff --git a/repository/nextcloud/classes/privacy/provider.php b/repository/nextcloud/classes/privacy/provider.php index afbcad15dab..b53a5d99b01 100644 --- a/repository/nextcloud/classes/privacy/provider.php +++ b/repository/nextcloud/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/nextcloud/lib.php b/repository/nextcloud/lib.php index 25f7028c04a..c256073c938 100644 --- a/repository/nextcloud/lib.php +++ b/repository/nextcloud/lib.php @@ -943,7 +943,7 @@ class repository_nextcloud extends repository { * @param stored_file $file * @return bool true if synced successfully else false if not ready to sync or reference link not set */ - public function sync_reference(stored_file $file):bool { + public function sync_reference(stored_file $file): bool { global $CFG; if ($file->get_referencelastsync() + DAYSECS > time()) { diff --git a/repository/nextcloud/tests/generator/lib.php b/repository/nextcloud/tests/generator/lib.php index d905ce85812..442e0f6faf3 100644 --- a/repository/nextcloud/tests/generator/lib.php +++ b/repository/nextcloud/tests/generator/lib.php @@ -37,7 +37,7 @@ class repository_nextcloud_generator extends testing_repository_generator { * Creates an issuer and a user. * @return \core\oauth2\issuer */ - public function test_create_issuer () { + public function test_create_issuer() { $issuerdata = new stdClass(); $issuerdata->name = "Service"; $issuerdata->clientid = "Clientid"; @@ -57,7 +57,7 @@ class repository_nextcloud_generator extends testing_repository_generator { * @param int $issuerid * @return \core\oauth2\issuer */ - public function test_create_endpoints ($issuerid) { + public function test_create_endpoints($issuerid) { $this->test_create_single_endpoint($issuerid, "ocs_endpoint"); $this->test_create_single_endpoint($issuerid, "authorization_endpoint"); $this->test_create_single_endpoint($issuerid, "webdav_endpoint", "https://www.default.test/webdav/index.php"); diff --git a/repository/nextcloud/tests/lib_test.php b/repository/nextcloud/tests/lib_test.php index c8f66937a90..190b1ba30b3 100644 --- a/repository/nextcloud/tests/lib_test.php +++ b/repository/nextcloud/tests/lib_test.php @@ -853,7 +853,7 @@ XML; * * @return array[] */ - public function sync_reference_provider():array { + public function sync_reference_provider(): array { return [ 'referecncelastsync done recently' => [ [ @@ -952,7 +952,7 @@ XML; * @param bool $expectedresult * @return void */ - public function test_sync_reference(array $storedfileargs, $storedfilemethodsmock, bool $expectedresult):void { + public function test_sync_reference(array $storedfileargs, $storedfilemethodsmock, bool $expectedresult): void { $this->resetAfterTest(true); if (isset($storedfilemethodsmock[0])) { diff --git a/repository/onedrive/classes/privacy/provider.php b/repository/onedrive/classes/privacy/provider.php index 756cbeac26e..f5b8310222f 100644 --- a/repository/onedrive/classes/privacy/provider.php +++ b/repository/onedrive/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @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_external_location_link( 'onedrive.live.com', [ @@ -83,7 +83,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); // The data is associated at the user context level, so retrieve the user's context id. diff --git a/repository/recent/classes/privacy/provider.php b/repository/recent/classes/privacy/provider.php index c78bae361d2..bb8606c8606 100644 --- a/repository/recent/classes/privacy/provider.php +++ b/repository/recent/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/s3/classes/privacy/provider.php b/repository/s3/classes/privacy/provider.php index 58c01b2d13e..2d898697168 100644 --- a/repository/s3/classes/privacy/provider.php +++ b/repository/s3/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/upload/classes/privacy/provider.php b/repository/upload/classes/privacy/provider.php index 9b7784ded07..261ad1c9cfd 100644 --- a/repository/upload/classes/privacy/provider.php +++ b/repository/upload/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/url/classes/privacy/provider.php b/repository/url/classes/privacy/provider.php index 1c4aef2f60e..63c149082d9 100644 --- a/repository/url/classes/privacy/provider.php +++ b/repository/url/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/user/classes/privacy/provider.php b/repository/user/classes/privacy/provider.php index 663d36f148b..6225da4cb2a 100644 --- a/repository/user/classes/privacy/provider.php +++ b/repository/user/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/webdav/classes/privacy/provider.php b/repository/webdav/classes/privacy/provider.php index ba707dc9e72..00cfdd39f82 100644 --- a/repository/webdav/classes/privacy/provider.php +++ b/repository/webdav/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/repository/wikimedia/classes/privacy/provider.php b/repository/wikimedia/classes/privacy/provider.php index a92fa680e12..95900563e15 100644 --- a/repository/wikimedia/classes/privacy/provider.php +++ b/repository/wikimedia/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @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_external_location_link( 'wikimedia.org', [ @@ -81,7 +81,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/repository/youtube/classes/privacy/provider.php b/repository/youtube/classes/privacy/provider.php index dbb5a86ef86..e69e40fdce0 100644 --- a/repository/youtube/classes/privacy/provider.php +++ b/repository/youtube/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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_external_location_link( 'youtube.com', [ @@ -68,7 +68,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/rss/classes/privacy/provider.php b/rss/classes/privacy/provider.php index b2f80ee6165..3355f08f2f8 100644 --- a/rss/classes/privacy/provider.php +++ b/rss/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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_subsystem_link('core_userkey', [], 'privacy:metadata:core_userkey'); return $collection; @@ -63,7 +63,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_private_key} k JOIN {user} u ON k.userid = u.id diff --git a/search/classes/base.php b/search/classes/base.php index f73238e569f..a58b20e3da1 100644 --- a/search/classes/base.php +++ b/search/classes/base.php @@ -545,7 +545,7 @@ abstract class base { * @param \core_search\document $doc * @return \core_search\document_icon */ - public function get_doc_icon(document $doc) : document_icon { + public function get_doc_icon(document $doc): document_icon { return new document_icon('i/empty'); } diff --git a/search/classes/base_block.php b/search/classes/base_block.php index 28e7b107906..6fe23e4a6ce 100644 --- a/search/classes/base_block.php +++ b/search/classes/base_block.php @@ -405,7 +405,7 @@ abstract class base_block extends base { * @param \core_search\document $doc * @return \core_search\document_icon */ - public function get_doc_icon(document $doc) : document_icon { + public function get_doc_icon(document $doc): document_icon { return new document_icon('e/anchor'); } diff --git a/search/classes/base_mod.php b/search/classes/base_mod.php index 2f638b849dc..ffe7cf5089a 100644 --- a/search/classes/base_mod.php +++ b/search/classes/base_mod.php @@ -293,7 +293,7 @@ abstract class base_mod extends base { * @param \core_search\document $doc * @return \core_search\document_icon */ - public function get_doc_icon(document $doc) : document_icon { + public function get_doc_icon(document $doc): document_icon { return new document_icon('monologo', $this->get_module_name()); } diff --git a/search/classes/privacy/provider.php b/search/classes/privacy/provider.php index 790f4fbf59b..f57bd1fbc3f 100644 --- a/search/classes/privacy/provider.php +++ b/search/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/search/engine/simpledb/classes/privacy/provider.php b/search/engine/simpledb/classes/privacy/provider.php index 5645b6b1116..c7eb72ec2db 100644 --- a/search/engine/simpledb/classes/privacy/provider.php +++ b/search/engine/simpledb/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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( 'search_simpledb_index', [ @@ -79,7 +79,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new \core_privacy\local\request\contextlist(); $params = ['userid' => $userid, 'owneruserid' => $userid]; diff --git a/search/engine/solr/classes/privacy/provider.php b/search/engine/solr/classes/privacy/provider.php index 7475b9e4d08..f3b35239c62 100644 --- a/search/engine/solr/classes/privacy/provider.php +++ b/search/engine/solr/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @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 { return $collection->add_external_location_link('solr', ['data' => 'privacy:metadata:data'], 'privacy:metadata'); } @@ -62,7 +62,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } diff --git a/tag/classes/privacy/provider.php b/tag/classes/privacy/provider.php index 0099de38215..297cc38700f 100644 --- a/tag/classes/privacy/provider.php +++ b/tag/classes/privacy/provider.php @@ -62,7 +62,7 @@ class provider implements * @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 { // The table 'tag' contains data that a user has entered. // It is currently linked with a userid, but this field will hopefulyl go away. // Note: The userid is not necessarily 100% accurate. See MDL-61555. @@ -208,7 +208,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $contextlist = new contextlist(); $contextlist->add_from_sql("SELECT c.id FROM {context} c diff --git a/tag/edit_form.php b/tag/edit_form.php index d381d79dd88..d7b6e9ba633 100644 --- a/tag/edit_form.php +++ b/tag/edit_form.php @@ -42,7 +42,7 @@ class tag_edit_form extends moodleform { * Overrides the abstract moodleform::definition method for defining what the form that is to be * presented to the user. */ - function definition () { + function definition() { $mform =& $this->_form; diff --git a/theme/boost/classes/privacy/provider.php b/theme/boost/classes/privacy/provider.php index 772df51ab18..91c3806438f 100644 --- a/theme/boost/classes/privacy/provider.php +++ b/theme/boost/classes/privacy/provider.php @@ -52,7 +52,7 @@ class provider implements * @param collection $items The initialised item collection to add items to. * @return collection A listing of user data stored through this system. */ - public static function get_metadata(collection $items) : collection { + public static function get_metadata(collection $items): collection { $items->add_user_preference(self::DRAWER_OPEN_INDEX, 'privacy:metadata:preference:draweropenindex'); $items->add_user_preference(self::DRAWER_OPEN_BLOCK, 'privacy:metadata:preference:draweropenblock'); return $items; diff --git a/theme/classic/classes/privacy/provider.php b/theme/classic/classes/privacy/provider.php index c3ce9c2cce0..ece798e0dda 100644 --- a/theme/classic/classes/privacy/provider.php +++ b/theme/classic/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/user/classes/analytics/indicator/user_profile_set.php b/user/classes/analytics/indicator/user_profile_set.php index 79cfeccab5d..46b9fc70110 100644 --- a/user/classes/analytics/indicator/user_profile_set.php +++ b/user/classes/analytics/indicator/user_profile_set.php @@ -42,7 +42,7 @@ class user_profile_set extends \core_analytics\local\indicator\linear { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:completeduserprofile'); } diff --git a/user/classes/analytics/indicator/user_track_forums.php b/user/classes/analytics/indicator/user_track_forums.php index 68ebe9ee85f..1346c46e768 100644 --- a/user/classes/analytics/indicator/user_track_forums.php +++ b/user/classes/analytics/indicator/user_track_forums.php @@ -42,7 +42,7 @@ class user_track_forums extends \core_analytics\local\indicator\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('indicator:userforumstracking'); } diff --git a/user/classes/analytics/target/upcoming_activities_due.php b/user/classes/analytics/target/upcoming_activities_due.php index 6467fcf55a9..b0b11f59265 100644 --- a/user/classes/analytics/target/upcoming_activities_due.php +++ b/user/classes/analytics/target/upcoming_activities_due.php @@ -71,7 +71,7 @@ class upcoming_activities_due extends \core_analytics\local\target\binary { * * @return \lang_string */ - public static function get_name() : \lang_string { + public static function get_name(): \lang_string { return new \lang_string('target:upcomingactivitiesdue', 'user'); } diff --git a/user/classes/form/calendar_form.php b/user/classes/form/calendar_form.php index 16364501de7..889ca7bd7ef 100644 --- a/user/classes/form/calendar_form.php +++ b/user/classes/form/calendar_form.php @@ -41,7 +41,7 @@ class calendar_form extends \moodleform { /** * Define the form. */ - public function definition () { + public function definition() { global $CFG, $USER; $mform = $this->_form; diff --git a/user/classes/form/contentbank_user_preferences_form.php b/user/classes/form/contentbank_user_preferences_form.php index 02782d0f3f1..d330266e8c0 100644 --- a/user/classes/form/contentbank_user_preferences_form.php +++ b/user/classes/form/contentbank_user_preferences_form.php @@ -34,7 +34,7 @@ class contentbank_user_preferences_form extends \moodleform { /** * Define the form. */ - public function definition () { + public function definition() { global $CFG, $USER; $mform = $this->_form; diff --git a/user/classes/form/defaulthomepage_form.php b/user/classes/form/defaulthomepage_form.php index ac67614d8db..0682929d6fa 100644 --- a/user/classes/form/defaulthomepage_form.php +++ b/user/classes/form/defaulthomepage_form.php @@ -41,7 +41,7 @@ class defaulthomepage_form extends \moodleform { /** * Define the form. */ - public function definition () { + public function definition() { global $CFG; $mform = $this->_form; diff --git a/user/classes/form/profile_field_form.php b/user/classes/form/profile_field_form.php index 4dd6017bf58..f147cb9be99 100644 --- a/user/classes/form/profile_field_form.php +++ b/user/classes/form/profile_field_form.php @@ -38,7 +38,7 @@ class profile_field_form extends dynamic_form { /** * Define the form */ - public function definition () { + public function definition() { global $CFG; require_once($CFG->dirroot.'/user/profile/definelib.php'); @@ -65,7 +65,7 @@ class profile_field_form extends dynamic_form { /** * Alter definition based on existing or submitted data */ - public function definition_after_data () { + public function definition_after_data() { $mform = $this->_form; $this->field->define_after_data($mform); } diff --git a/user/classes/privacy/provider.php b/user/classes/privacy/provider.php index 5120fb2eca7..d3e0feb43ca 100644 --- a/user/classes/privacy/provider.php +++ b/user/classes/privacy/provider.php @@ -53,7 +53,7 @@ class provider implements * @param collection $collection A list of information about this component * @return collection The collection object filled out with information about this component. */ - public static function get_metadata(collection $collection) : collection { + public static function get_metadata(collection $collection): collection { $userfields = [ 'id' => 'privacy:metadata:id', 'auth' => 'privacy:metadata:auth', @@ -192,7 +192,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $params = ['userid' => $userid, 'contextuser' => CONTEXT_USER]; $sql = "SELECT id FROM {context} diff --git a/user/classes/search/user.php b/user/classes/search/user.php index 34e547bf467..9cb1115638f 100644 --- a/user/classes/search/user.php +++ b/user/classes/search/user.php @@ -212,7 +212,7 @@ class user extends \core_search\base { * * @return \core_search\document_icon */ - public function get_doc_icon(\core_search\document $doc) : \core_search\document_icon { + public function get_doc_icon(\core_search\document $doc): \core_search\document_icon { return new \core_search\document_icon('i/user'); } diff --git a/user/edit_form.php b/user/edit_form.php index 595c733389e..1e227354af1 100644 --- a/user/edit_form.php +++ b/user/edit_form.php @@ -39,7 +39,7 @@ class user_edit_form extends moodleform { /** * Define the form. */ - public function definition () { + public function definition() { global $CFG, $COURSE, $USER; $mform = $this->_form; diff --git a/user/editor_form.php b/user/editor_form.php index c1f5ba5c83c..6c8e1650d01 100644 --- a/user/editor_form.php +++ b/user/editor_form.php @@ -39,7 +39,7 @@ class user_edit_editor_form extends moodleform { /** * Define the form. */ - public function definition () { + public function definition() { global $CFG, $COURSE; $mform = $this->_form; diff --git a/user/forum_form.php b/user/forum_form.php index d85ff62dcf4..1ba65bb4827 100644 --- a/user/forum_form.php +++ b/user/forum_form.php @@ -42,7 +42,7 @@ class user_edit_forum_form extends moodleform { /** * Define the form. */ - public function definition () { + public function definition() { global $CFG, $COURSE; $mform = $this->_form; diff --git a/user/language_form.php b/user/language_form.php index 50d091130e2..eb0d19dce1c 100644 --- a/user/language_form.php +++ b/user/language_form.php @@ -40,7 +40,7 @@ class user_edit_language_form extends moodleform { /** * Define the form. */ - public function definition () { + public function definition() { global $CFG, $COURSE, $USER; $mform = $this->_form; diff --git a/user/profile/field/checkbox/classes/privacy/provider.php b/user/profile/field/checkbox/classes/privacy/provider.php index 3781a539cf5..d56a1947c2e 100644 --- a/user/profile/field/checkbox/classes/privacy/provider.php +++ b/user/profile/field/checkbox/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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 { return $collection->add_database_table('user_info_data', [ 'userid' => 'privacy:metadata:profilefield_checkbox:userid', 'fieldid' => 'privacy:metadata:profilefield_checkbox:fieldid', @@ -64,7 +64,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_info_data} uda JOIN {user_info_field} uif ON uda.fieldid = uif.id diff --git a/user/profile/field/datetime/classes/privacy/provider.php b/user/profile/field/datetime/classes/privacy/provider.php index 5257567a24d..8f38d1395ab 100644 --- a/user/profile/field/datetime/classes/privacy/provider.php +++ b/user/profile/field/datetime/classes/privacy/provider.php @@ -50,7 +50,7 @@ class provider implements * @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 { return $collection->add_database_table('user_info_data', [ 'userid' => 'privacy:metadata:profilefield_datetime:userid', 'fieldid' => 'privacy:metadata:profilefield_datetime:fieldid', @@ -65,7 +65,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_info_data} uda JOIN {user_info_field} uif ON uda.fieldid = uif.id diff --git a/user/profile/field/menu/classes/privacy/provider.php b/user/profile/field/menu/classes/privacy/provider.php index 2becd638823..a743a3d90d2 100644 --- a/user/profile/field/menu/classes/privacy/provider.php +++ b/user/profile/field/menu/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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 { return $collection->add_database_table('user_info_data', [ 'userid' => 'privacy:metadata:profilefield_menu:userid', 'fieldid' => 'privacy:metadata:profilefield_menu:fieldid', @@ -64,7 +64,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_info_data} uda JOIN {user_info_field} uif ON uda.fieldid = uif.id diff --git a/user/profile/field/social/classes/privacy/provider.php b/user/profile/field/social/classes/privacy/provider.php index 8c3c458c21a..9e0bbfcc5c1 100644 --- a/user/profile/field/social/classes/privacy/provider.php +++ b/user/profile/field/social/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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 { return $collection->add_database_table('user_info_data', [ 'userid' => 'privacy:metadata:profile_field_social:userid', 'fieldid' => 'privacy:metadata:profile_field_social:fieldid', @@ -64,7 +64,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_info_data} uda JOIN {user_info_field} uif ON uda.fieldid = uif.id diff --git a/user/profile/field/text/classes/privacy/provider.php b/user/profile/field/text/classes/privacy/provider.php index 778a2142f54..cc7df556acf 100644 --- a/user/profile/field/text/classes/privacy/provider.php +++ b/user/profile/field/text/classes/privacy/provider.php @@ -47,7 +47,7 @@ class provider implements * @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 { return $collection->add_database_table('user_info_data', [ 'userid' => 'privacy:metadata:profilefield_text:userid', 'fieldid' => 'privacy:metadata:profilefield_text:fieldid', @@ -62,7 +62,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_info_data} uda JOIN {user_info_field} uif ON uda.fieldid = uif.id diff --git a/user/profile/field/textarea/classes/privacy/provider.php b/user/profile/field/textarea/classes/privacy/provider.php index 15fb47e56b2..141c23a21dc 100644 --- a/user/profile/field/textarea/classes/privacy/provider.php +++ b/user/profile/field/textarea/classes/privacy/provider.php @@ -49,7 +49,7 @@ class provider implements * @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 { return $collection->add_database_table('user_info_data', [ 'userid' => 'privacy:metadata:profile_field_textarea:userid', 'fieldid' => 'privacy:metadata:profile_field_textarea:fieldid', @@ -64,7 +64,7 @@ class provider implements * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ - public static function get_contexts_for_userid(int $userid) : contextlist { + public static function get_contexts_for_userid(int $userid): contextlist { $sql = "SELECT ctx.id FROM {user_info_data} uda JOIN {user_info_field} uif ON uda.fieldid = uif.id diff --git a/webservice/rest/classes/privacy/provider.php b/webservice/rest/classes/privacy/provider.php index efbe5c0fabe..32109b4460f 100644 --- a/webservice/rest/classes/privacy/provider.php +++ b/webservice/rest/classes/privacy/provider.php @@ -40,7 +40,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'; } } diff --git a/webservice/soap/classes/privacy/provider.php b/webservice/soap/classes/privacy/provider.php index e27bbbc43e7..4e317714dce 100644 --- a/webservice/soap/classes/privacy/provider.php +++ b/webservice/soap/classes/privacy/provider.php @@ -40,7 +40,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'; } }