From 8fc1486d36ad7ed5f44deddd80bd6b19a8410e06 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Tue, 28 Feb 2023 13:13:42 +0000 Subject: [PATCH] MDL-77164 various: fix incorrect phpdocs --- .../local/setting/adminpresets_setting.php | 4 +-- admin/presets/classes/manager.php | 3 ++- admin/presets/classes/privacy/provider.php | 2 +- admin/roles/classes/allow_view_page.php | 5 ++-- .../classes/local/action/base.php | 2 +- admin/tool/analytics/classes/external.php | 2 +- .../classes/output/restorable_models.php | 2 +- .../brickfield/classes/brickfieldconnect.php | 1 - admin/tool/brickfield/classes/manager.php | 2 +- .../dataprivacy/classes/metadata_registry.php | 4 ++- .../tool/log/classes/plugininfo/logstore.php | 1 + admin/tool/lp/classes/external.php | 3 ++- .../output/manage_competencies_page.php | 4 +-- .../output/user_competency_summary.php | 2 +- .../user_competency_summary_in_plan.php | 8 +++--- admin/tool/usertours/classes/helper.php | 26 +++++++++---------- admin/tool/usertours/classes/step.php | 12 ++++----- admin/tool/usertours/classes/tour.php | 4 +-- auth/db/auth.php | 2 +- backup/moodle2/restore_plugin.class.php | 2 +- backup/moodle2/restore_stepslib.php | 4 +-- backup/moodle2/restore_subplugin.class.php | 5 ++++ backup/util/dbops/restore_dbops.class.php | 2 +- .../util/plan/backup_structure_step.class.php | 17 ++++++++---- backup/util/plan/base_step.class.php | 6 +++-- backup/util/plan/base_task.class.php | 7 ++++- .../structure/backup_nested_element.class.php | 13 +++++++++- backup/util/ui/import_extensions.php | 2 +- badges/classes/backpack_api.php | 3 ++- badges/classes/badge.php | 2 +- .../comments/tests/privacy/provider_test.php | 9 ++++--- blocks/html/classes/privacy/provider.php | 2 +- blocks/html/lib.php | 2 +- blocks/myprofile/classes/output/myprofile.php | 2 +- blocks/online_users/tests/generator_test.php | 2 +- .../classes/output/main.php | 2 +- blocks/rss_client/classes/output/feed.php | 4 +-- blocks/rss_client/classes/output/item.php | 2 +- blocks/rss_client/classes/output/renderer.php | 14 +++++----- .../rss_client/classes/privacy/provider.php | 2 +- .../tag_flickr/classes/privacy/provider.php | 2 +- blocks/tag_youtube/block_tag_youtube.php | 2 +- blocks/tests/privacy/provider_test.php | 8 +++--- blocks/timeline/classes/output/main.php | 2 +- cache/classes/helper.php | 5 ++-- cache/classes/loaders.php | 2 +- .../external/calendar_event_exporter.php | 8 +++--- .../local/event/data_access/event_vault.php | 2 +- .../local/event/proxies/cm_info_proxy.php | 2 +- .../local/event/proxies/proxy_interface.php | 2 +- .../raw_event_retrieval_strategy.php | 2 +- calendar/classes/privacy/provider.php | 6 ++--- calendar/lib.php | 4 +-- competency/classes/api.php | 10 +++---- competency/classes/competency.php | 6 ++--- competency/classes/competency_framework.php | 2 +- competency/classes/user_competency.php | 2 +- .../criteria/completion_criteria_date.php | 2 +- .../criteria/completion_criteria_role.php | 2 +- ...tion_events_by_timeline_classification.php | 2 +- course/classes/output/content_export_link.php | 2 +- course/classes/output/course_module_name.php | 2 +- course/classes/privacy/provider.php | 2 +- course/classes/search/course.php | 2 +- course/externallib.php | 6 ++--- course/format/classes/base.php | 2 +- .../local/content/section/controlmenu.php | 2 +- .../classes/output/local/state/section.php | 2 +- course/togglecompletion.php | 1 + enrol/classes/privacy/provider.php | 2 +- enrol/cohort/classes/privacy/provider.php | 2 +- enrol/externallib.php | 2 +- enrol/fee/classes/privacy/provider.php | 2 +- enrol/flatfile/tests/flatfile_test.php | 12 ++++----- enrol/ldap/classes/task/sync_enrolments.php | 2 +- enrol/ldap/tests/ldap_test.php | 2 +- enrol/locallib.php | 2 +- enrol/lti/tests/privacy/provider_test.php | 3 ++- enrol/meta/classes/privacy/provider.php | 2 +- enrol/paypal/classes/util.php | 2 +- enrol/paypal/tests/paypal_test.php | 4 +-- enrol/paypal/tests/privacy/provider_test.php | 1 + enrol/tests/course_enrolment_manager_test.php | 4 +-- enrol/tests/externallib_test.php | 6 ++--- files/tests/conversion_test.php | 2 +- filter/glossary/tests/filter_test.php | 8 +++--- .../guide/tests/privacy/provider_test.php | 6 ++--- grade/lib.php | 2 +- .../singleview/classes/local/screen/grade.php | 2 +- group/lib.php | 6 +++-- h5p/classes/helper.php | 10 +++---- lib/accesslib.php | 8 +++--- lib/adminlib.php | 3 ++- lib/authlib.php | 2 +- lib/badgeslib.php | 6 ++--- lib/behat/classes/behat_core_generator.php | 10 ++++--- lib/behat/classes/behat_session_trait.php | 4 +-- lib/blocklib.php | 4 ++- lib/classes/antivirus/scanner.php | 2 +- lib/classes/check/access/defaultuserrole.php | 2 +- lib/classes/check/access/frontpagerole.php | 2 +- lib/classes/check/access/guestrole.php | 2 +- lib/classes/check/access/riskadmin.php | 2 +- lib/classes/check/access/riskbackup.php | 2 +- lib/classes/check/access/riskxss.php | 2 +- lib/classes/check/check.php | 4 +-- lib/classes/check/environment/antivirus.php | 2 +- lib/classes/check/environment/environment.php | 2 +- lib/classes/check/environment/publicpaths.php | 2 +- .../check/environment/upgradecheck.php | 2 +- lib/classes/check/http/cookiesecure.php | 2 +- lib/classes/check/performance/backups.php | 2 +- lib/classes/check/performance/cachejs.php | 2 +- lib/classes/check/performance/dbschema.php | 2 +- lib/classes/check/performance/debugging.php | 2 +- .../check/performance/designermode.php | 2 +- lib/classes/check/performance/stats.php | 2 +- lib/classes/check/result.php | 4 +-- lib/classes/check/security/crawlers.php | 2 +- .../security/emailchangeconfirmation.php | 2 +- lib/classes/check/security/embed.php | 2 +- lib/classes/check/security/openprofiles.php | 2 +- lib/classes/check/security/passwordpolicy.php | 2 +- lib/classes/check/security/webcron.php | 2 +- lib/classes/check/table.php | 2 +- .../export/exporters/course_exporter.php | 4 +-- lib/classes/event/tag_added.php | 2 +- lib/classes/event/tag_removed.php | 2 +- lib/classes/external/exporter.php | 2 +- lib/classes/hub/registration.php | 8 +++--- lib/classes/lock/mysql_lock_factory.php | 2 +- lib/classes/log/sql_reader.php | 2 +- lib/classes/navigation/output/primary.php | 2 +- lib/classes/navigation/views/view.php | 4 +-- lib/classes/notification.php | 2 +- lib/classes/output/inplace_editable.php | 4 +-- lib/classes/output/language_menu.php | 4 +-- lib/classes/output/notification.php | 4 +-- lib/classes/output/sticky_footer.php | 2 +- lib/classes/output/url_rewriter.php | 4 +-- lib/classes/persistent.php | 2 +- lib/classes/plugin_manager.php | 2 +- lib/classes/plugininfo/antivirus.php | 1 + lib/classes/plugininfo/auth.php | 1 + lib/classes/plugininfo/availability.php | 1 + lib/classes/plugininfo/block.php | 1 + lib/classes/plugininfo/calendartype.php | 1 + lib/classes/plugininfo/contenttype.php | 3 ++- lib/classes/plugininfo/customfield.php | 1 + lib/classes/plugininfo/dataformat.php | 1 + lib/classes/plugininfo/editor.php | 1 + lib/classes/plugininfo/enrol.php | 1 + lib/classes/plugininfo/fileconverter.php | 1 + lib/classes/plugininfo/filter.php | 1 + lib/classes/plugininfo/format.php | 1 + lib/classes/plugininfo/media.php | 2 ++ lib/classes/plugininfo/message.php | 1 + lib/classes/plugininfo/mlbackend.php | 1 + lib/classes/plugininfo/mod.php | 1 + lib/classes/plugininfo/orphaned.php | 2 +- lib/classes/plugininfo/paygw.php | 1 + lib/classes/plugininfo/qbank.php | 1 + lib/classes/plugininfo/qtype.php | 1 + lib/classes/plugininfo/webservice.php | 1 + lib/classes/privacy/provider.php | 2 +- lib/classes/session/manager.php | 2 +- lib/classes/string_manager_standard.php | 2 +- lib/classes/task/manager.php | 2 +- .../send_failed_login_notifications_task.php | 1 + lib/classes/task/task_base.php | 2 +- lib/classes/update/api.php | 4 +-- lib/ddl/mysql_sql_generator.php | 2 ++ lib/ddl/sql_generator.php | 6 ++--- lib/dml/moodle_database.php | 15 ++++++----- lib/dml/mysqli_native_moodle_database.php | 5 ++-- lib/dml/oci_native_moodle_database.php | 7 ++--- lib/dml/pdo_moodle_database.php | 2 +- lib/dml/pgsql_native_moodle_database.php | 9 ++++--- lib/dml/pgsql_native_moodle_recordset.php | 3 ++- lib/dml/sqlsrv_native_moodle_database.php | 5 ++-- .../fixtures/read_slave_moodle_database.php | 2 +- ...read_slave_moodle_database_mock_mysqli.php | 2 +- .../tests/fixtures/test_moodle_database.php | 4 ++- lib/dml/tests/fixtures/test_sql_generator.php | 3 +++ lib/dml/tests/recordset_walk_test.php | 2 ++ lib/dmllib.php | 2 +- lib/editor/atto/classes/plugininfo/atto.php | 1 + lib/editor/atto/classes/privacy/provider.php | 2 +- lib/editor/tiny/classes/plugininfo/tiny.php | 1 + .../autosave/classes/privacy/provider.php | 2 +- lib/enrollib.php | 4 +-- lib/excellib.class.php | 2 +- lib/external/classes/util.php | 6 ++--- lib/external/tests/privacy/provider_test.php | 4 +-- lib/filebrowser/file_info.php | 2 +- lib/filebrowser/tests/file_browser_test.php | 3 ++- lib/filelib.php | 4 +-- lib/filestorage/file_storage.php | 2 +- lib/filestorage/tests/file_storage_test.php | 3 +++ .../tests/file_system_filedir_test.php | 4 +-- lib/filestorage/tests/file_system_test.php | 2 +- lib/filestorage/tests/zip_packer_test.php | 2 +- lib/form/classes/filetypes_util.php | 2 +- lib/form/modgrade.php | 2 +- lib/form/passwordunmask.php | 2 +- lib/form/selectgroups.php | 2 +- lib/form/tests/dateselector_test.php | 4 +-- lib/form/tests/datetimeselector_test.php | 4 +-- lib/formslib.php | 14 +++++----- lib/gdlib.php | 6 ++--- lib/grade/grade_category.php | 2 +- lib/grade/grade_object.php | 2 +- lib/grade/tests/grade_category_test.php | 6 ++--- lib/grade/tests/grade_item_test.php | 2 +- lib/gradelib.php | 5 ++-- lib/moodlelib.php | 8 +++--- lib/navigationlib.php | 12 ++++----- lib/outputcomponents.php | 2 +- lib/outputrenderers.php | 14 +++++----- lib/pagelib.php | 4 +-- lib/pear/HTML/QuickForm.php | 2 +- lib/phpunit/classes/util.php | 4 +-- lib/portfolio/exporter.php | 2 +- lib/portfolio/formats.php | 2 +- lib/portfolio/plugin.php | 4 +-- lib/questionlib.php | 4 +-- lib/tablelib.php | 22 ++++++++-------- lib/testing/generator/block_generator.php | 2 +- lib/testing/generator/data_generator.php | 8 +++--- lib/testing/generator/module_generator.php | 2 +- lib/testing/lib.php | 2 +- lib/tests/accesslib_has_capability_test.php | 4 +-- .../core_renderer_template_exploit_test.php | 2 +- .../contentbank_content_created_test.php | 1 + .../contentbank_content_deleted_test.php | 1 + .../contentbank_content_updated_test.php | 1 + .../event/contentbank_content_viewed_test.php | 1 + lib/tests/event/context_locked_test.php | 1 + .../fixtures/testable_plugin_manager.php | 2 +- .../h5p_clean_orphaned_records_task_test.php | 1 + lib/tests/moodlelib_test.php | 2 +- .../filtersettingsperformancetester.php | 1 + lib/tests/questionlib_test.php | 19 +++++++++++++- lib/tests/task/logging_test.php | 2 +- lib/tests/update_api_test.php | 1 + lib/weblib.php | 9 +++---- lib/xapi/classes/local/statement.php | 4 +-- .../classes/local/statement/item_group.php | 4 +-- .../local/statement/item_attachment_test.php | 2 +- .../local/statement/item_result_test.php | 2 +- lib/xmldb/xmldb_field.php | 6 ++--- lib/xmldb/xmldb_object.php | 12 ++++----- lib/xmldb/xmldb_structure.php | 2 +- mod/assign/classes/output/grading_app.php | 2 +- mod/assign/classes/output/renderer.php | 4 +-- .../privacy/assign_plugin_request_data.php | 8 +++--- mod/assign/classes/privacy/provider.php | 2 +- .../comments/tests/privacy/provider_test.php | 4 +-- .../feedback/editpdf/classes/annotation.php | 2 +- .../editpdf/classes/combined_document.php | 6 ++--- .../editpdf/classes/comments_quick_list.php | 2 +- .../editpdf/classes/document_services.php | 6 ++--- .../feedback/editpdf/classes/page_editor.php | 2 +- mod/assign/feedback/editpdf/classes/pdf.php | 2 +- .../feedback/editpdf/tests/feedback_test.php | 4 +-- .../editpdf/tests/privacy/provider_test.php | 6 ++--- .../file/tests/privacy/provider_test.php | 4 +-- mod/assign/lib.php | 2 +- mod/assign/locallib.php | 4 +-- .../classes/event/assessable_uploaded.php | 2 +- mod/bigbluebuttonbn/classes/recording.php | 2 +- mod/bigbluebuttonbn/classes/settings.php | 2 +- mod/bigbluebuttonbn/lib.php | 6 ++--- mod/book/lib.php | 2 +- mod/chat/lib.php | 2 +- mod/choice/lib.php | 2 +- mod/data/lib.php | 2 +- mod/feedback/item/multichoicerated/lib.php | 5 ++++ mod/feedback/lib.php | 6 ++--- mod/feedback/tests/generator/lib.php | 18 ++++++------- mod/forum/classes/output/forum_post.php | 2 +- mod/forum/lib.php | 4 +-- mod/glossary/lib.php | 6 ++--- mod/h5pactivity/lib.php | 2 +- mod/imscp/lib.php | 2 +- mod/lesson/lib.php | 4 +-- mod/lesson/tests/generator/lib.php | 2 +- .../local/ltiservice/resource_base.php | 2 +- mod/page/lib.php | 2 +- mod/quiz/lib.php | 4 +-- mod/quiz/report/statistics/report.php | 3 ++- mod/resource/lib.php | 2 +- mod/scorm/lib.php | 11 ++++---- mod/survey/lib.php | 4 +-- mod/url/classes/search/activity.php | 4 +-- mod/url/locallib.php | 2 +- mod/wiki/locallib.php | 3 ++- mod/workshop/classes/privacy/provider.php | 2 +- privacy/classes/local/metadata/collection.php | 4 +-- privacy/classes/local/request/writer.php | 2 +- .../classes/tests/request/content_writer.php | 12 ++++----- .../classes/customfield/question_handler.php | 2 +- .../engine/variants/least_used_strategy.php | 4 +-- rating/classes/phpunit/privacy_helper.php | 2 +- rating/lib.php | 2 +- repository/lib.php | 10 +++---- repository/recent/tests/lib_test.php | 8 +++--- repository/tests/privacy/provider_test.php | 1 - search/classes/base_activity.php | 2 +- search/engine/simpledb/tests/engine_test.php | 5 +--- search/engine/solr/tests/engine_test.php | 3 --- search/tests/base_activity_test.php | 8 +++--- search/tests/base_block_test.php | 2 +- search/tests/top_result_test.php | 2 ++ tag/classes/tests/privacy_helper.php | 2 +- tag/tests/taglib_test.php | 4 +-- user/classes/output/myprofile/manager.php | 2 +- user/editlib.php | 2 +- user/externallib.php | 2 +- user/lib.php | 6 ++--- user/profile/field/social/define.class.php | 4 +-- .../tests/group_non_members_selector_test.php | 2 -- user/tests/privacy/provider_test.php | 4 +-- webservice/rest/tests/server_test.php | 2 +- webservice/soap/locallib.php | 1 + webservice/tests/helpers.php | 2 +- webservice/tests/lib_test.php | 6 ++--- 327 files changed, 644 insertions(+), 533 deletions(-) diff --git a/admin/presets/classes/local/setting/adminpresets_setting.php b/admin/presets/classes/local/setting/adminpresets_setting.php index 92103872603..413a2b160e2 100644 --- a/admin/presets/classes/local/setting/adminpresets_setting.php +++ b/admin/presets/classes/local/setting/adminpresets_setting.php @@ -170,7 +170,7 @@ class adminpresets_setting { /** * Saves the setting attributes values * - * @return array Array of inserted ids (in config_log) + * @return array|false Array of inserted ids (in config_log) or false if nothing was inserted */ public function save_attributes_values() { // Plugin name or null. @@ -209,8 +209,6 @@ class adminpresets_setting { * @param bool $name Setting name to store. * @param mixed $value Setting value to store. * @return int|false config_log inserted id or false whenever the new value is the same as old value. - * @throws dml_exception - * @throws moodle_exception */ public function save_value($name = false, $value = null) { // Object values if no arguments. diff --git a/admin/presets/classes/manager.php b/admin/presets/classes/manager.php index fc059ddb43f..95321541c9f 100644 --- a/admin/presets/classes/manager.php +++ b/admin/presets/classes/manager.php @@ -183,7 +183,8 @@ class manager { * @param boolean $sitedbvalues Indicates if $dbsettings comes from the site db or not * @param array $settings Array format $array['plugin']['settingname'] = settings_types child class * @param array|false $children Array of admin_category children or false - * @return array Array format $array['plugin']['settingname'] = settings_types child class + * @return \core_adminpresets\local\setting\adminpresets_setting[][] Array format + * $array['plugin']['settingname'] = adminpresets_setting child class */ public function get_settings(array $dbsettings, bool $sitedbvalues = false, array $settings = [], $children = false): array { global $DB; diff --git a/admin/presets/classes/privacy/provider.php b/admin/presets/classes/privacy/provider.php index c552b0b45f7..81b955d972f 100644 --- a/admin/presets/classes/privacy/provider.php +++ b/admin/presets/classes/privacy/provider.php @@ -99,7 +99,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { // None of the the data from these tables should be deleted. diff --git a/admin/roles/classes/allow_view_page.php b/admin/roles/classes/allow_view_page.php index d3313220d0c..9b6a5bf6ca6 100644 --- a/admin/roles/classes/allow_view_page.php +++ b/admin/roles/classes/allow_view_page.php @@ -54,10 +54,9 @@ class core_role_allow_view_page extends core_role_allow_role_page { /** * Get tool tip for cell. - * @param string $fromrole - * @param string $targetrole + * @param stdClass $fromrole + * @param stdClass $targetrole * @return string - * @throws \coding_exception */ protected function get_cell_tooltip($fromrole, $targetrole) { $a = new stdClass; diff --git a/admin/tool/admin_presets/classes/local/action/base.php b/admin/tool/admin_presets/classes/local/action/base.php index fc1e6ffab32..86ddd71aa85 100644 --- a/admin/tool/admin_presets/classes/local/action/base.php +++ b/admin/tool/admin_presets/classes/local/action/base.php @@ -56,7 +56,7 @@ class base { /** @var int The output content to display in the page. **/ protected $outputs; - /** @var int The moodle form to display in the page. **/ + /** @var \moodleform The moodle form to display in the page. **/ protected $moodleform; /** @var manager The manager helper class instance. **/ diff --git a/admin/tool/analytics/classes/external.php b/admin/tool/analytics/classes/external.php index 8ea300f473c..2771cae297b 100644 --- a/admin/tool/analytics/classes/external.php +++ b/admin/tool/analytics/classes/external.php @@ -96,7 +96,7 @@ class external extends external_api { * potential_contexts return * * @since Moodle 3.8 - * @return external_description + * @return \core_external\external_description */ public static function potential_contexts_returns() { return new external_multiple_structure( diff --git a/admin/tool/analytics/classes/output/restorable_models.php b/admin/tool/analytics/classes/output/restorable_models.php index a4e345673c6..f8dca62f6a1 100644 --- a/admin/tool/analytics/classes/output/restorable_models.php +++ b/admin/tool/analytics/classes/output/restorable_models.php @@ -51,7 +51,7 @@ class restorable_models implements \renderable, \templatable { /** * Export the list of models to be rendered. * - * @param renderer_base $output + * @param \renderer_base $output * @return string */ public function export_for_template(\renderer_base $output) { diff --git a/admin/tool/brickfield/classes/brickfieldconnect.php b/admin/tool/brickfield/classes/brickfieldconnect.php index ee1857eb375..0b1657109a9 100644 --- a/admin/tool/brickfield/classes/brickfieldconnect.php +++ b/admin/tool/brickfield/classes/brickfieldconnect.php @@ -244,7 +244,6 @@ class brickfieldconnect extends curl { /** * Get the check registration API URI. * @return string - * @throws dml_exception */ protected function get_baseapiuri(): string { $baseapiuri = get_config(manager::PLUGINNAME, 'baseapiuri'); diff --git a/admin/tool/brickfield/classes/manager.php b/admin/tool/brickfield/classes/manager.php index 97fff856690..0c67267a169 100644 --- a/admin/tool/brickfield/classes/manager.php +++ b/admin/tool/brickfield/classes/manager.php @@ -788,7 +788,7 @@ class manager { * Get course module summary information for a course. * * @param int $courseid - * @return stdClass[] + * @return \stdClass[] */ public static function get_cm_summary_for_course(int $courseid): array { global $DB; diff --git a/admin/tool/dataprivacy/classes/metadata_registry.php b/admin/tool/dataprivacy/classes/metadata_registry.php index 65264807acb..e54e97ad2f9 100644 --- a/admin/tool/dataprivacy/classes/metadata_registry.php +++ b/admin/tool/dataprivacy/classes/metadata_registry.php @@ -23,6 +23,8 @@ */ namespace tool_dataprivacy; +use core_privacy\local\metadata\types\type; + defined('MOODLE_INTERNAL') || die(); /** @@ -114,7 +116,7 @@ class metadata_registry { /** * Formats the metadata for use with a template. * - * @param array $collection The collection associated with the component that we want to expand and format. + * @param type[] $collection The collection associated with the component that we want to expand and format. * @param string $component The component that we are dealing in * @param array $internaldata The array to add the formatted metadata to. * @return array The internal data array with the formatted metadata. diff --git a/admin/tool/log/classes/plugininfo/logstore.php b/admin/tool/log/classes/plugininfo/logstore.php index 28ae96e6061..b87741320d7 100644 --- a/admin/tool/log/classes/plugininfo/logstore.php +++ b/admin/tool/log/classes/plugininfo/logstore.php @@ -80,6 +80,7 @@ class logstore extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $section = $this->get_settings_section_name(); diff --git a/admin/tool/lp/classes/external.php b/admin/tool/lp/classes/external.php index d59b54fa28e..4d7990ca50c 100644 --- a/admin/tool/lp/classes/external.php +++ b/admin/tool/lp/classes/external.php @@ -42,6 +42,7 @@ use core_competency\external\user_competency_plan_exporter; use core_course\external\course_module_summary_exporter; use core_course\external\course_summary_exporter; use core_external\external_api; +use core_external\external_description; use core_external\external_function_parameters; use core_external\external_multiple_structure; use core_external\external_single_structure; @@ -109,7 +110,7 @@ class external extends external_api { /** * Loads the data required to render the competency_frameworks_manage_page template. * - * @param context $pagecontext The page context + * @param \context $pagecontext The page context * @return \stdClass */ public static function data_for_competency_frameworks_manage_page($pagecontext) { diff --git a/admin/tool/lp/classes/output/manage_competencies_page.php b/admin/tool/lp/classes/output/manage_competencies_page.php index 5541900be6f..6d954c3fc37 100644 --- a/admin/tool/lp/classes/output/manage_competencies_page.php +++ b/admin/tool/lp/classes/output/manage_competencies_page.php @@ -59,7 +59,7 @@ class manage_competencies_page implements renderable, templatable { /** @var moodle_url $pluginurlbase Base url to use constructing links. */ protected $pluginbaseurl = null; - /** @var context $pagecontext The page context. */ + /** @var \context $pagecontext The page context. */ protected $pagecontext = null; /** @var \core_competency\competency $competency The competency to show when the page loads. */ @@ -73,7 +73,7 @@ class manage_competencies_page implements renderable, templatable { * * @param \core_competency\competency_framework $framework Competency framework. * @param string $search Search string. - * @param context $pagecontext The page context. + * @param \context $pagecontext The page context. * @param \core_competency\competency $competency The core competency to show when the page loads. */ public function __construct($framework, $search, $pagecontext, $competency) { diff --git a/admin/tool/lp/classes/output/user_competency_summary.php b/admin/tool/lp/classes/output/user_competency_summary.php index 53680069c2f..ff42ab50597 100644 --- a/admin/tool/lp/classes/output/user_competency_summary.php +++ b/admin/tool/lp/classes/output/user_competency_summary.php @@ -61,7 +61,7 @@ class user_competency_summary implements renderable, templatable { * Export the data. * * @param renderer_base $output - * @return stdClass + * @return \stdClass */ public function export_for_template(renderer_base $output) { if (!isset($related['user'])) { diff --git a/admin/tool/lp/classes/output/user_competency_summary_in_plan.php b/admin/tool/lp/classes/output/user_competency_summary_in_plan.php index f2cd81b12d7..81f4c09fc71 100644 --- a/admin/tool/lp/classes/output/user_competency_summary_in_plan.php +++ b/admin/tool/lp/classes/output/user_competency_summary_in_plan.php @@ -38,10 +38,10 @@ use tool_lp\external\user_competency_summary_in_plan_exporter; */ class user_competency_summary_in_plan implements renderable, templatable { - /** @var competencyid */ + /** @var int competencyid */ protected $competencyid; - /** @var planid */ + /** @var int planid */ protected $planid; /** @@ -58,8 +58,8 @@ class user_competency_summary_in_plan implements renderable, templatable { /** * Export the data. * - * @param renderer_base $output - * @return stdClass + * @param \renderer_base $output + * @return \stdClass */ public function export_for_template(\renderer_base $output) { global $DB; diff --git a/admin/tool/usertours/classes/helper.php b/admin/tool/usertours/classes/helper.php index dcb12f6353a..6c2befa697a 100644 --- a/admin/tool/usertours/classes/helper.php +++ b/admin/tool/usertours/classes/helper.php @@ -66,7 +66,7 @@ class helper { * @param int $stepid The step ID. * @param int $targettype The type of step. * - * @return moodle_url + * @return \moodle_url */ public static function get_edit_step_link($tourid, $stepid = null, $targettype = null) { $link = new \moodle_url('/admin/tool/usertours/configure.php'); @@ -88,7 +88,7 @@ class helper { * @param int $tourid The tour ID. * @param int $direction The direction to move in * - * @return moodle_url + * @return \moodle_url */ public static function get_move_tour_link($tourid, $direction = self::MOVE_DOWN) { $link = new \moodle_url('/admin/tool/usertours/configure.php'); @@ -107,7 +107,7 @@ class helper { * @param int $stepid The step ID. * @param int $direction The direction to move in * - * @return moodle_url + * @return \moodle_url */ public static function get_move_step_link($stepid, $direction = self::MOVE_DOWN) { $link = new \moodle_url('/admin/tool/usertours/configure.php'); @@ -126,7 +126,7 @@ class helper { * @param int $tourid The ID of the tour to attach this step to. * @param int $targettype The type of target. * - * @return moodle_url The required URL. + * @return \moodle_url The required URL. */ public static function get_new_step_link($tourid, $targettype = null) { $link = new \moodle_url('/admin/tool/usertours/configure.php'); @@ -141,7 +141,7 @@ class helper { * Get the link used to view the tour. * * @param int $tourid The ID of the tour to display. - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_view_tour_link($tourid) { return new \moodle_url('/admin/tool/usertours/configure.php', [ @@ -154,7 +154,7 @@ class helper { * Get the link used to reset the tour state for all users. * * @param int $tourid The ID of the tour to display. - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_reset_tour_for_all_link($tourid) { return new \moodle_url('/admin/tool/usertours/configure.php', [ @@ -168,7 +168,7 @@ class helper { * Get the link used to edit the tour. * * @param int $tourid The ID of the tour to edit. - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_edit_tour_link($tourid = null) { $link = new \moodle_url('/admin/tool/usertours/configure.php'); @@ -186,7 +186,7 @@ class helper { /** * Get the link used to import the tour. * - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_import_tour_link() { $link = new \moodle_url('/admin/tool/usertours/configure.php', [ @@ -200,7 +200,7 @@ class helper { * Get the link used to export the tour. * * @param int $tourid The ID of the tour to export. - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_export_tour_link($tourid) { $link = new \moodle_url('/admin/tool/usertours/configure.php', [ @@ -215,7 +215,7 @@ class helper { * Get the link used to duplicate the tour. * * @param int $tourid The ID of the tour to duplicate. - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_duplicate_tour_link($tourid) { $link = new \moodle_url('/admin/tool/usertours/configure.php', [ @@ -230,7 +230,7 @@ class helper { * Get the link used to delete the tour. * * @param int $tourid The ID of the tour to delete. - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_delete_tour_link($tourid) { return new \moodle_url('/admin/tool/usertours/configure.php', [ @@ -243,7 +243,7 @@ class helper { /** * Get the link for listing tours. * - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_list_tour_link() { $link = new \moodle_url('/admin/tool/usertours/configure.php'); @@ -295,7 +295,7 @@ class helper { * Get the link for deleting steps. * * @param int $stepid The ID of the step to display. - * @return moodle_url The URL. + * @return \moodle_url The URL. */ public static function get_delete_step_link($stepid) { return new \moodle_url('/admin/tool/usertours/configure.php', [ diff --git a/admin/tool/usertours/classes/step.php b/admin/tool/usertours/classes/step.php index 0ba9de85c65..95715e177ad 100644 --- a/admin/tool/usertours/classes/step.php +++ b/admin/tool/usertours/classes/step.php @@ -388,7 +388,7 @@ class step { /** * Get the link to move this step up in the sortorder. * - * @return moodle_url + * @return \moodle_url */ public function get_moveup_link() { return helper::get_move_step_link($this->get_id(), helper::MOVE_UP); @@ -397,7 +397,7 @@ class step { /** * Get the link to move this step down in the sortorder. * - * @return moodle_url + * @return \moodle_url */ public function get_movedown_link() { return helper::get_move_step_link($this->get_id(), helper::MOVE_DOWN); @@ -464,7 +464,7 @@ class step { /** * Get the edit link for this step. * - * @return moodle_url + * @return \moodle_url */ public function get_edit_link() { return helper::get_edit_step_link($this->tourid, $this->id); @@ -473,7 +473,7 @@ class step { /** * Get the delete link for this step. * - * @return moodle_url + * @return \moodle_url */ public function get_delete_link() { return helper::get_delete_step_link($this->id); @@ -674,7 +674,7 @@ class step { /** * Add the step configuration to the form. * - * @param MoodleQuickForm $mform The form to add configuration to. + * @param \MoodleQuickForm $mform The form to add configuration to. * @return $this */ public function add_config_to_form(\MoodleQuickForm $mform) { @@ -694,7 +694,7 @@ class step { /** * Add the specified step field configuration to the form. * - * @param MoodleQuickForm $mform The form to add configuration to. + * @param \MoodleQuickForm $mform The form to add configuration to. * @param string $key The key to add. * @return $this */ diff --git a/admin/tool/usertours/classes/tour.php b/admin/tool/usertours/classes/tour.php index be8678c52fe..c51f9e85f0d 100644 --- a/admin/tool/usertours/classes/tour.php +++ b/admin/tool/usertours/classes/tour.php @@ -367,7 +367,7 @@ class tour { /** * The link to view this tour. * - * @return moodle_url + * @return \moodle_url */ public function get_view_link() { return helper::get_view_tour_link($this->id); @@ -376,7 +376,7 @@ class tour { /** * The link to edit this tour. * - * @return moodle_url + * @return \moodle_url */ public function get_edit_link() { return helper::get_edit_tour_link($this->id); diff --git a/auth/db/auth.php b/auth/db/auth.php index bb9ed70363d..3a4d9696104 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -541,7 +541,7 @@ class auth_plugin_db extends auth_plugin_base { * Reads user information from DB and return it in an object. * * @param string $username username - * @return array + * @return stdClass */ function get_userinfo_asobj($username) { $user_array = truncate_userinfo($this->get_userinfo($username)); diff --git a/backup/moodle2/restore_plugin.class.php b/backup/moodle2/restore_plugin.class.php index 31a94f50e9f..8f2693662c7 100644 --- a/backup/moodle2/restore_plugin.class.php +++ b/backup/moodle2/restore_plugin.class.php @@ -38,7 +38,7 @@ abstract class restore_plugin { protected $plugintype; /** @var string */ protected $pluginname; - /** @var string */ + /** @var restore_path_element */ protected $connectionpoint; /** @var restore_structure_step */ protected $step; diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index 2b8d3321744..007c7885cc4 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -5487,7 +5487,7 @@ class restore_create_question_files extends restore_execution_step { * * @param int $oldctxid Old context id. * @param int $newctxid New context id. - * @param \core\progress $progress Progress object to use. + * @param \core\progress\base $progress Progress object to use. */ private function send_common_files($oldctxid, $newctxid, $progress) { // Add common question files (question and question_answer ones). @@ -5515,7 +5515,7 @@ class restore_create_question_files extends restore_execution_step { * @param text $qtype The qtype name to send. * @param int $oldctxid Old context id. * @param int $newctxid New context id. - * @param \core\progress $progress Progress object to use. + * @param \core\progress\base $progress Progress object to use. */ private function send_qtype_files($qtype, $oldctxid, $newctxid, $progress) { if (!isset($this->qtypecomponentscache[$qtype])) { diff --git a/backup/moodle2/restore_subplugin.class.php b/backup/moodle2/restore_subplugin.class.php index c848219ccf8..226cefb7662 100644 --- a/backup/moodle2/restore_subplugin.class.php +++ b/backup/moodle2/restore_subplugin.class.php @@ -36,10 +36,15 @@ defined('MOODLE_INTERNAL') || die(); */ abstract class restore_subplugin { + /** @var string */ protected $subplugintype; + /** @var string */ protected $subpluginname; + /** @var restore_path_element */ protected $connectionpoint; + /** @var restore_step */ protected $step; + /** @var restore_task */ protected $task; public function __construct($subplugintype, $subpluginname, $step) { diff --git a/backup/util/dbops/restore_dbops.class.php b/backup/util/dbops/restore_dbops.class.php index fa85101ebc0..998049cd06d 100644 --- a/backup/util/dbops/restore_dbops.class.php +++ b/backup/util/dbops/restore_dbops.class.php @@ -206,7 +206,7 @@ abstract class restore_dbops { * @param int $restoreid id of backup * @param string $itemname name of the item * @param int $itemid id of item - * @return array backup id's + * @return stdClass|false record from 'backup_ids_temp' table * @todo MDL-25290 replace static backupids* with MUC code */ protected static function get_backup_ids_cached($restoreid, $itemname, $itemid) { diff --git a/backup/util/plan/backup_structure_step.class.php b/backup/util/plan/backup_structure_step.class.php index e94cfe8022f..6344299aa11 100644 --- a/backup/util/plan/backup_structure_step.class.php +++ b/backup/util/plan/backup_structure_step.class.php @@ -29,11 +29,18 @@ */ abstract class backup_structure_step extends backup_step { - protected $filename; // Name of the file to be generated - protected $contenttransformer; // xml content transformer being used - // (need it here, apart from xml_writer, - // thanks to serialized data to process - - // say thanks to blocks!) + /** + * Name of the file to be generated + * @var string + */ + protected $filename; + + /** + * xml content transformer being used (need it here, apart from xml_writer, + * thanks to serialized data to process - say thanks to blocks!) + * @var backup_xml_transformer|null + */ + protected $contenttransformer; /** * Constructor - instantiates one object of this class diff --git a/backup/util/plan/base_step.class.php b/backup/util/plan/base_step.class.php index 66f1f6bebdb..b1b7a6af508 100644 --- a/backup/util/plan/base_step.class.php +++ b/backup/util/plan/base_step.class.php @@ -29,8 +29,10 @@ */ abstract class base_step implements executable, loggable { - protected $name; // One simple name for identification purposes - protected $task; // Task this is part of + /** @var string One simple name for identification purposes */ + protected $name; + /** @var base_task|null Task this is part of */ + protected $task; /** * Constructor - instantiates one object of this class diff --git a/backup/util/plan/base_task.class.php b/backup/util/plan/base_task.class.php index ce30c063b91..7973aa26ec2 100644 --- a/backup/util/plan/base_task.class.php +++ b/backup/util/plan/base_task.class.php @@ -29,12 +29,17 @@ */ abstract class base_task implements checksumable, executable, loggable { + /** @var string */ protected $name; // One simple name for identification purposes + /** @var backup_plan|restore_plan */ protected $plan; // Plan this is part of + /** @var base_setting[] */ protected $settings; // One array of base_setting elements to define this task + /** @var base_step[] */ protected $steps; // One array of base_step elements - + /** @var bool */ protected $built; // Flag to know if one task has been built + /** @var bool */ protected $executed; // Flag to know if one task has been executed /** diff --git a/backup/util/structure/backup_nested_element.class.php b/backup/util/structure/backup_nested_element.class.php index 32abd9ac19d..0959d80a3cf 100644 --- a/backup/util/structure/backup_nested_element.class.php +++ b/backup/util/structure/backup_nested_element.class.php @@ -29,16 +29,27 @@ */ class backup_nested_element extends base_nested_element implements processable { - protected $var_array; // To be used in case we pass one in-memory structure + /** @var array To be used in case we pass one in-memory structure */ + protected $var_array; + /** @var string */ protected $table; // Table (without prefix) to fetch records from + /** @var string */ protected $tablesortby; // The field to sort by when using the table methods + /** @var string */ protected $sql; // Raw SQL to fetch records from + /** @var mixed */ protected $params; // Unprocessed params as specified in the set_source() call + /** @var array */ protected $procparams;// Processed (path resolved) params array + /** @var array */ protected $aliases; // Define DB->final element aliases + /** @var array */ protected $fileannotations; // array of file areas to be searched by file annotations + /** @var int */ protected $counter; // Number of instances of this element that have been processed + /** @var array */ protected $results; // Logs the results we encounter during the process. + /** @var stdClass[] */ protected $logs; // Some log messages that could be retrieved later. /** diff --git a/backup/util/ui/import_extensions.php b/backup/util/ui/import_extensions.php index 1fd4e507b8d..f39e0dce40d 100644 --- a/backup/util/ui/import_extensions.php +++ b/backup/util/ui/import_extensions.php @@ -207,7 +207,7 @@ class import_ui_stage_confirmation extends backup_ui_stage_confirmation { /** * Initialises the stages moodleform - * @return moodleform + * @return base_moodleform */ protected function initialise_stage_form() { $form = parent::initialise_stage_form(); diff --git a/badges/classes/backpack_api.php b/badges/classes/backpack_api.php index e0db0035400..38627e6a0db 100644 --- a/badges/classes/backpack_api.php +++ b/badges/classes/backpack_api.php @@ -545,7 +545,8 @@ class backpack_api { /** * Authenticate using the stored email and password and save the valid access tokens. * - * @return integer The id of the authenticated user. + * @return mixed The id of the authenticated user as returned by the backpack. Can have + * different formats - numeric, empty, object with 'error' property, etc. */ public function authenticate() { global $SESSION; diff --git a/badges/classes/badge.php b/badges/classes/badge.php index a5186070291..284556154db 100644 --- a/badges/classes/badge.php +++ b/badges/classes/badge.php @@ -164,7 +164,7 @@ class badge { /** * Use to get context instance of a badge. * - * @return context instance. + * @return \context|void instance. */ public function get_context() { if ($this->type == BADGE_TYPE_SITE) { diff --git a/blocks/comments/tests/privacy/provider_test.php b/blocks/comments/tests/privacy/provider_test.php index 8cecd1380ac..f68574c456f 100644 --- a/blocks/comments/tests/privacy/provider_test.php +++ b/blocks/comments/tests/privacy/provider_test.php @@ -26,6 +26,7 @@ namespace block_comments\privacy; use core_privacy\local\metadata\collection; use block_comments\privacy\provider; use core_privacy\local\request\approved_userlist; +use stdClass; defined('MOODLE_INTERNAL') || die(); @@ -83,7 +84,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { * Posts a comment on a given context. * * @param string $text The comment's text. - * @param context $context The context on which we want to put the comment. + * @param \context $context The context on which we want to put the comment. */ protected function add_comment($text, \context $context) { $args = new \stdClass; @@ -103,9 +104,9 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Creates a comments block on a context. * - * @param context $context The context on which we want to put the block. - * @return block_base The created block instance. - * @throws coding_exception + * @param \context $context The context on which we want to put the block. + * @return \block_base The created block instance. + * @throws \coding_exception */ protected function add_comments_block_in_context(\context $context) { global $DB; diff --git a/blocks/html/classes/privacy/provider.php b/blocks/html/classes/privacy/provider.php index aa32e78d8b4..9d987a0d542 100644 --- a/blocks/html/classes/privacy/provider.php +++ b/blocks/html/classes/privacy/provider.php @@ -184,7 +184,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { diff --git a/blocks/html/lib.php b/blocks/html/lib.php index a9891638fea..ecc2d8d45c2 100644 --- a/blocks/html/lib.php +++ b/blocks/html/lib.php @@ -23,7 +23,7 @@ * @category files * @param stdClass $course course object * @param stdClass $birecord_or_cm block instance record - * @param stdClass $context context object + * @param context $context context object * @param string $filearea file area * @param array $args extra arguments * @param bool $forcedownload whether or not force download diff --git a/blocks/myprofile/classes/output/myprofile.php b/blocks/myprofile/classes/output/myprofile.php index b07d7811f8e..de9c7390403 100644 --- a/blocks/myprofile/classes/output/myprofile.php +++ b/blocks/myprofile/classes/output/myprofile.php @@ -56,7 +56,7 @@ class myprofile implements renderable, templatable { * Export this data so it can be used as the context for a mustache template. * * @param \renderer_base $output - * @return stdClass + * @return \stdClass */ public function export_for_template(renderer_base $output) { global $USER, $OUTPUT; diff --git a/blocks/online_users/tests/generator_test.php b/blocks/online_users/tests/generator_test.php index ad5a7dfa079..01079660a6b 100644 --- a/blocks/online_users/tests/generator_test.php +++ b/blocks/online_users/tests/generator_test.php @@ -33,7 +33,7 @@ class generator_test extends \advanced_testcase { $beforeblocks = $DB->count_records('block_instances'); $beforecontexts = $DB->count_records('context'); - /** @var block_online_users_generator $generator */ + /** @var \block_online_users_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('block_online_users'); $this->assertInstanceOf('block_online_users_generator', $generator); $this->assertEquals('online_users', $generator->get_blockname()); diff --git a/blocks/recentlyaccesseditems/classes/output/main.php b/blocks/recentlyaccesseditems/classes/output/main.php index 27741967e8c..dcd10be98ff 100644 --- a/blocks/recentlyaccesseditems/classes/output/main.php +++ b/blocks/recentlyaccesseditems/classes/output/main.php @@ -40,7 +40,7 @@ class main implements renderable, templatable { * Export this data so it can be used as the context for a mustache template. * * @param \renderer_base $output - * @return stdClass + * @return array */ public function export_for_template(renderer_base $output) { diff --git a/blocks/rss_client/classes/output/feed.php b/blocks/rss_client/classes/output/feed.php index 02f7e2db95b..28ea2cf3594 100644 --- a/blocks/rss_client/classes/output/feed.php +++ b/blocks/rss_client/classes/output/feed.php @@ -89,8 +89,8 @@ class feed implements \renderable, \templatable { * Export this for use in a mustache template context. * * @see templatable::export_for_template() - * @param renderer_base $output - * @return stdClass + * @param \renderer_base $output + * @return array */ public function export_for_template(\renderer_base $output) { $data = array( diff --git a/blocks/rss_client/classes/output/item.php b/blocks/rss_client/classes/output/item.php index 4bb603a4365..0db3512eb47 100644 --- a/blocks/rss_client/classes/output/item.php +++ b/blocks/rss_client/classes/output/item.php @@ -112,7 +112,7 @@ class item implements \renderable, \templatable { * Export context for use in mustache templates * * @see templatable::export_for_template() - * @param renderer_base $output + * @param \renderer_base $output * @return array */ public function export_for_template(\renderer_base $output) { diff --git a/blocks/rss_client/classes/output/renderer.php b/blocks/rss_client/classes/output/renderer.php index 39f02fd150b..448121d9563 100644 --- a/blocks/rss_client/classes/output/renderer.php +++ b/blocks/rss_client/classes/output/renderer.php @@ -40,8 +40,8 @@ class renderer extends \plugin_renderer_base { /** * Render an RSS Item * - * @param templatable $item - * @return string|boolean + * @param \templatable $item + * @return string */ public function render_item(\templatable $item) { $data = $item->export_for_template($this); @@ -52,8 +52,8 @@ class renderer extends \plugin_renderer_base { /** * Render an RSS Feed * - * @param templatable $feed - * @return string|boolean + * @param \templatable $feed + * @return string */ public function render_feed(\templatable $feed) { $data = $feed->export_for_template($this); @@ -65,7 +65,7 @@ class renderer extends \plugin_renderer_base { * Render an RSS feeds block * * @param \templatable $block - * @return string|boolean + * @return string */ public function render_block(\templatable $block) { $data = $block->export_for_template($this); @@ -76,8 +76,8 @@ class renderer extends \plugin_renderer_base { /** * Render the block footer * - * @param templatable $footer - * @return string|boolean + * @param \templatable $footer + * @return string */ public function render_footer(\templatable $footer) { $data = $footer->export_for_template($this); diff --git a/blocks/rss_client/classes/privacy/provider.php b/blocks/rss_client/classes/privacy/provider.php index e2b71e63735..2ad457bbde3 100644 --- a/blocks/rss_client/classes/privacy/provider.php +++ b/blocks/rss_client/classes/privacy/provider.php @@ -134,7 +134,7 @@ class provider implements /** * Delete all use data which matches the specified deletion_criteria. * - * @param context $context A user context. + * @param \context $context A user context. */ public static function delete_data_for_all_users_in_context(\context $context) { if ($context instanceof \context_user) { diff --git a/blocks/tag_flickr/classes/privacy/provider.php b/blocks/tag_flickr/classes/privacy/provider.php index d77682a231f..071395fe0d8 100644 --- a/blocks/tag_flickr/classes/privacy/provider.php +++ b/blocks/tag_flickr/classes/privacy/provider.php @@ -91,7 +91,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { } diff --git a/blocks/tag_youtube/block_tag_youtube.php b/blocks/tag_youtube/block_tag_youtube.php index c8ec5fca633..871ed164e27 100644 --- a/blocks/tag_youtube/block_tag_youtube.php +++ b/blocks/tag_youtube/block_tag_youtube.php @@ -279,7 +279,7 @@ class block_tag_youtube extends block_base { /** * Renders the list of items. * - * @param array $videosdata + * @param stdClass $videosdata * @return string HTML */ protected function render_items($videosdata) { diff --git a/blocks/tests/privacy/provider_test.php b/blocks/tests/privacy/provider_test.php index b292847b203..eb6bcf1618e 100644 --- a/blocks/tests/privacy/provider_test.php +++ b/blocks/tests/privacy/provider_test.php @@ -393,10 +393,10 @@ class provider_test extends provider_testcase { * Get the block manager. * * @param array $regions The regions. - * @param context $context The context. + * @param \context $context The context. * @param string $pagetype The page type. * @param string $subpage The sub page. - * @return block_manager + * @return \block_manager */ protected function get_block_manager($regions, $context, $pagetype = 'page-type', $subpage = '') { $page = new \moodle_page(); @@ -415,7 +415,7 @@ class provider_test extends provider_testcase { /** * Set a docked preference. * - * @param block_base $block The block. + * @param \block_base $block The block. * @param bool $value The value. * @param int $userid The user ID. */ @@ -426,7 +426,7 @@ class provider_test extends provider_testcase { /** * Set a hidden preference. * - * @param block_base $block The block. + * @param \block_base $block The block. * @param bool $value The value. * @param int $userid The user ID. */ diff --git a/blocks/timeline/classes/output/main.php b/blocks/timeline/classes/output/main.php index 352242d341f..f5d29945854 100644 --- a/blocks/timeline/classes/output/main.php +++ b/blocks/timeline/classes/output/main.php @@ -145,7 +145,7 @@ class main implements renderable, templatable { * Export this data so it can be used as the context for a mustache template. * * @param \renderer_base $output - * @return stdClass + * @return array */ public function export_for_template(renderer_base $output) { diff --git a/cache/classes/helper.php b/cache/classes/helper.php index e2f8b2300df..5f42b24909c 100644 --- a/cache/classes/helper.php +++ b/cache/classes/helper.php @@ -176,7 +176,7 @@ class cache_helper { * This function explicitly does NOT use core functions as it will in some circumstances be called before Moodle has * finished initialising. This happens when loading configuration for instance. * - * @return string + * @return array */ public static function early_get_cache_plugins() { global $CFG; @@ -211,8 +211,9 @@ class cache_helper { * @param string $component * @param string $area * @param array $identifiers - * @param array $keys + * @param array|string|int $keys * @return boolean + * @throws coding_exception */ public static function invalidate_by_definition($component, $area, array $identifiers = array(), $keys = array()) { $cache = cache::make($component, $area, $identifiers); diff --git a/cache/classes/loaders.php b/cache/classes/loaders.php index e78697be15a..b008ae1079b 100644 --- a/cache/classes/loaders.php +++ b/cache/classes/loaders.php @@ -199,7 +199,7 @@ class cache implements cache_loader { * - simpledata : Set to true if the type of the data you are going to store is scalar, or an array of scalar vars * - staticacceleration : If set to true the cache will hold onto data passing through it. * - staticaccelerationsize : The max size for the static acceleration array. - * @return cache_application|cache_session|cache_store + * @return cache_application|cache_session|cache_request */ public static function make_from_params($mode, $component, $area, array $identifiers = array(), array $options = array()) { $factory = cache_factory::instance(); diff --git a/calendar/classes/external/calendar_event_exporter.php b/calendar/classes/external/calendar_event_exporter.php index 875865d394c..f290ac32837 100644 --- a/calendar/classes/external/calendar_event_exporter.php +++ b/calendar/classes/external/calendar_event_exporter.php @@ -218,7 +218,7 @@ class calendar_event_exporter extends event_exporter_base { * Return the set of minimum and maximum date timestamp values * for the given event. * - * @param event_interface $event + * @param \core_calendar\local\event\entities\event_interface $event * @return array */ protected function get_course_timestamp_limits($event) { @@ -256,7 +256,7 @@ class calendar_event_exporter extends event_exporter_base { * Return the set of minimum and maximum date timestamp values * for the given event. * - * @param event_interface $event + * @param \core_calendar\local\event\entities\event_interface $event * @return array */ protected function get_module_timestamp_limits($event) { @@ -377,7 +377,7 @@ class calendar_event_exporter extends event_exporter_base { * * @deprecated since Moodle 3.6. Please use get_timestamp_min_limit(). * @todo final deprecation. To be removed in Moodle 3.10 - * @param DateTimeInterface $starttime The event start time + * @param \DateTimeInterface $starttime The event start time * @param array $min The module's minimum limit for the event * @return array Returns an array with mindaytimestamp and mindayerror keys. */ @@ -393,7 +393,7 @@ class calendar_event_exporter extends event_exporter_base { * * @deprecated since Moodle 3.6. Please use get_timestamp_max_limit(). * @todo final deprecation. To be removed in Moodle 3.10 - * @param DateTimeInterface $starttime The event start time + * @param \DateTimeInterface $starttime The event start time * @param array $max The module's maximum limit for the event * @return array Returns an array with maxdaytimestamp and maxdayerror keys. */ diff --git a/calendar/classes/local/event/data_access/event_vault.php b/calendar/classes/local/event/data_access/event_vault.php index 41c64c60f31..1a79f1f19fc 100644 --- a/calendar/classes/local/event/data_access/event_vault.php +++ b/calendar/classes/local/event/data_access/event_vault.php @@ -373,7 +373,7 @@ class event_vault implements event_vault_interface { * Fetches records from DB. * * @param int $userid - * @param string $whereconditions + * @param array|null $whereconditions * @param array $whereparams * @param string $ordersql * @param int $offset diff --git a/calendar/classes/local/event/proxies/cm_info_proxy.php b/calendar/classes/local/event/proxies/cm_info_proxy.php index 7aee7b04f6b..4f68cecfb55 100644 --- a/calendar/classes/local/event/proxies/cm_info_proxy.php +++ b/calendar/classes/local/event/proxies/cm_info_proxy.php @@ -72,7 +72,7 @@ class cm_info_proxy implements proxy_interface { /** * Get the full instance of the proxied class. * - * @return \stdClass + * @return \cm_info */ public function get_proxied_instance() { if (!$this->cm) { diff --git a/calendar/classes/local/event/proxies/proxy_interface.php b/calendar/classes/local/event/proxies/proxy_interface.php index d6ed0214621..54133e5f6cc 100644 --- a/calendar/classes/local/event/proxies/proxy_interface.php +++ b/calendar/classes/local/event/proxies/proxy_interface.php @@ -46,7 +46,7 @@ interface proxy_interface { /** * Get the full instance of the proxied class. * - * @return \stdClass + * @return mixed */ public function get_proxied_instance(); } diff --git a/calendar/classes/local/event/strategies/raw_event_retrieval_strategy.php b/calendar/classes/local/event/strategies/raw_event_retrieval_strategy.php index 183158a0dd2..794ea3e9ae1 100644 --- a/calendar/classes/local/event/strategies/raw_event_retrieval_strategy.php +++ b/calendar/classes/local/event/strategies/raw_event_retrieval_strategy.php @@ -68,7 +68,7 @@ class raw_event_retrieval_strategy implements raw_event_retrieval_strategy_inter * @param array|int|boolean $users array of users, user id or boolean for all/no user events * @param array|int|boolean $groups array of groups, group id or boolean for all/no group events * @param array|int|boolean $courses array of courses, course id or boolean for all/no course events - * @param string $whereconditions The conditions in the WHERE clause. + * @param array $whereconditions The conditions in the WHERE clause. * @param array $whereparams The parameters for the WHERE clause. * @param string $ordersql The ORDER BY clause. * @param int $offset Offset. diff --git a/calendar/classes/privacy/provider.php b/calendar/classes/privacy/provider.php index 369b6012026..63f4b72ed04 100644 --- a/calendar/classes/privacy/provider.php +++ b/calendar/classes/privacy/provider.php @@ -252,7 +252,7 @@ class provider implements /** * Delete all Calendar Event and Calendar Subscription data for all users in the specified context. * - * @param context $context Transform the specific context to delete data for. + * @param \context $context Transform the specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { // Delete all Calendar Events in the specified context in batches. @@ -575,7 +575,7 @@ class provider implements * Helper function to return the Calendar Events for a given user and context list. * * @param approved_contextlist $contextlist - * @return array + * @return \moodle_recordset * @throws \coding_exception * @throws \dml_exception */ @@ -642,7 +642,7 @@ class provider implements * Helper function to return the Calendar Subscriptions for a given user and context list. * * @param approved_contextlist $contextlist - * @return array + * @return \moodle_recordset * @throws \coding_exception * @throws \dml_exception */ diff --git a/calendar/lib.php b/calendar/lib.php index 061fa8daf43..41de255e92d 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -182,7 +182,7 @@ define('CALENDAR_EVENT_TYPE_ACTION', 1); */ class calendar_event { - /** @var array An object containing the event properties can be accessed via the magic __get/set methods */ + /** @var stdClass An object containing the event properties can be accessed via the magic __get/set methods */ protected $properties = null; /** @var string The converted event discription with file paths resolved. @@ -3180,7 +3180,7 @@ function calendar_import_events_from_ical(iCalendar $ical, int $subscriptionid = * Fetch a calendar subscription and update the events in the calendar. * * @param int $subscriptionid The course ID for the calendar. - * @return string A log of the import progress, including errors. + * @return array A log of the import progress, including errors. */ function calendar_update_subscription_events($subscriptionid) { $sub = calendar_get_subscription($subscriptionid); diff --git a/competency/classes/api.php b/competency/classes/api.php index e7e3e573fff..dccc12f3403 100644 --- a/competency/classes/api.php +++ b/competency/classes/api.php @@ -459,7 +459,7 @@ class api { * * @param int $id The id of the competency to read. * @param bool $includerelated Include related tags or not. - * @return stdClass + * @return competency */ public static function read_competency($id, $includerelated = false) { static::require_enabled(); @@ -4043,7 +4043,7 @@ class api { * This method does not copy the related competencies. * * @param int $frameworkid - framework id - * @param competency[] $tree - array of competencies object + * @param stdClass[] $tree - list of framework competency nodes * @param int $oldparent - old parent id * @param int $newparent - new parent id * @return competency[] $matchids - List of old competencies ids matched with new competencies object. @@ -4083,7 +4083,7 @@ class api { /** * Recursively migrate competency rules. * - * @param competency[] $tree - array of competencies object + * @param array $tree - array of competencies object * @param competency[] $matchids - List of old competencies ids matched with new competencies object */ protected static function migrate_competency_tree_rules($tree, $matchids) { @@ -4116,7 +4116,7 @@ class api { /** * Archive user competencies in a plan. * - * @param int $plan The plan object. + * @param plan $plan The plan object. * @return void */ protected static function archive_user_competencies_in_plan($plan) { @@ -4166,7 +4166,7 @@ class api { /** * Delete archived user competencies in a plan. * - * @param int $plan The plan object. + * @param plan $plan The plan object. * @return void */ protected static function remove_archived_user_competencies_in_plan($plan) { diff --git a/competency/classes/competency.php b/competency/classes/competency.php index a6991372910..5942a623369 100644 --- a/competency/classes/competency.php +++ b/competency/classes/competency.php @@ -721,7 +721,7 @@ class competency extends persistent { * Build a framework tree with competency nodes. * * @param int $frameworkid the framework id - * @return node[] tree of framework competency nodes + * @return stdClass[] tree of framework competency nodes */ public static function get_framework_tree($frameworkid) { $competencies = self::search('', $frameworkid); @@ -731,7 +731,7 @@ class competency extends persistent { /** * Get the context from the framework. * - * @return context + * @return \context */ public function get_context() { return $this->get_framework()->get_context(); @@ -742,7 +742,7 @@ class competency extends persistent { * * @param array $all - List of all competency classes. * @param int $parentid - The current parent ID. Pass 0 to build the tree from the top. - * @return node[] $tree tree of nodes + * @return stdClass[] $tree tree of nodes */ protected static function build_tree($all, $parentid) { $tree = array(); diff --git a/competency/classes/competency_framework.php b/competency/classes/competency_framework.php index f47a1abd0ce..d1a6b43b9fa 100644 --- a/competency/classes/competency_framework.php +++ b/competency/classes/competency_framework.php @@ -70,7 +70,7 @@ class competency_framework extends persistent { /** * Get the context. * - * @return context The context + * @return \context The context */ public function get_context() { return context::instance_by_id($this->get('contextid')); diff --git a/competency/classes/user_competency.php b/competency/classes/user_competency.php index 0f99de9af83..5e6777696b9 100644 --- a/competency/classes/user_competency.php +++ b/competency/classes/user_competency.php @@ -216,7 +216,7 @@ class user_competency extends persistent { /** * Get the context. * - * @return context The context. + * @return \context The context. */ public function get_context() { return context_user::instance($this->get('userid')); diff --git a/completion/criteria/completion_criteria_date.php b/completion/criteria/completion_criteria_date.php index e3fbb6d4ab7..b077091d12c 100644 --- a/completion/criteria/completion_criteria_date.php +++ b/completion/criteria/completion_criteria_date.php @@ -54,7 +54,7 @@ class completion_criteria_date extends completion_criteria { /** * Add appropriate form elements to the critieria form * - * @param moodleform $mform Moodle forms object + * @param MoodleQuickForm $mform Moodle forms object * @param stdClass $data not used */ public function config_form_display(&$mform, $data = null) { diff --git a/completion/criteria/completion_criteria_role.php b/completion/criteria/completion_criteria_role.php index 2413fb4215f..a09b8d42098 100644 --- a/completion/criteria/completion_criteria_role.php +++ b/completion/criteria/completion_criteria_role.php @@ -54,7 +54,7 @@ class completion_criteria_role extends completion_criteria { /** * Add appropriate form elements to the critieria form * - * @param moodleform $mform Moodle forms object + * @param MoodleQuickForm $mform Moodle forms object * @param stdClass $data used to set default values of the form */ public function config_form_display(&$mform, $data = null) { diff --git a/course/classes/external/get_enrolled_courses_with_action_events_by_timeline_classification.php b/course/classes/external/get_enrolled_courses_with_action_events_by_timeline_classification.php index 91214f5f61d..7723f878c38 100644 --- a/course/classes/external/get_enrolled_courses_with_action_events_by_timeline_classification.php +++ b/course/classes/external/get_enrolled_courses_with_action_events_by_timeline_classification.php @@ -205,7 +205,7 @@ class get_enrolled_courses_with_action_events_by_timeline_classification extends /** * Returns description of method result value. * - * @return external_description + * @return \core_external\external_description */ public static function execute_returns(): external_single_structure { return new external_single_structure( diff --git a/course/classes/output/content_export_link.php b/course/classes/output/content_export_link.php index cfa667a7896..613ab3c3830 100644 --- a/course/classes/output/content_export_link.php +++ b/course/classes/output/content_export_link.php @@ -37,7 +37,7 @@ class content_export_link { * Prepare and return the various attributes required for a link/button to populate/trigger the download course content modal. * * @param \context $context The context of the content being exported. - * @return stdClass + * @return \stdClass */ public static function get_attributes(\context $context): \stdClass { global $CFG; diff --git a/course/classes/output/course_module_name.php b/course/classes/output/course_module_name.php index 070d4b1ebc3..62d354e3329 100644 --- a/course/classes/output/course_module_name.php +++ b/course/classes/output/course_module_name.php @@ -71,7 +71,7 @@ class course_module_name extends \core\output\inplace_editable { /** * Export this data so it can be used as the context for a mustache template (core/inplace_editable). * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output) { diff --git a/course/classes/privacy/provider.php b/course/classes/privacy/provider.php index ade42dd44d3..2fa4b368672 100644 --- a/course/classes/privacy/provider.php +++ b/course/classes/privacy/provider.php @@ -233,7 +233,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { // Check what context we've been delivered. diff --git a/course/classes/search/course.php b/course/classes/search/course.php index cce89ec3430..b1bab831c08 100644 --- a/course/classes/search/course.php +++ b/course/classes/search/course.php @@ -68,7 +68,7 @@ class course extends \core_search\base { /** * Returns the document associated with this course. * - * @param stdClass $record + * @param \stdClass $record * @param array $options * @return \core_search\document */ diff --git a/course/externallib.php b/course/externallib.php index 550cc920e24..6369ef29a52 100644 --- a/course/externallib.php +++ b/course/externallib.php @@ -1956,8 +1956,8 @@ class core_course_external extends external_api { * Sort categories array by path * private function: only used by get_categories * - * @param array $category1 - * @param array $category2 + * @param stdClass $category1 + * @param stdClass $category2 * @return int result of strcmp * @since Moodle 2.3 */ @@ -2637,7 +2637,7 @@ class core_course_external extends external_api { * Returns a course structure definition * * @param boolean $onlypublicdata set to true, to retrieve only fields viewable by anyone when the course is visible - * @return array the course structure + * @return external_single_structure the course structure * @since Moodle 3.2 */ protected static function get_course_structure($onlypublicdata = true) { diff --git a/course/format/classes/base.php b/course/format/classes/base.php index a4c8d45b2ad..faa2757dd95 100644 --- a/course/format/classes/base.php +++ b/course/format/classes/base.php @@ -518,7 +518,7 @@ abstract class base { * Returns the display name of the given section that the course prefers. * * @param int|stdClass $section Section object from database or just field course_sections.section - * @return Display name that the course format prefers, e.g. "Topic 2" + * @return string Display name that the course format prefers, e.g. "Topic 2" */ public function get_section_name($section) { if (is_object($section)) { diff --git a/course/format/classes/output/local/content/section/controlmenu.php b/course/format/classes/output/local/content/section/controlmenu.php index a9bab4f813c..ecc29c1c221 100644 --- a/course/format/classes/output/local/content/section/controlmenu.php +++ b/course/format/classes/output/local/content/section/controlmenu.php @@ -67,7 +67,7 @@ class controlmenu implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/course/format/classes/output/local/state/section.php b/course/format/classes/output/local/state/section.php index 63ee8f5df4e..a9e32f95640 100644 --- a/course/format/classes/output/local/state/section.php +++ b/course/format/classes/output/local/state/section.php @@ -52,7 +52,7 @@ class section implements renderable { /** * Export this data so it can be used as state object in the course editor. * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output): stdClass { diff --git a/course/togglecompletion.php b/course/togglecompletion.php index c65a99b1c7c..82ae6b625e5 100644 --- a/course/togglecompletion.php +++ b/course/togglecompletion.php @@ -64,6 +64,7 @@ if ($courseid) { require_sesskey(); completion_criteria::factory(array('id'=>$rolec, 'criteriatype'=>COMPLETION_CRITERIA_TYPE_ROLE)); //TODO: this is dumb, because it does not fetch the data?!?! + /** @var completion_criteria_role $criteria */ $criteria = completion_criteria_role::fetch(array('id'=>$rolec)); if ($criteria and user_has_role_assignment($USER->id, $criteria->role, $context->id)) { diff --git a/enrol/classes/privacy/provider.php b/enrol/classes/privacy/provider.php index 4691244a925..8deac388afa 100644 --- a/enrol/classes/privacy/provider.php +++ b/enrol/classes/privacy/provider.php @@ -185,7 +185,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { global $DB; diff --git a/enrol/cohort/classes/privacy/provider.php b/enrol/cohort/classes/privacy/provider.php index c441f4a6fb6..caed9b0b71e 100644 --- a/enrol/cohort/classes/privacy/provider.php +++ b/enrol/cohort/classes/privacy/provider.php @@ -109,7 +109,7 @@ class provider implements /** * Delete all use data which matches the specified deletion_criteria. * - * @param context $context A user context. + * @param \context $context A user context. */ public static function delete_data_for_all_users_in_context(\context $context) { if (empty($context)) { diff --git a/enrol/externallib.php b/enrol/externallib.php index 32c46afca3f..0497bc3fcf3 100644 --- a/enrol/externallib.php +++ b/enrol/externallib.php @@ -1045,7 +1045,7 @@ class core_enrol_external extends external_api { /** * Returns description of submit_user_enrolment_form parameters. * - * @return external_function_parameters. + * @return external_function_parameters */ public static function submit_user_enrolment_form_parameters() { return new external_function_parameters([ diff --git a/enrol/fee/classes/privacy/provider.php b/enrol/fee/classes/privacy/provider.php index 8c9b4c0d4de..fabe13cb405 100644 --- a/enrol/fee/classes/privacy/provider.php +++ b/enrol/fee/classes/privacy/provider.php @@ -153,7 +153,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { if ($context instanceof \context_course) { diff --git a/enrol/flatfile/tests/flatfile_test.php b/enrol/flatfile/tests/flatfile_test.php index 74bdd992761..d72993a96e8 100644 --- a/enrol/flatfile/tests/flatfile_test.php +++ b/enrol/flatfile/tests/flatfile_test.php @@ -74,9 +74,9 @@ class flatfile_test extends \advanced_testcase { global $CFG, $DB; $this->resetAfterTest(); - /** @var enrol_flatfile_plugin $flatfileplugin */ + /** @var \enrol_flatfile_plugin $flatfileplugin */ $flatfileplugin = enrol_get_plugin('flatfile'); - /** @var enrol_manual_plugin $manualplugin */ + /** @var \enrol_manual_plugin $manualplugin */ $manualplugin = enrol_get_plugin('manual'); $this->assertNotEmpty($manualplugin); @@ -283,9 +283,9 @@ class flatfile_test extends \advanced_testcase { $this->preventResetByRollback(); - /** @var enrol_flatfile_plugin $flatfileplugin */ + /** @var \enrol_flatfile_plugin $flatfileplugin */ $flatfileplugin = enrol_get_plugin('flatfile'); - /** @var enrol_manual_plugin $manualplugin */ + /** @var \enrol_manual_plugin $manualplugin */ $manualplugin = enrol_get_plugin('manual'); $this->assertNotEmpty($manualplugin); @@ -368,9 +368,9 @@ class flatfile_test extends \advanced_testcase { global $DB; $this->resetAfterTest(); - /** @var enrol_flatfile_plugin $flatfileplugin */ + /** @var \enrol_flatfile_plugin $flatfileplugin */ $flatfileplugin = enrol_get_plugin('flatfile'); - /** @var enrol_manual_plugin $manualplugin */ + /** @var \enrol_manual_plugin $manualplugin */ $manualplugin = enrol_get_plugin('manual'); $this->assertNotEmpty($manualplugin); diff --git a/enrol/ldap/classes/task/sync_enrolments.php b/enrol/ldap/classes/task/sync_enrolments.php index e34b72a0d46..fbda7ed8a4f 100644 --- a/enrol/ldap/classes/task/sync_enrolments.php +++ b/enrol/ldap/classes/task/sync_enrolments.php @@ -54,7 +54,7 @@ class sync_enrolments extends \core\task\scheduled_task { exit(0); // Note, exit with success code, this is not an error - it's just disabled. } - /** @var enrol_ldap_plugin $enrol */ + /** @var \enrol_ldap_plugin $enrol */ $enrol = enrol_get_plugin('ldap'); $trace = new \text_progress_trace(); diff --git a/enrol/ldap/tests/ldap_test.php b/enrol/ldap/tests/ldap_test.php index 13bea0effdb..c918b19f029 100644 --- a/enrol/ldap/tests/ldap_test.php +++ b/enrol/ldap/tests/ldap_test.php @@ -102,7 +102,7 @@ class ldap_test extends \advanced_testcase { } // Configure enrol plugin. - /** @var enrol_ldap_plugin $enrol */ + /** @var \enrol_ldap_plugin $enrol */ $enrol = enrol_get_plugin('ldap'); $enrol->set_config('host_url', TEST_ENROL_LDAP_HOST_URL); $enrol->set_config('start_tls', 0); diff --git a/enrol/locallib.php b/enrol/locallib.php index 798f789edc7..beeb013e72d 100644 --- a/enrol/locallib.php +++ b/enrol/locallib.php @@ -590,7 +590,7 @@ class course_enrolment_manager { * that SQL, and the filter that was used in constructing the sql. * * @global moodle_database $DB - * @return string + * @return array */ protected function get_instance_sql() { global $DB; diff --git a/enrol/lti/tests/privacy/provider_test.php b/enrol/lti/tests/privacy/provider_test.php index 33f1fea7ee0..1d832501cb8 100644 --- a/enrol/lti/tests/privacy/provider_test.php +++ b/enrol/lti/tests/privacy/provider_test.php @@ -24,6 +24,7 @@ namespace enrol_lti\privacy; use enrol_lti\privacy\provider; +use stdClass; defined('MOODLE_INTERNAL') || die(); @@ -176,7 +177,7 @@ class provider_test extends \core_privacy\tests\provider_testcase { /** * Creates a LTI user given the provided context * - * @param context $context + * @param \context $context * @param int $userid */ private function create_lti_users(\context $context, int $userid) { diff --git a/enrol/meta/classes/privacy/provider.php b/enrol/meta/classes/privacy/provider.php index b91ba1b9241..b2c9a767d29 100644 --- a/enrol/meta/classes/privacy/provider.php +++ b/enrol/meta/classes/privacy/provider.php @@ -109,7 +109,7 @@ class provider implements /** * Delete all use data which matches the specified deletion_criteria. * - * @param context $context A user context. + * @param \context $context A user context. */ public static function delete_data_for_all_users_in_context(\context $context) { if (empty($context)) { diff --git a/enrol/paypal/classes/util.php b/enrol/paypal/classes/util.php index fcb8f3c0fd3..a0d893ce59d 100644 --- a/enrol/paypal/classes/util.php +++ b/enrol/paypal/classes/util.php @@ -39,7 +39,7 @@ final class util { * Alerts site admin of potential problems. * * @param string $subject email subject - * @param stdClass $data PayPal IPN data + * @param \stdClass $data PayPal IPN data */ public static function message_paypal_error_to_admin($subject, $data) { $admin = get_admin(); diff --git a/enrol/paypal/tests/paypal_test.php b/enrol/paypal/tests/paypal_test.php index b576f06e49c..acc8a2fc416 100644 --- a/enrol/paypal/tests/paypal_test.php +++ b/enrol/paypal/tests/paypal_test.php @@ -61,9 +61,9 @@ class paypal_test extends \advanced_testcase { global $DB; $this->resetAfterTest(); - /** @var enrol_paypal_plugin $paypalplugin */ + /** @var \enrol_paypal_plugin $paypalplugin */ $paypalplugin = enrol_get_plugin('paypal'); - /** @var enrol_manual_plugin $manualplugin */ + /** @var \enrol_manual_plugin $manualplugin */ $manualplugin = enrol_get_plugin('manual'); $this->assertNotEmpty($manualplugin); diff --git a/enrol/paypal/tests/privacy/provider_test.php b/enrol/paypal/tests/privacy/provider_test.php index e2a17899e8d..75bfa8cb0e8 100644 --- a/enrol/paypal/tests/privacy/provider_test.php +++ b/enrol/paypal/tests/privacy/provider_test.php @@ -29,6 +29,7 @@ defined('MOODLE_INTERNAL') || die(); use core_privacy\local\metadata\collection; use enrol_paypal\privacy\provider; use core_privacy\local\request\writer; +use stdClass; /** * Privacy provider test for enrol_paypal. diff --git a/enrol/tests/course_enrolment_manager_test.php b/enrol/tests/course_enrolment_manager_test.php index ce8d6a97f49..c8cd3bdf38d 100644 --- a/enrol/tests/course_enrolment_manager_test.php +++ b/enrol/tests/course_enrolment_manager_test.php @@ -29,7 +29,7 @@ use course_enrolment_manager; class course_enrolment_manager_test extends \advanced_testcase { /** * The course context used in tests. - * @var stdClass + * @var \stdClass */ private $course = null; /** @@ -250,7 +250,7 @@ class course_enrolment_manager_test extends \advanced_testcase { * Sets up a custom profile field and the showuseridentity option, and creates a test user * with suitable values set. * - * @return stdClass Test user + * @return \stdClass Test user */ protected function setup_for_user_identity_tests(): \stdClass { // Configure extra fields to include one normal user field and one profile field, and diff --git a/enrol/tests/externallib_test.php b/enrol/tests/externallib_test.php index e4f0e243d44..868b444ceb2 100644 --- a/enrol/tests/externallib_test.php +++ b/enrol/tests/externallib_test.php @@ -1198,7 +1198,7 @@ class externallib_test extends externallib_advanced_testcase { $this->resetAfterTest(true); $datagen = $this->getDataGenerator(); - /** @var enrol_manual_plugin $manualplugin */ + /** @var \enrol_manual_plugin $manualplugin */ $manualplugin = enrol_get_plugin('manual'); $studentroleid = $DB->get_field('role', 'id', ['shortname' => 'student'], MUST_EXIST); @@ -1277,7 +1277,7 @@ class externallib_test extends externallib_advanced_testcase { $this->resetAfterTest(true); $datagen = $this->getDataGenerator(); - /** @var enrol_manual_plugin $manualplugin */ + /** @var \enrol_manual_plugin $manualplugin */ $manualplugin = enrol_get_plugin('manual'); $this->assertNotNull($manualplugin); @@ -1342,7 +1342,7 @@ class externallib_test extends externallib_advanced_testcase { $this->resetAfterTest(true); $datagen = $this->getDataGenerator(); - /** @var enrol_manual_plugin $manualplugin */ + /** @var \enrol_manual_plugin $manualplugin */ $manualplugin = enrol_get_plugin('manual'); $this->assertNotNull($manualplugin); diff --git a/files/tests/conversion_test.php b/files/tests/conversion_test.php index 1cacf28e0e2..ced4d29b5bd 100644 --- a/files/tests/conversion_test.php +++ b/files/tests/conversion_test.php @@ -31,7 +31,7 @@ class conversion_test extends \advanced_testcase { * @param string $filecontent The content of the mocked file * @param string $filename The file name to use in the stored_file * @param string $filerecord Any overrides to the filerecord - * @return stored_file + * @return \stored_file */ protected function create_stored_file($filecontent = 'content', $filename = 'testfile.txt', $filerecord = []) { $filerecord = array_merge([ diff --git a/filter/glossary/tests/filter_test.php b/filter/glossary/tests/filter_test.php index 4fae44c91d6..0f46ac7eb53 100644 --- a/filter/glossary/tests/filter_test.php +++ b/filter/glossary/tests/filter_test.php @@ -125,7 +125,7 @@ class filter_test extends \advanced_testcase { array('course' => $course->id, 'mainglossary' => 1)); // Create two entries with ampersands and one normal entry. - /** @var mod_glossary_generator $generator */ + /** @var \mod_glossary_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('mod_glossary'); $category = $generator->create_category($glossary, array('name' => 'My category', 'usedynalink' => 1)); @@ -163,7 +163,7 @@ class filter_test extends \advanced_testcase { array('course' => $course->id, 'mainglossary' => 1)); // Create two entries with ampersands and one normal entry. - /** @var mod_glossary_generator $generator */ + /** @var \mod_glossary_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('mod_glossary'); $normal = $generator->create_content($glossary, array('concept' => 'normal')); $amp1 = $generator->create_content($glossary, array('concept' => 'A&B')); @@ -209,7 +209,7 @@ class filter_test extends \advanced_testcase { array('course' => $course->id, 'mainglossary' => 1)); // Create two entries with ampersands and one normal entry. - /** @var mod_glossary_generator $generator */ + /** @var \mod_glossary_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('mod_glossary'); $simple = $generator->create_content($glossary, array('concept' => 'simple')); $withbrackets = $generator->create_content($glossary, array('concept' => 'more complex (perhaps)')); @@ -292,7 +292,7 @@ class filter_test extends \advanced_testcase { array('course' => $course->id, 'mainglossary' => 1)); // Create two entries with ampersands and one normal entry. - /** @var mod_glossary_generator $generator */ + /** @var \mod_glossary_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('mod_glossary'); $category = $generator->create_category($glossary, array('name' => 'My category', 'usedynalink' => 1)); diff --git a/grade/grading/form/guide/tests/privacy/provider_test.php b/grade/grading/form/guide/tests/privacy/provider_test.php index c114b8537a5..3b69b4ceb7d 100644 --- a/grade/grading/form/guide/tests/privacy/provider_test.php +++ b/grade/grading/form/guide/tests/privacy/provider_test.php @@ -173,8 +173,8 @@ class provider_test extends provider_testcase { /** * Generate a guide controller with sample data required for testing of this class. * - * @param context_module $context - * @return gradingform_guide_controller + * @param \context_module $context + * @return \gradingform_guide_controller */ protected function get_test_guide(\context_module $context): \gradingform_guide_controller { $generator = \testing_util::get_data_generator(); @@ -186,7 +186,7 @@ class provider_test extends provider_testcase { /** * Fetch a set of sample data. * - * @param gradingform_guide_controller $controller + * @param \gradingform_guide_controller $controller * @param int $itemid * @param float $spellingscore * @param string $spellingremark diff --git a/grade/lib.php b/grade/lib.php index 1bfaa0b128b..559346d1ce1 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -3646,7 +3646,7 @@ abstract class grade_helper { /** * Get information on outcomes * @param int $courseid - * @return grade_plugin_info + * @return grade_plugin_info[]|false */ public static function get_info_outcomes($courseid) { global $CFG, $SITE; diff --git a/grade/report/singleview/classes/local/screen/grade.php b/grade/report/singleview/classes/local/screen/grade.php index 1fddafdb0a4..e42b388f2be 100644 --- a/grade/report/singleview/classes/local/screen/grade.php +++ b/grade/report/singleview/classes/local/screen/grade.php @@ -197,7 +197,7 @@ class grade extends tablelike implements selectable_items, filterable_items { /** * Format a row in the table * - * @param user $item + * @param stdClass $item * @return array */ public function format_line($item): array { diff --git a/group/lib.php b/group/lib.php index 197a2f5a84f..4d4a8b9981c 100644 --- a/group/lib.php +++ b/group/lib.php @@ -241,7 +241,8 @@ function groups_remove_member($grouporid, $userorid) { * @param stdClass $data group properties * @param stdClass $editform * @param array $editoroptions - * @return id of group or false if error + * @return int id of group or throws an exception on error + * @throws moodle_exception */ function groups_create_group($data, $editform = false, $editoroptions = false) { global $CFG, $DB, $USER; @@ -327,7 +328,8 @@ function groups_create_group($data, $editform = false, $editoroptions = false) { * * @param stdClass $data grouping properties * @param array $editoroptions - * @return id of grouping or false if error + * @return int id of grouping or throws an exception on error + * @throws moodle_exception */ function groups_create_grouping($data, $editoroptions=null) { global $DB; diff --git a/h5p/classes/helper.php b/h5p/classes/helper.php index 4cf36b287e4..ac7acf74a70 100644 --- a/h5p/classes/helper.php +++ b/h5p/classes/helper.php @@ -41,8 +41,8 @@ class helper { * Store an H5P file. * * @param factory $factory The \core_h5p\factory object - * @param stored_file $file Moodle file instance - * @param stdClass $config Button options config + * @param \stored_file $file Moodle file instance + * @param \stdClass $config Button options config * @param bool $onlyupdatelibs Whether new libraries can be installed or only the existing ones can be updated * @param bool $skipcontent Should the content be skipped (so only the libraries will be saved)? * @@ -77,10 +77,10 @@ class helper { /** * Get the error messages stored in our H5P framework. * - * @param stdClass $messages The error, exception and info messages, raised while preparing and running an H5P content. + * @param \stdClass $messages The error, exception and info messages, raised while preparing and running an H5P content. * @param factory $factory The \core_h5p\factory object * - * @return stdClass with framework error messages. + * @return \stdClass with framework error messages. */ public static function get_messages(\stdClass $messages, factory $factory): \stdClass { $core = $factory->get_core(); @@ -198,7 +198,7 @@ class helper { * @param string $filepath The filepath of the file * @param int $userid The author of the file * @param \context $context The context where the file will be created - * @return stored_file The file created + * @return \stored_file The file created */ public static function create_fake_stored_file_from_path(string $filepath, int $userid = 0, \context $context = null): \stored_file { diff --git a/lib/accesslib.php b/lib/accesslib.php index 49b5ac874be..1000d93aa94 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -1519,7 +1519,7 @@ function unassign_capability($capability, $roleid, $contextid = null) { * @param string $capability capability name (string) * @param string $permission optional, the permission defined for this capability * either CAP_ALLOW, CAP_PREVENT or CAP_PROHIBIT. Defaults to null which means any. - * @param stdClass $context null means any + * @param context|null $context null means any * @return array of role records */ function get_roles_with_capability($capability, $permission = null, $context = null) { @@ -4008,7 +4008,7 @@ function sort_by_roleassignment_authority($users, context $context, $roles = arr * (and $sort by extension) params according to it, as the first field * returned by the database should be unique (ra.id is the best candidate). * - * @param int $roleid (can also be an array of ints!) + * @param int|array $roleid (can also be an array of ints!) * @param context $context * @param bool $parent if true, get list of users assigned in higher context too * @param string $fields fields from user (u.) , role assignment (ra) or role (r.) @@ -4694,7 +4694,7 @@ function role_fix_names($roleoptions, context $context = null, $rolenamedisplay * Most of the time, if the 2 components are different we should print a new line, (e.g. course system->rss client) * but when we are in grade, all reports/import/export capabilities should be together * - * @param string $cap component string a + * @param stdClass $cap component string a * @param string $comp component string b * @param int $contextlevel * @return bool whether 2 component are in different "sections" @@ -4952,7 +4952,7 @@ function prohibit_is_removable($roleid, context $context, $capability) { * it should produce as few overrides as possible. * * @param int $roleid - * @param stdClass $context + * @param stdClass|context $context * @param string $capname capability name * @param int $permission * @return void diff --git a/lib/adminlib.php b/lib/adminlib.php index c698a55e9d3..5aab3eafde8 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -1716,7 +1716,7 @@ class admin_settingpage implements part_of_admin_tree, linkable_settings_page { abstract class admin_setting { /** @var string unique ascii name, either 'mysetting' for settings that in config, or 'myplugin/mysetting' for ones in config_plugins. */ public $name; - /** @var string localised name */ + /** @var lang_string|string localised name */ public $visiblename; /** @var string localised long description in Markdown format */ public $description; @@ -8321,6 +8321,7 @@ class admin_setting_managemediaplayers extends admin_setting { $usedextensions = []; foreach ($plugins as $name => $plugin) { $url->param('media', $name); + /** @var \core\plugininfo\media $plugininfo */ $plugininfo = $pluginmanager->get_plugin_info('media_'.$name); $version = $plugininfo->versiondb; $supports = $plugininfo->supports($usedextensions); diff --git a/lib/authlib.php b/lib/authlib.php index 16e06f7580c..2d742cdc5c3 100644 --- a/lib/authlib.php +++ b/lib/authlib.php @@ -1197,7 +1197,7 @@ function signup_is_enabled() { /** * Helper function used to print locking for auth plugins on admin pages. - * @param stdclass $settings Moodle admin settings instance + * @param admin_settingpage $settings Moodle admin settings instance * @param string $auth authentication plugin shortname * @param array $userfields user profile fields * @param string $helptext help text to be displayed at top of form diff --git a/lib/badgeslib.php b/lib/badgeslib.php index f9716e62c59..d1f4d5ff5f0 100644 --- a/lib/badgeslib.php +++ b/lib/badgeslib.php @@ -131,7 +131,7 @@ class_alias('\core_badges\badge', 'badge'); /** * Sends notifications to users about awarded badges. * - * @param badge $badge Badge that was issued + * @param \core_badges\badge $badge Badge that was issued * @param int $userid Recipient ID * @param string $issued Unique hash of an issued badge * @param string $filepathhash File path hash of an issued badge for attachments @@ -881,7 +881,7 @@ function badges_open_badges_backpack_api(?int $backpackid = null) { * * @param int $id The backpack id. * @param int $userid The owner of the backpack, 0 if it's a sitewide backpack else a user's site backpack - * @return array(stdClass) + * @return stdClass */ function badges_get_site_backpack($id, int $userid = 0) { global $DB; @@ -919,7 +919,7 @@ function badges_get_user_backpack(?int $userid = 0) { /** * Get the primary backpack for the site * - * @return array(stdClass) + * @return stdClass */ function badges_get_site_primary_backpack() { global $DB; diff --git a/lib/behat/classes/behat_core_generator.php b/lib/behat/classes/behat_core_generator.php index 2a81c598de1..8c7fdfb2f0a 100644 --- a/lib/behat/classes/behat_core_generator.php +++ b/lib/behat/classes/behat_core_generator.php @@ -766,7 +766,9 @@ class behat_core_generator extends behat_generator_base { } $data['contextid'] = $context->id; - $this->datagenerator->get_plugin_generator('core_question')->create_question_category($data); + /** @var core_question_generator $qgenerator */ + $qgenerator = $this->datagenerator->get_plugin_generator('core_question'); + $qgenerator->create_question_category($data); } /** @@ -813,7 +815,9 @@ class behat_core_generator extends behat_generator_base { $missingtypespecialcase = true; } - $questiondata = $this->datagenerator->get_plugin_generator('core_question') + /** @var core_question_generator $qgenerator */ + $qgenerator = $this->datagenerator->get_plugin_generator('core_question'); + $questiondata = $qgenerator ->create_question($data['qtype'], $which, $data); if ($missingtypespecialcase) { @@ -962,7 +966,7 @@ class behat_core_generator extends behat_generator_base { /** * Creates an analytics model * - * @param target $data + * @param array $data target * @return void */ protected function process_analytics_model($data) { diff --git a/lib/behat/classes/behat_session_trait.php b/lib/behat/classes/behat_session_trait.php index ae09ebe6e85..8132bddb699 100644 --- a/lib/behat/classes/behat_session_trait.php +++ b/lib/behat/classes/behat_session_trait.php @@ -346,7 +346,7 @@ trait behat_session_trait { * an exception. * * @throws Exception If it timeouts without receiving something != false from the closure - * @param Function|array|string $lambda The function to execute or an array passed to call_user_func (maps to a class method) + * @param callable $lambda The function to execute or an array passed to call_user_func (maps to a class method) * @param mixed $args Arguments to pass to the closure * @param int $timeout Timeout in seconds * @param Exception $exception The exception to throw in case it time outs. @@ -1041,7 +1041,7 @@ EOF; * Helper function to execute api in a given context. * * @param string $contextapi context in which api is defined. - * @param array $params list of params to pass. + * @param array|mixed $params list of params to pass or a single parameter * @throws Exception */ protected function execute($contextapi, $params = array()) { diff --git a/lib/blocklib.php b/lib/blocklib.php index d24855600ed..3ccb07a0734 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -345,7 +345,7 @@ class block_manager { * @param string $region region name * @param float $weight weight. May be fractional, since you may want to move a block * between ones with weight 2 and 3, say ($weight would be 2.5). - * @return string URL for moving block $this->movingblock to this position. + * @return moodle_url URL for moving block $this->movingblock to this position. */ protected function get_move_target_url($region, $weight) { return new moodle_url($this->page->url, array('bui_moveid' => $this->movingblock, @@ -1534,6 +1534,7 @@ class block_manager { // At this point we are going to display the block selector, overwrite global $PAGE ready for this. $PAGE = $addpage; // Some functions use $OUTPUT so we need to replace that too. + /** @var core_renderer $OUTPUT */ $OUTPUT = $addpage->get_renderer('core'); $site = get_site(); @@ -1611,6 +1612,7 @@ class block_manager { // overwrite global $PAGE ready for this. (Formslib refers to it.) $PAGE = $deletepage; //some functions like MoodleQuickForm::addHelpButton use $OUTPUT so we need to replace that too + /** @var core_renderer $output */ $output = $deletepage->get_renderer('core'); $OUTPUT = $output; diff --git a/lib/classes/antivirus/scanner.php b/lib/classes/antivirus/scanner.php index bcf30b50566..e36ba57fd29 100644 --- a/lib/classes/antivirus/scanner.php +++ b/lib/classes/antivirus/scanner.php @@ -43,7 +43,7 @@ abstract class scanner { /** Scanning result indicating the error. */ const SCAN_RESULT_ERROR = 2; - /** @var stdClass the config for antivirus */ + /** @var \stdClass the config for antivirus */ protected $config; /** @var string scanning notice */ protected $scanningnotice = ''; diff --git a/lib/classes/check/access/defaultuserrole.php b/lib/classes/check/access/defaultuserrole.php index da15a5743f7..d3407a06450 100644 --- a/lib/classes/check/access/defaultuserrole.php +++ b/lib/classes/check/access/defaultuserrole.php @@ -52,7 +52,7 @@ class defaultuserrole extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { global $CFG; diff --git a/lib/classes/check/access/frontpagerole.php b/lib/classes/check/access/frontpagerole.php index 5fcd3d826cd..54fda55c289 100644 --- a/lib/classes/check/access/frontpagerole.php +++ b/lib/classes/check/access/frontpagerole.php @@ -52,7 +52,7 @@ class frontpagerole extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/access/guestrole.php b/lib/classes/check/access/guestrole.php index 99d13592ddc..de8cc7bccd8 100644 --- a/lib/classes/check/access/guestrole.php +++ b/lib/classes/check/access/guestrole.php @@ -52,7 +52,7 @@ class guestrole extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/access/riskadmin.php b/lib/classes/check/access/riskadmin.php index d751be88297..2b2981d18bb 100644 --- a/lib/classes/check/access/riskadmin.php +++ b/lib/classes/check/access/riskadmin.php @@ -52,7 +52,7 @@ class riskadmin extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/access/riskbackup.php b/lib/classes/check/access/riskbackup.php index 4339bd6fa2e..d50eeca0183 100644 --- a/lib/classes/check/access/riskbackup.php +++ b/lib/classes/check/access/riskbackup.php @@ -50,7 +50,7 @@ class riskbackup extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/access/riskxss.php b/lib/classes/check/access/riskxss.php index 3ce984a19e8..6f19b37f434 100644 --- a/lib/classes/check/access/riskxss.php +++ b/lib/classes/check/access/riskxss.php @@ -57,7 +57,7 @@ class riskxss extends \core\check\check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/check.php b/lib/classes/check/check.php index 8042fe8315b..7abdcafd206 100644 --- a/lib/classes/check/check.php +++ b/lib/classes/check/check.php @@ -35,7 +35,7 @@ defined('MOODLE_INTERNAL') || die(); abstract class check { /** - * @var $string $component - The component / plugin this task belongs to. + * @var string $component - The component / plugin this task belongs to. * * This is autopopulated by the check manager. */ @@ -101,7 +101,7 @@ abstract class check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return null; diff --git a/lib/classes/check/environment/antivirus.php b/lib/classes/check/environment/antivirus.php index 190edd9af57..ce3dd23fb86 100644 --- a/lib/classes/check/environment/antivirus.php +++ b/lib/classes/check/environment/antivirus.php @@ -44,7 +44,7 @@ class antivirus extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/environment/environment.php b/lib/classes/check/environment/environment.php index cf221b72a17..80f9983aeaa 100644 --- a/lib/classes/check/environment/environment.php +++ b/lib/classes/check/environment/environment.php @@ -51,7 +51,7 @@ class environment extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/environment/publicpaths.php b/lib/classes/check/environment/publicpaths.php index 7e5050dc05e..29736b45a72 100644 --- a/lib/classes/check/environment/publicpaths.php +++ b/lib/classes/check/environment/publicpaths.php @@ -295,7 +295,7 @@ class publicpaths extends check { /** * Link to the dev docs for more info. * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/environment/upgradecheck.php b/lib/classes/check/environment/upgradecheck.php index 706f98723bf..077dbc8acf4 100644 --- a/lib/classes/check/environment/upgradecheck.php +++ b/lib/classes/check/environment/upgradecheck.php @@ -51,7 +51,7 @@ class upgradecheck extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/http/cookiesecure.php b/lib/classes/check/http/cookiesecure.php index 3f403be7e5a..a5a5b1caf15 100644 --- a/lib/classes/check/http/cookiesecure.php +++ b/lib/classes/check/http/cookiesecure.php @@ -56,7 +56,7 @@ class cookiesecure extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/performance/backups.php b/lib/classes/check/performance/backups.php index 549e20d1e7f..a33f491a32b 100644 --- a/lib/classes/check/performance/backups.php +++ b/lib/classes/check/performance/backups.php @@ -50,7 +50,7 @@ class backups extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/performance/cachejs.php b/lib/classes/check/performance/cachejs.php index 091c89afc95..3db0aedb949 100644 --- a/lib/classes/check/performance/cachejs.php +++ b/lib/classes/check/performance/cachejs.php @@ -51,7 +51,7 @@ class cachejs extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/performance/dbschema.php b/lib/classes/check/performance/dbschema.php index cdbb8957938..260c0145e7a 100644 --- a/lib/classes/check/performance/dbschema.php +++ b/lib/classes/check/performance/dbschema.php @@ -50,7 +50,7 @@ class dbschema extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/performance/debugging.php b/lib/classes/check/performance/debugging.php index 14bc10a89b3..ba6ddfd573d 100644 --- a/lib/classes/check/performance/debugging.php +++ b/lib/classes/check/performance/debugging.php @@ -50,7 +50,7 @@ class debugging extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/performance/designermode.php b/lib/classes/check/performance/designermode.php index 2703c11bfff..e2549bc15c1 100644 --- a/lib/classes/check/performance/designermode.php +++ b/lib/classes/check/performance/designermode.php @@ -51,7 +51,7 @@ class designermode extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/performance/stats.php b/lib/classes/check/performance/stats.php index 052b51cc5d4..0a96ac79bf2 100644 --- a/lib/classes/check/performance/stats.php +++ b/lib/classes/check/performance/stats.php @@ -51,7 +51,7 @@ class stats extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/result.php b/lib/classes/check/result.php index 2a0a8dc610d..0710f653885 100644 --- a/lib/classes/check/result.php +++ b/lib/classes/check/result.php @@ -164,8 +164,8 @@ class result implements \renderable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function - * @return stdClass data context for a mustache template + * @param \renderer_base $output typically, the renderer that's calling this function + * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output) { return array( diff --git a/lib/classes/check/security/crawlers.php b/lib/classes/check/security/crawlers.php index e6b00406049..9fce0c3a284 100644 --- a/lib/classes/check/security/crawlers.php +++ b/lib/classes/check/security/crawlers.php @@ -58,7 +58,7 @@ class crawlers extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/security/emailchangeconfirmation.php b/lib/classes/check/security/emailchangeconfirmation.php index 8c4f1069ac1..5fbbdc36fec 100644 --- a/lib/classes/check/security/emailchangeconfirmation.php +++ b/lib/classes/check/security/emailchangeconfirmation.php @@ -52,7 +52,7 @@ class emailchangeconfirmation extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/security/embed.php b/lib/classes/check/security/embed.php index bfdd767b5a2..aae95418577 100644 --- a/lib/classes/check/security/embed.php +++ b/lib/classes/check/security/embed.php @@ -52,7 +52,7 @@ class embed extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/security/openprofiles.php b/lib/classes/check/security/openprofiles.php index b6d5faafa57..50f55b8b36f 100644 --- a/lib/classes/check/security/openprofiles.php +++ b/lib/classes/check/security/openprofiles.php @@ -52,7 +52,7 @@ class openprofiles extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/security/passwordpolicy.php b/lib/classes/check/security/passwordpolicy.php index cc5d1b1a7f9..9e799906c92 100644 --- a/lib/classes/check/security/passwordpolicy.php +++ b/lib/classes/check/security/passwordpolicy.php @@ -52,7 +52,7 @@ class passwordpolicy extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/security/webcron.php b/lib/classes/check/security/webcron.php index f1c6f177e56..8927a42b07b 100644 --- a/lib/classes/check/security/webcron.php +++ b/lib/classes/check/security/webcron.php @@ -52,7 +52,7 @@ class webcron extends check { /** * A link to a place to action this * - * @return action_link|null + * @return \action_link|null */ public function get_action_link(): ?\action_link { return new \action_link( diff --git a/lib/classes/check/table.php b/lib/classes/check/table.php index 3878b917461..dfa3742caba 100644 --- a/lib/classes/check/table.php +++ b/lib/classes/check/table.php @@ -35,7 +35,7 @@ defined('MOODLE_INTERNAL') || die(); class table implements \renderable { /** - * @var moodle_url $url + * @var \moodle_url $url */ protected $url = ''; diff --git a/lib/classes/content/export/exporters/course_exporter.php b/lib/classes/content/export/exporters/course_exporter.php index 3724150ade8..9373e3d170f 100644 --- a/lib/classes/content/export/exporters/course_exporter.php +++ b/lib/classes/content/export/exporters/course_exporter.php @@ -61,7 +61,7 @@ class course_exporter extends component_exporter { /** * Export the course. * - * @param context[] $exportedcontexts A list of contexts which were successfully exported + * @param \context[] $exportedcontexts A list of contexts which were successfully exported */ public function export_course(array $exportedcontexts): void { // A course export is composed of: @@ -155,7 +155,7 @@ class course_exporter extends component_exporter { /** * Fetch data for the specified course section. * - * @param context[] $exportedcontexts A list of contexts which were successfully exported + * @param \context[] $exportedcontexts A list of contexts which were successfully exported * @param section_info $section The section being exported * @return stdClass */ diff --git a/lib/classes/event/tag_added.php b/lib/classes/event/tag_added.php index 6189d43180f..ca178c14dbd 100644 --- a/lib/classes/event/tag_added.php +++ b/lib/classes/event/tag_added.php @@ -78,7 +78,7 @@ class tag_added extends base { * Creates an event from taginstance object * * @since Moodle 3.1 - * @param stdClass $taginstance + * @param \stdClass $taginstance * @param string $tagname * @param string $tagrawname * @param bool $addsnapshot trust that $taginstance has all necessary fields and add it as a record snapshot diff --git a/lib/classes/event/tag_removed.php b/lib/classes/event/tag_removed.php index faa36109b6d..acd083ed289 100644 --- a/lib/classes/event/tag_removed.php +++ b/lib/classes/event/tag_removed.php @@ -78,7 +78,7 @@ class tag_removed extends base { * Creates an event from taginstance object * * @since Moodle 3.1 - * @param stdClass $taginstance + * @param \stdClass $taginstance * @param string $tagname * @param string $tagrawname * @param bool $addsnapshot trust that $taginstance has all necessary fields and add it as a record snapshot diff --git a/lib/classes/external/exporter.php b/lib/classes/external/exporter.php index 960f4970df4..bfaa6ef0918 100644 --- a/lib/classes/external/exporter.php +++ b/lib/classes/external/exporter.php @@ -389,7 +389,7 @@ abstract class exporter { /** * Get the context structure. * - * @return external_single_structure + * @return array */ final protected static function get_context_structure() { return array( diff --git a/lib/classes/hub/registration.php b/lib/classes/hub/registration.php index 1650fc8b505..7b67c9e5b59 100644 --- a/lib/classes/hub/registration.php +++ b/lib/classes/hub/registration.php @@ -46,7 +46,7 @@ class registration { 'contactemail', 'contactable', 'emailalert', 'emailalertemail', 'commnews', 'commnewsemail', 'contactname', 'name', 'description', 'imageurl', 'contactphone', 'regioncode', 'geolocation', 'street']; - /** @var List of new FORM_FIELDS or siteinfo fields added indexed by the version when they were added. + /** @var array List of new FORM_FIELDS or siteinfo fields added indexed by the version when they were added. * If site was already registered, admin will be promted to confirm new registration data manually. Until registration is manually confirmed, * the scheduled task updating registration will be paused. * Keys of this array are not important as long as they increment, use current date to avoid confusions. @@ -64,13 +64,13 @@ class registration { 2023021700 => ['dbtype', 'coursesnodates', 'sitetheme', 'primaryauthtype'], ]; - /** @var Site privacy: not displayed */ + /** @var string Site privacy: not displayed */ const HUB_SITENOTPUBLISHED = 'notdisplayed'; - /** @var Site privacy: public */ + /** @var string Site privacy: public */ const HUB_SITENAMEPUBLISHED = 'named'; - /** @var Site privacy: public and global */ + /** @var string Site privacy: public and global */ const HUB_SITELINKPUBLISHED = 'linked'; /** @var stdClass cached site registration information */ diff --git a/lib/classes/lock/mysql_lock_factory.php b/lib/classes/lock/mysql_lock_factory.php index 29e3abcfadc..94f9d627f8c 100644 --- a/lib/classes/lock/mysql_lock_factory.php +++ b/lib/classes/lock/mysql_lock_factory.php @@ -49,7 +49,7 @@ class mysql_lock_factory implements lock_factory { /** * Return a unique prefix based on the database name and prefix. * @param string $type - Used to prefix lock keys. - * @return string. + * @return string */ protected function get_unique_db_prefix($type) { global $CFG; diff --git a/lib/classes/log/sql_reader.php b/lib/classes/log/sql_reader.php index 5364604157a..dfefc60e9f0 100644 --- a/lib/classes/log/sql_reader.php +++ b/lib/classes/log/sql_reader.php @@ -93,7 +93,7 @@ interface sql_reader extends reader { /** * Returns an event from the log data. * - * @param stdClass $data Log data + * @param \stdClass $data Log data * @return \core\event\base */ public function get_log_event($data); diff --git a/lib/classes/navigation/output/primary.php b/lib/classes/navigation/output/primary.php index 26aa8bfd723..92bf0274e6d 100644 --- a/lib/classes/navigation/output/primary.php +++ b/lib/classes/navigation/output/primary.php @@ -33,7 +33,7 @@ use custom_menu; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class primary implements renderable, templatable { - /** @var moodle_page $page the moodle page that the navigation belongs to */ + /** @var \moodle_page $page the moodle page that the navigation belongs to */ private $page = null; /** diff --git a/lib/classes/navigation/views/view.php b/lib/classes/navigation/views/view.php index 40e22c341fb..5d679989af7 100644 --- a/lib/classes/navigation/views/view.php +++ b/lib/classes/navigation/views/view.php @@ -30,9 +30,9 @@ use navigation_node_collection; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class view extends navigation_node { - /** @var stdClass $context the current context */ + /** @var \stdClass $context the current context */ protected $context; - /** @var moodle_page $page the moodle page that the navigation belongs to */ + /** @var \moodle_page $page the moodle page that the navigation belongs to */ protected $page; /** @var bool $initialised A switch to see if the navigation node is initialised */ protected $initialised = false; diff --git a/lib/classes/notification.php b/lib/classes/notification.php index 52b1543ba92..8d5d1537b70 100644 --- a/lib/classes/notification.php +++ b/lib/classes/notification.php @@ -145,7 +145,7 @@ class notification { /** * Fetch all of the notifications in the stack and clear the stack. * - * @return array All of the notifications in the stack + * @return \core\output\notification[] All of the notifications in the stack */ public static function fetch() { global $SESSION; diff --git a/lib/classes/output/inplace_editable.php b/lib/classes/output/inplace_editable.php index 27cd1822edf..2488fa085d8 100644 --- a/lib/classes/output/inplace_editable.php +++ b/lib/classes/output/inplace_editable.php @@ -243,7 +243,7 @@ class inplace_editable implements templatable, renderable { /** * Export this data so it can be used as the context for a mustache template (core/inplace_editable). * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output) { @@ -275,7 +275,7 @@ class inplace_editable implements templatable, renderable { /** * Renders this element * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return string */ public function render(\renderer_base $output) { diff --git a/lib/classes/output/language_menu.php b/lib/classes/output/language_menu.php index 846362bbe5e..7f9ba9b6490 100644 --- a/lib/classes/output/language_menu.php +++ b/lib/classes/output/language_menu.php @@ -35,7 +35,7 @@ namespace core\output; */ class language_menu implements \renderable, \templatable { - /** @var moodle_page $page the moodle page that the languague menu belongs to */ + /** @var \moodle_page $page the moodle page that the languague menu belongs to */ protected $page; /** @var string current language code */ @@ -47,7 +47,7 @@ class language_menu implements \renderable, \templatable { /** * Language menu constructor. * - * @param moodle_page $page the moodle page that the languague menu belongs to. + * @param \moodle_page $page the moodle page that the languague menu belongs to. */ public function __construct($page) { $this->page = $page; diff --git a/lib/classes/output/notification.php b/lib/classes/output/notification.php index 023193d94a6..b15ef759761 100644 --- a/lib/classes/output/notification.php +++ b/lib/classes/output/notification.php @@ -156,8 +156,8 @@ class notification implements \renderable, \templatable { /** * Export this data so it can be used as the context for a mustache template. * - * @param renderer_base $output typically, the renderer that's calling this function - * @return stdClass data context for a mustache template + * @param \renderer_base $output typically, the renderer that's calling this function + * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output) { return array( diff --git a/lib/classes/output/sticky_footer.php b/lib/classes/output/sticky_footer.php index e1420156b90..a007c2b060e 100644 --- a/lib/classes/output/sticky_footer.php +++ b/lib/classes/output/sticky_footer.php @@ -114,7 +114,7 @@ class sticky_footer implements named_templatable, renderable { /** * Export this data so it can be used as the context for a mustache template (core/inplace_editable). * - * @param renderer_base $output typically, the renderer that's calling this function + * @param \renderer_base $output typically, the renderer that's calling this function * @return array data context for a mustache template */ public function export_for_template(\renderer_base $output) { diff --git a/lib/classes/output/url_rewriter.php b/lib/classes/output/url_rewriter.php index 435bd55afb9..eacd434ed2f 100644 --- a/lib/classes/output/url_rewriter.php +++ b/lib/classes/output/url_rewriter.php @@ -40,8 +40,8 @@ interface url_rewriter { /** * Rewrite moodle_urls into another form. * - * @param moodle_url $url a url to potentially rewrite - * @return moodle_url Returns a new, or the original, moodle_url; + * @param \moodle_url $url a url to potentially rewrite + * @return \moodle_url Returns a new, or the original, moodle_url; */ public static function url_rewrite(\moodle_url $url); diff --git a/lib/classes/persistent.php b/lib/classes/persistent.php index 36e0fa5a4ca..38ec253430c 100644 --- a/lib/classes/persistent.php +++ b/lib/classes/persistent.php @@ -31,7 +31,7 @@ use stdClass; */ abstract class persistent { - /** The table name. */ + /** @var string The table name. */ const TABLE = null; /** @var array The model data. */ diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index 70691271183..2e1505c69e8 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -106,7 +106,7 @@ class core_plugin_manager { /** * Factory method for this class * - * @return core_plugin_manager the singleton instance + * @return static the singleton instance */ public static function instance() { if (is_null(static::$singletoninstance)) { diff --git a/lib/classes/plugininfo/antivirus.php b/lib/classes/plugininfo/antivirus.php index 398f5fd9dfd..bf55a96f29a 100644 --- a/lib/classes/plugininfo/antivirus.php +++ b/lib/classes/plugininfo/antivirus.php @@ -108,6 +108,7 @@ class antivirus extends base { */ public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $antivirus = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/auth.php b/lib/classes/plugininfo/auth.php index f5bfe897e38..1c7a4e71be6 100644 --- a/lib/classes/plugininfo/auth.php +++ b/lib/classes/plugininfo/auth.php @@ -102,6 +102,7 @@ class auth extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $auth = $this; // Also to be used inside settings.php. diff --git a/lib/classes/plugininfo/availability.php b/lib/classes/plugininfo/availability.php index bd5715265d0..fb887ed4277 100644 --- a/lib/classes/plugininfo/availability.php +++ b/lib/classes/plugininfo/availability.php @@ -109,6 +109,7 @@ class availability extends base { */ public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php $availability = $this; // Also to be used inside settings.php. diff --git a/lib/classes/plugininfo/block.php b/lib/classes/plugininfo/block.php index c8b2e8aa060..e1134882dca 100644 --- a/lib/classes/plugininfo/block.php +++ b/lib/classes/plugininfo/block.php @@ -105,6 +105,7 @@ class block extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $block = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/calendartype.php b/lib/classes/plugininfo/calendartype.php index 9e999c2db04..a552d74a810 100644 --- a/lib/classes/plugininfo/calendartype.php +++ b/lib/classes/plugininfo/calendartype.php @@ -49,6 +49,7 @@ class calendartype extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $qtype = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/contenttype.php b/lib/classes/plugininfo/contenttype.php index 57ff81f1590..a90e8d8de73 100644 --- a/lib/classes/plugininfo/contenttype.php +++ b/lib/classes/plugininfo/contenttype.php @@ -63,6 +63,7 @@ class contenttype extends base { */ public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php $contenttype = $this; // Also to be used inside settings.php. @@ -102,7 +103,7 @@ class contenttype extends base { * @param string $type the name of the plugintype, eg. mod, auth or workshopform * @param string $typerootdir full path to the location of the plugin dir * @param string $typeclass the name of the actually called class - * @param core_plugin_manager $pluginman the plugin manager calling this method + * @param \core_plugin_manager $pluginman the plugin manager calling this method * @return array of plugintype classes, indexed by the plugin name */ public static function get_plugins($type, $typerootdir, $typeclass, $pluginman) { diff --git a/lib/classes/plugininfo/customfield.php b/lib/classes/plugininfo/customfield.php index c63279e8457..e635337933c 100644 --- a/lib/classes/plugininfo/customfield.php +++ b/lib/classes/plugininfo/customfield.php @@ -136,6 +136,7 @@ class customfield extends base { */ public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php $availability = $this; // Also to be used inside settings.php. diff --git a/lib/classes/plugininfo/dataformat.php b/lib/classes/plugininfo/dataformat.php index fbad4fdafa2..bd8133510af 100644 --- a/lib/classes/plugininfo/dataformat.php +++ b/lib/classes/plugininfo/dataformat.php @@ -156,6 +156,7 @@ class dataformat extends base { */ public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $dataformat = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/editor.php b/lib/classes/plugininfo/editor.php index d0547a91fab..d6e75e7a582 100644 --- a/lib/classes/plugininfo/editor.php +++ b/lib/classes/plugininfo/editor.php @@ -97,6 +97,7 @@ class editor extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $editor = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/enrol.php b/lib/classes/plugininfo/enrol.php index 3832bc6c486..38fe93afb27 100644 --- a/lib/classes/plugininfo/enrol.php +++ b/lib/classes/plugininfo/enrol.php @@ -93,6 +93,7 @@ class enrol extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $enrol = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/fileconverter.php b/lib/classes/plugininfo/fileconverter.php index 90af54e64e0..ee5927f9c62 100644 --- a/lib/classes/plugininfo/fileconverter.php +++ b/lib/classes/plugininfo/fileconverter.php @@ -65,6 +65,7 @@ class fileconverter extends base { */ public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/filter.php b/lib/classes/plugininfo/filter.php index 14a8ad85472..53ccfe97a77 100644 --- a/lib/classes/plugininfo/filter.php +++ b/lib/classes/plugininfo/filter.php @@ -113,6 +113,7 @@ class filter extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $filter = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/format.php b/lib/classes/plugininfo/format.php index 5d04e69dcbf..16f698085df 100644 --- a/lib/classes/plugininfo/format.php +++ b/lib/classes/plugininfo/format.php @@ -120,6 +120,7 @@ class format extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/media.php b/lib/classes/plugininfo/media.php index 05f3cc1c5df..161098b0d48 100644 --- a/lib/classes/plugininfo/media.php +++ b/lib/classes/plugininfo/media.php @@ -58,6 +58,7 @@ class media extends base { */ public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php $availability = $this; // Also to be used inside settings.php. @@ -113,6 +114,7 @@ class media extends base { if ($enabled && !in_array($pluginname, $plugins)) { // Enable media plugin. + /** @var \core\plugininfo\media[] $pluginsbytype */ $pluginsbytype = \core_plugin_manager::instance()->get_plugins_of_type('media'); if (!array_key_exists($pluginname, $pluginsbytype)) { // Can not be enabled. diff --git a/lib/classes/plugininfo/message.php b/lib/classes/plugininfo/message.php index d2e348f42f2..743b3adb07f 100644 --- a/lib/classes/plugininfo/message.php +++ b/lib/classes/plugininfo/message.php @@ -75,6 +75,7 @@ class message extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/mlbackend.php b/lib/classes/plugininfo/mlbackend.php index be04eefd432..ff3c9e8fa07 100644 --- a/lib/classes/plugininfo/mlbackend.php +++ b/lib/classes/plugininfo/mlbackend.php @@ -63,6 +63,7 @@ class mlbackend extends base { */ public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/mod.php b/lib/classes/plugininfo/mod.php index fe2d34f247f..a30493f778a 100644 --- a/lib/classes/plugininfo/mod.php +++ b/lib/classes/plugininfo/mod.php @@ -139,6 +139,7 @@ class mod extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $module = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/orphaned.php b/lib/classes/plugininfo/orphaned.php index 09f12d6c681..2c496ae9320 100644 --- a/lib/classes/plugininfo/orphaned.php +++ b/lib/classes/plugininfo/orphaned.php @@ -64,7 +64,7 @@ class orphaned extends base { * @param string $type the name of the plugintype, eg. mod, auth or workshopform * @param string $typerootdir full path to the location of the plugin dir * @param string $typeclass the name of the actually called class - * @param core_plugin_manager $pluginman the plugin manager calling this method + * @param \core_plugin_manager $pluginman the plugin manager calling this method * @return array of plugintype classes, indexed by the plugin name */ public static function get_plugins($type, $typerootdir, $typeclass, $pluginman) { diff --git a/lib/classes/plugininfo/paygw.php b/lib/classes/plugininfo/paygw.php index f3708f1d4c5..7b20395fe62 100644 --- a/lib/classes/plugininfo/paygw.php +++ b/lib/classes/plugininfo/paygw.php @@ -46,6 +46,7 @@ class paygw extends base { public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/qbank.php b/lib/classes/plugininfo/qbank.php index 3d2dff03944..aa2ea8cb244 100644 --- a/lib/classes/plugininfo/qbank.php +++ b/lib/classes/plugininfo/qbank.php @@ -139,6 +139,7 @@ class qbank extends base { public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig): void { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/qtype.php b/lib/classes/plugininfo/qtype.php index 25abdd96df0..f6edc557592 100644 --- a/lib/classes/plugininfo/qtype.php +++ b/lib/classes/plugininfo/qtype.php @@ -135,6 +135,7 @@ class qtype extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $qtype = $this; // Also can be used inside settings.php. diff --git a/lib/classes/plugininfo/webservice.php b/lib/classes/plugininfo/webservice.php index 259a04fa112..772dfa7339d 100644 --- a/lib/classes/plugininfo/webservice.php +++ b/lib/classes/plugininfo/webservice.php @@ -97,6 +97,7 @@ class webservice extends base { public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. $webservice = $this; // Also can be used inside settings.php. diff --git a/lib/classes/privacy/provider.php b/lib/classes/privacy/provider.php index e49598b8e55..eea881ec933 100644 --- a/lib/classes/privacy/provider.php +++ b/lib/classes/privacy/provider.php @@ -159,7 +159,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { // None of the the data from these tables should be deleted. diff --git a/lib/classes/session/manager.php b/lib/classes/session/manager.php index fb1a627c382..d06d15a95f1 100644 --- a/lib/classes/session/manager.php +++ b/lib/classes/session/manager.php @@ -1175,7 +1175,7 @@ class manager { * @param string $component The string component for the message to show on failure. * @param int $frequency The update frequency in seconds. * @param int $timeout The timeout of each request in seconds. - * @throws coding_exception IF the frequency is longer than the session lifetime. + * @throws \coding_exception IF the frequency is longer than the session lifetime. */ public static function keepalive($identifier = 'sessionerroruser', $component = 'error', $frequency = null, $timeout = 0) { global $CFG, $PAGE; diff --git a/lib/classes/string_manager_standard.php b/lib/classes/string_manager_standard.php index 78f5c940f7b..dbcfdcf131e 100644 --- a/lib/classes/string_manager_standard.php +++ b/lib/classes/string_manager_standard.php @@ -43,7 +43,7 @@ class core_string_manager_standard implements core_string_manager { protected $cache; /** @var int get_string() counter */ protected $countgetstring = 0; - /** @var bool use disk cache */ + /** @var array use disk cache */ protected $translist; /** @var array language aliases to use in the language selector */ protected $transaliases = []; diff --git a/lib/classes/task/manager.php b/lib/classes/task/manager.php index 35c8751f809..354091a4501 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -163,7 +163,7 @@ class manager { * Checks if the task with the same classname, component and customdata is already scheduled * * @param adhoc_task $task - * @return bool + * @return \stdClass|false */ protected static function get_queued_adhoc_task_record($task) { global $DB; diff --git a/lib/classes/task/send_failed_login_notifications_task.php b/lib/classes/task/send_failed_login_notifications_task.php index ee75b2477fd..7ba95478437 100644 --- a/lib/classes/task/send_failed_login_notifications_task.php +++ b/lib/classes/task/send_failed_login_notifications_task.php @@ -72,6 +72,7 @@ class send_failed_login_notifications_task extends scheduled_task { // Get all the IPs with more than notifyloginthreshold failures since lastnotifyfailure // and insert them into the cache_flags temp table. $logmang = get_log_manager(); + /** @var \core\log\sql_internal_table_reader[] $readers */ $readers = $logmang->get_readers('\core\log\sql_internal_table_reader'); $reader = reset($readers); $readername = key($readers); diff --git a/lib/classes/task/task_base.php b/lib/classes/task/task_base.php index 4157b1bbe4e..e0485eeffbf 100644 --- a/lib/classes/task/task_base.php +++ b/lib/classes/task/task_base.php @@ -42,7 +42,7 @@ abstract class task_base { /** @var \core\lock\lock $cronlock - The lock controlling the entire cron process. */ private $cronlock = null; - /** @var $string $component - The component this task belongs to. */ + /** @var string $component - The component this task belongs to. */ private $component = ''; /** @var bool $blocking - Does this task block the entire cron process. */ diff --git a/lib/classes/update/api.php b/lib/classes/update/api.php index 2901da2503d..60467f0ce9c 100644 --- a/lib/classes/update/api.php +++ b/lib/classes/update/api.php @@ -154,7 +154,7 @@ class api { * Object validated by this method is guaranteed to contain all the data * provided by the pluginfo.php version this client works with (self::APIVER). * - * @param stdClass $data + * @param \stdClass $data * @return \core\update\remote_info|bool false if data are not valid, original data otherwise */ public function validate_pluginfo_format($data) { @@ -253,7 +253,7 @@ class api { * * @param string $serviceurl * @param array $params - * @return stdClass|bool + * @return \stdClass|bool */ protected function call_service($serviceurl, array $params=array()) { diff --git a/lib/ddl/mysql_sql_generator.php b/lib/ddl/mysql_sql_generator.php index def4c20ed8b..3c969501f75 100644 --- a/lib/ddl/mysql_sql_generator.php +++ b/lib/ddl/mysql_sql_generator.php @@ -32,6 +32,8 @@ require_once($CFG->libdir.'/ddl/sql_generator.php'); * It extends XMLDBgenerator so everything can be * overridden as needed to generate correct SQL. * + * @property mysqli_native_moodle_database $mdb + * * @package core_ddl * @copyright 1999 onwards Martin Dougiamas http://dougiamas.com * 2001-3001 Eloy Lafuente (stronk7) http://contiento.com diff --git a/lib/ddl/sql_generator.php b/lib/ddl/sql_generator.php index 6215eb1e2c0..d9c64a50cd5 100644 --- a/lib/ddl/sql_generator.php +++ b/lib/ddl/sql_generator.php @@ -163,7 +163,7 @@ abstract class sql_generator { /** @var string The prefix to be used for all the DB objects.*/ public $prefix; - /** @var string List of reserved words (in order to quote them properly).*/ + /** @var array List of reserved words (in order to quote them properly).*/ public $reserved_words; /** @var moodle_database The moodle_database instance.*/ @@ -749,7 +749,7 @@ abstract class sql_generator { * @param string $skip_type_clause The type clause on alter columns, NULL by default. * @param string $skip_default_clause The default clause on alter columns, NULL by default. * @param string $skip_notnull_clause The null/notnull clause on alter columns, NULL by default. - * @return string The field altering SQL statement. + * @return array The field altering SQL statement. */ public function getAlterFieldSQL($xmldb_table, $xmldb_field, $skip_type_clause = NULL, $skip_default_clause = NULL, $skip_notnull_clause = NULL) { @@ -1163,7 +1163,7 @@ abstract class sql_generator { /** * Given one XMLDB Statement, build the needed SQL insert sentences to execute it. * - * @param string $statement SQL statement. + * @param mixed $statement SQL statement. * @return array Array of sentences in the SQL statement. */ function getExecuteInsertSQL($statement) { diff --git a/lib/dml/moodle_database.php b/lib/dml/moodle_database.php index 89c14552325..c67a3c9a2e1 100644 --- a/lib/dml/moodle_database.php +++ b/lib/dml/moodle_database.php @@ -1787,7 +1787,7 @@ abstract class moodle_database { /** * Insert new record into database, as fast as possible, no safety checks, lobs not supported. * @param string $table name - * @param mixed $params data record as object or array + * @param stdClass|array $params data record as object or array * @param bool $returnid Returns id of inserted record. * @param bool $bulk true means repeated inserts expected * @param bool $customsequence true if 'id' included in $params, disables $returnid @@ -1864,7 +1864,7 @@ abstract class moodle_database { /** * Update record in database, as fast as possible, no safety checks, lobs not supported. * @param string $table name - * @param mixed $params data record as object or array + * @param stdClass|array $params data record as object or array * @param bool $bulk True means repeated updates expected. * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. @@ -1879,7 +1879,8 @@ abstract class moodle_database { * specify the record to update * * @param string $table The database table to be checked against. - * @param object $dataobject An object with contents equal to fieldname=>fieldvalue. Must have an entry for 'id' to map to the table specified. + * @param stdClass|array $dataobject An object with contents equal to fieldname=>fieldvalue. + * Must have an entry for 'id' to map to the table specified. * @param bool $bulk True means repeated updates expected. * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. @@ -1891,7 +1892,7 @@ abstract class moodle_database { * * @param string $table The database table to be checked against. * @param string $newfield the field to set. - * @param string $newvalue the value to set the field to. + * @param mixed $newvalue the value to set the field to. * @param array $conditions optional array $fieldname=>requestedvalue with AND in between * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. @@ -1906,7 +1907,7 @@ abstract class moodle_database { * * @param string $table The database table to be checked against. * @param string $newfield the field to set. - * @param string $newvalue the value to set the field to. + * @param mixed $newvalue the value to set the field to. * @param string $select A fragment of SQL to be used in a where clause in the SQL call. * @param array $params array of sql parameters * @return bool true @@ -2098,8 +2099,8 @@ abstract class moodle_database { * NOTE: The SQL result is a number and can not be used directly in * SQL condition, please compare it to some number to get a bool!! * - * @param int $int1 First integer in the operation. - * @param int $int2 Second integer in the operation. + * @param string $int1 SQL for the first integer in the operation. + * @param string $int2 SQL for the second integer in the operation. * @return string The piece of SQL code to be used in your statement. */ public function sql_bitand($int1, $int2) { diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index c42e4c57d7b..61e979ca810 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -1656,7 +1656,7 @@ class mysqli_native_moodle_database extends moodle_database { /** * Update record in database, as fast as possible, no safety checks, lobs not supported. * @param string $table name - * @param mixed $params data record as object or array + * @param stdClass|array $params data record as object or array * @param bool true means repeated updates expected * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. @@ -1703,7 +1703,8 @@ class mysqli_native_moodle_database extends moodle_database { * specify the record to update * * @param string $table The database table to be checked against. - * @param object $dataobject An object with contents equal to fieldname=>fieldvalue. Must have an entry for 'id' to map to the table specified. + * @param stdClass|array $dataobject An object with contents equal to fieldname=>fieldvalue. + * Must have an entry for 'id' to map to the table specified. * @param bool true means repeated updates expected * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index 67099bda2c4..e8f9bf0fe55 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -47,7 +47,7 @@ class oci_native_moodle_database extends moodle_database { /** @var Default value initialised in connect method, we need the driver to be present.*/ private $commit_status = null; - /** @var To handle oci driver default verbosity.*/ + /** @var null|int To handle oci driver default verbosity.*/ private $last_error_reporting; /** @var To store unique_session_id. Needed for temp tables unique naming.*/ private $unique_session_id; @@ -1355,7 +1355,7 @@ class oci_native_moodle_database extends moodle_database { /** * Update record in database, as fast as possible, no safety checks, lobs not supported. * @param string $table name - * @param mixed $params data record as object or array + * @param stdClass|array $params data record as object or array * @param bool true means repeated updates expected * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. @@ -1405,7 +1405,8 @@ class oci_native_moodle_database extends moodle_database { * specify the record to update * * @param string $table The database table to be checked against. - * @param object $dataobject An object with contents equal to fieldname=>fieldvalue. Must have an entry for 'id' to map to the table specified. + * @param stdClass|array $dataobject An object with contents equal to fieldname=>fieldvalue. + * Must have an entry for 'id' to map to the table specified. * @param bool true means repeated updates expected * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. diff --git a/lib/dml/pdo_moodle_database.php b/lib/dml/pdo_moodle_database.php index ba20e29de12..4dd37dd400b 100644 --- a/lib/dml/pdo_moodle_database.php +++ b/lib/dml/pdo_moodle_database.php @@ -429,7 +429,7 @@ abstract class pdo_moodle_database extends moodle_database { /** * Update record in database, as fast as possible, no safety checks, lobs not supported. * @param string $table name - * @param mixed $params data record as object or array + * @param stdClass|array $params data record as object or array * @param bool true means repeated updates expected * @return bool success */ diff --git a/lib/dml/pgsql_native_moodle_database.php b/lib/dml/pgsql_native_moodle_database.php index 247f371949c..6bef3283aec 100644 --- a/lib/dml/pgsql_native_moodle_database.php +++ b/lib/dml/pgsql_native_moodle_database.php @@ -50,7 +50,7 @@ class pgsql_native_moodle_database extends moodle_database { /** @var array $dbhcursor keep track of open cursors */ private $dbhcursor = []; - /** @var resource $pgsql database resource */ + /** @var resource|PgSql\Connection|null $pgsql database resource */ protected $pgsql = null; protected $last_error_reporting; // To handle pgsql driver default verbosity @@ -972,7 +972,7 @@ class pgsql_native_moodle_database extends moodle_database { * to get the list of field types which it statically caches only for a single request. * This wraps it in a cache keyed by oid to avoid these DB calls on every request. * - * @param resource $result + * @param resource|PgSql\Result $result * @param int $fieldnumber * @return string Field type */ @@ -1305,7 +1305,7 @@ class pgsql_native_moodle_database extends moodle_database { /** * Update record in database, as fast as possible, no safety checks, lobs not supported. * @param string $table name - * @param mixed $params data record as object or array + * @param stdClass|array $params data record as object or array * @param bool true means repeated updates expected * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. @@ -1352,7 +1352,8 @@ class pgsql_native_moodle_database extends moodle_database { * specify the record to update * * @param string $table The database table to be checked against. - * @param object $dataobject An object with contents equal to fieldname=>fieldvalue. Must have an entry for 'id' to map to the table specified. + * @param stdClass|array $dataobject An object with contents equal to fieldname=>fieldvalue. + * Must have an entry for 'id' to map to the table specified. * @param bool true means repeated updates expected * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. diff --git a/lib/dml/pgsql_native_moodle_recordset.php b/lib/dml/pgsql_native_moodle_recordset.php index 61a770c4604..d6ef4113fd1 100644 --- a/lib/dml/pgsql_native_moodle_recordset.php +++ b/lib/dml/pgsql_native_moodle_recordset.php @@ -35,6 +35,7 @@ require_once(__DIR__.'/moodle_recordset.php'); */ class pgsql_native_moodle_recordset extends moodle_recordset { + /** @var PgSql\Result|resource|null */ protected $result; /** @var current row as array.*/ protected $current; @@ -54,7 +55,7 @@ class pgsql_native_moodle_recordset extends moodle_recordset { * * When using cursors, $result will be null initially. * - * @param resource|null $result A pg_query() result object to create a recordset from. + * @param resource|PgSql\Result|null $result A pg_query() result object to create a recordset from. * @param pgsql_native_moodle_database $db Database object (only required when using cursors) * @param string $cursorname Name of cursor or '' if none */ diff --git a/lib/dml/sqlsrv_native_moodle_database.php b/lib/dml/sqlsrv_native_moodle_database.php index 7ba61da93b2..8b8ebf8c7ef 100644 --- a/lib/dml/sqlsrv_native_moodle_database.php +++ b/lib/dml/sqlsrv_native_moodle_database.php @@ -1189,7 +1189,7 @@ class sqlsrv_native_moodle_database extends moodle_database { /** * Update record in database, as fast as possible, no safety checks, lobs not supported. * @param string $table name - * @param mixed $params data record as object or array + * @param stdClass|array $params data record as object or array * @param bool true means repeated updates expected * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. @@ -1231,7 +1231,8 @@ class sqlsrv_native_moodle_database extends moodle_database { * specify the record to update * * @param string $table The database table to be checked against. - * @param object $dataobject An object with contents equal to fieldname=>fieldvalue. Must have an entry for 'id' to map to the table specified. + * @param stdClass|array $dataobject An object with contents equal to fieldname=>fieldvalue. + * Must have an entry for 'id' to map to the table specified. * @param bool true means repeated updates expected * @return bool true * @throws dml_exception A DML specific exception is thrown for any errors. diff --git a/lib/dml/tests/fixtures/read_slave_moodle_database.php b/lib/dml/tests/fixtures/read_slave_moodle_database.php index ecf5d572b7c..c62b81c62bc 100644 --- a/lib/dml/tests/fixtures/read_slave_moodle_database.php +++ b/lib/dml/tests/fixtures/read_slave_moodle_database.php @@ -119,7 +119,7 @@ class read_slave_moodle_database extends test_moodle_database { * @param string $sql * @param array $params * @return bool true - * @throws Exception + * @throws \Exception */ public function execute($sql, array $params = null) { list($sql, $params, $type) = $this->fix_sql_params($sql, $params); diff --git a/lib/dml/tests/fixtures/read_slave_moodle_database_mock_mysqli.php b/lib/dml/tests/fixtures/read_slave_moodle_database_mock_mysqli.php index e1b5d0a93b9..14289a1d5d3 100644 --- a/lib/dml/tests/fixtures/read_slave_moodle_database_mock_mysqli.php +++ b/lib/dml/tests/fixtures/read_slave_moodle_database_mock_mysqli.php @@ -58,7 +58,7 @@ class read_slave_moodle_database_mock_mysqli extends \mysqli_native_moodle_datab * @param string|array $sql query * @param array|null $tablenames an array of xmldb table names affected by this request. * @return bool true - * @throws ddl_change_structure_exception A DDL specific exception is thrown for any errors. + * @throws \ddl_change_structure_exception A DDL specific exception is thrown for any errors. */ public function change_database_structure($sql, $tablenames = null) { return true; diff --git a/lib/dml/tests/fixtures/test_moodle_database.php b/lib/dml/tests/fixtures/test_moodle_database.php index 90238958ff6..589aafbe865 100644 --- a/lib/dml/tests/fixtures/test_moodle_database.php +++ b/lib/dml/tests/fixtures/test_moodle_database.php @@ -25,6 +25,8 @@ namespace core; +use Exception; + defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/../../moodle_database.php'); @@ -168,7 +170,7 @@ abstract class test_moodle_database extends \moodle_database { /** * Default implementation - * @param StdClass $column metadata + * @param \stdClass $column metadata * @param mixed $value * @return mixed $value */ diff --git a/lib/dml/tests/fixtures/test_sql_generator.php b/lib/dml/tests/fixtures/test_sql_generator.php index edf06f34455..5075ea8bf81 100644 --- a/lib/dml/tests/fixtures/test_sql_generator.php +++ b/lib/dml/tests/fixtures/test_sql_generator.php @@ -29,6 +29,9 @@ defined('MOODLE_INTERNAL') || die(); require_once(__DIR__.'/../../../ddl/sql_generator.php'); +use xmldb_table; +use xmldb_field; + /** * Test SQL code generator class * diff --git a/lib/dml/tests/recordset_walk_test.php b/lib/dml/tests/recordset_walk_test.php index 79a452de7bb..a44a00e1b0a 100644 --- a/lib/dml/tests/recordset_walk_test.php +++ b/lib/dml/tests/recordset_walk_test.php @@ -50,6 +50,7 @@ class recordset_walk_test extends \advanced_testcase { public function test_simple_callback() { global $DB; + /** @var \mod_assign_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('mod_assign'); $courses = array(); for ($i = 0; $i < 10; $i++) { @@ -74,6 +75,7 @@ class recordset_walk_test extends \advanced_testcase { public function test_extra_params_callback() { global $DB; + /** @var \mod_assign_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('mod_assign'); $courses = array(); for ($i = 0; $i < 10; $i++) { diff --git a/lib/dmllib.php b/lib/dmllib.php index b7527e30605..4ec1c561b90 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -63,7 +63,7 @@ define('MUST_EXIST', 2); class dml_exception extends moodle_exception { /** * @param string $errorcode The name of the string from error.php to print. - * @param string $a Extra words and phrases that might be required in the error string. + * @param mixed $a Extra words and phrases that might be required in the error string. * @param string $debuginfo Optional debugging information. */ function __construct($errorcode, $a=NULL, $debuginfo=null) { diff --git a/lib/editor/atto/classes/plugininfo/atto.php b/lib/editor/atto/classes/plugininfo/atto.php index d60e8cc5eb0..11099e479ca 100644 --- a/lib/editor/atto/classes/plugininfo/atto.php +++ b/lib/editor/atto/classes/plugininfo/atto.php @@ -54,6 +54,7 @@ class atto extends base { */ public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) { global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them. + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. diff --git a/lib/editor/atto/classes/privacy/provider.php b/lib/editor/atto/classes/privacy/provider.php index 102e760bf95..d64802e5615 100644 --- a/lib/editor/atto/classes/privacy/provider.php +++ b/lib/editor/atto/classes/privacy/provider.php @@ -182,7 +182,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { global $DB; diff --git a/lib/editor/tiny/classes/plugininfo/tiny.php b/lib/editor/tiny/classes/plugininfo/tiny.php index b09f51cf62d..57e6cab1354 100644 --- a/lib/editor/tiny/classes/plugininfo/tiny.php +++ b/lib/editor/tiny/classes/plugininfo/tiny.php @@ -64,6 +64,7 @@ class tiny extends \core\plugininfo\base { // In case settings.php wants to refer to them. global $CFG, $USER, $DB, $OUTPUT, $PAGE; + /** @var \admin_root $ADMIN */ $ADMIN = $adminroot; // May be used in settings.php. $plugininfo = $this; // Also can be used inside settings.php. diff --git a/lib/editor/tiny/plugins/autosave/classes/privacy/provider.php b/lib/editor/tiny/plugins/autosave/classes/privacy/provider.php index 24053d3c2b0..c12987fff5d 100644 --- a/lib/editor/tiny/plugins/autosave/classes/privacy/provider.php +++ b/lib/editor/tiny/plugins/autosave/classes/privacy/provider.php @@ -172,7 +172,7 @@ class provider implements /** * Delete all data for all users in the specified context. * - * @param context $context The specific context to delete data for. + * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { global $DB; diff --git a/lib/enrollib.php b/lib/enrollib.php index 186ade3abda..048ca81023f 100644 --- a/lib/enrollib.php +++ b/lib/enrollib.php @@ -2426,7 +2426,7 @@ abstract class enrol_plugin { /** * Returns list of unenrol links for all enrol instances in course. * - * @param int $instance + * @param stdClass $instance * @return moodle_url or NULL if self unenrolment not supported */ public function get_unenrolself_link($instance) { @@ -2708,7 +2708,7 @@ abstract class enrol_plugin { * for enrolment, name of enrolment plugin etc. * * @param stdClass $instance enrolment instance - * @return array instance info. + * @return stdClass|null instance info. */ public function get_enrol_info(stdClass $instance) { return null; diff --git a/lib/excellib.class.php b/lib/excellib.class.php index 5b2d8193d2a..62bda64bffe 100644 --- a/lib/excellib.class.php +++ b/lib/excellib.class.php @@ -50,7 +50,7 @@ use \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; * @package moodlecore */ class MoodleExcelWorkbook { - /** @var PhpSpreadsheet */ + /** @var \PhpOffice\PhpSpreadsheet\Spreadsheet */ protected $objspreadsheet; /** @var string */ diff --git a/lib/external/classes/util.php b/lib/external/classes/util.php index 63540f56d86..c9240ff0b1c 100644 --- a/lib/external/classes/util.php +++ b/lib/external/classes/util.php @@ -572,9 +572,9 @@ class util { /** * Validate text field format against known FORMAT_XXX * - * @param array $format the format to validate - * @return the validated format - * @throws coding_exception + * @param string $format the format to validate + * @return string the validated format + * @throws \moodle_exception * @since Moodle 2.3 */ public static function validate_format($format) { diff --git a/lib/external/tests/privacy/provider_test.php b/lib/external/tests/privacy/provider_test.php index 4e152740637..282b8dcb051 100644 --- a/lib/external/tests/privacy/provider_test.php +++ b/lib/external/tests/privacy/provider_test.php @@ -442,7 +442,7 @@ class provider_test extends provider_testcase { * Create a service. * * @param array $params The params. - * @return stdClass + * @return \stdClass */ protected function create_service(array $params = []) { global $DB; @@ -467,7 +467,7 @@ class provider_test extends provider_testcase { * Create a service user. * * @param array $params The params. - * @return stdClass + * @return \stdClass */ protected function create_service_user(array $params) { global $DB, $USER; diff --git a/lib/filebrowser/file_info.php b/lib/filebrowser/file_info.php index 2127d1f4f60..4c152dd44da 100644 --- a/lib/filebrowser/file_info.php +++ b/lib/filebrowser/file_info.php @@ -34,7 +34,7 @@ defined('MOODLE_INTERNAL') || die(); */ abstract class file_info { - /** @var stdClass File context */ + /** @var context File context */ protected $context; /** @var file_browser File browser instance */ diff --git a/lib/filebrowser/tests/file_browser_test.php b/lib/filebrowser/tests/file_browser_test.php index 48a768fc058..9480fd6eb83 100644 --- a/lib/filebrowser/tests/file_browser_test.php +++ b/lib/filebrowser/tests/file_browser_test.php @@ -20,6 +20,7 @@ use file_info_context_course; use file_info_context_coursecat; use file_info_context_module; use file_info_stored; +use stdClass; /** * Unit tests for file browser @@ -46,7 +47,7 @@ class file_browser_test extends \advanced_testcase { protected $module1; /** @var stdClass */ protected $module2; - /** @var stdClass */ + /** @var array */ protected $course1filerecord; /** @var stdClass */ protected $teacher; diff --git a/lib/filelib.php b/lib/filelib.php index cbd218576b1..59bf8066fda 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -3112,7 +3112,7 @@ function get_moodle_proxy_url() { * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ class curl { - /** @var bool Caches http request contents */ + /** @var curl_cache|false Caches http request contents */ public $cache = false; /** @var bool Uses proxy, null means automatic based on URL */ public $proxy = null; @@ -3458,7 +3458,7 @@ class curl { /** * Set options for individual curl instance * - * @param resource $curl A curl handle + * @param resource|CurlHandle $curl A curl handle * @param array $options * @return resource The curl handle */ diff --git a/lib/filestorage/file_storage.php b/lib/filestorage/file_storage.php index 9c6e3c33937..48bb7883fd4 100644 --- a/lib/filestorage/file_storage.php +++ b/lib/filestorage/file_storage.php @@ -982,7 +982,7 @@ class file_storage { * @param int $itemid item ID * @param string $filepath file path * @param int $userid the user ID - * @return bool success + * @return stored_file|false success */ public function create_directory($contextid, $component, $filearea, $itemid, $filepath, $userid = null) { global $DB; diff --git a/lib/filestorage/tests/file_storage_test.php b/lib/filestorage/tests/file_storage_test.php index 8bd2ce6a7ca..ef110e9ef52 100644 --- a/lib/filestorage/tests/file_storage_test.php +++ b/lib/filestorage/tests/file_storage_test.php @@ -714,6 +714,7 @@ class file_storage_test extends \advanced_testcase { // Create three aliases linking the same original: $aliasfile1 and $aliasfile2 are // created via create_file_from_reference(), $aliasfile3 created from $aliasfile2. + /** @var \stored_file $originalfile */ $originalfile = null; foreach ($fs->get_area_files($user->ctxid, 'user', 'private') as $areafile) { if (!$areafile->is_directory()) { @@ -1862,6 +1863,7 @@ class file_storage_test extends \advanced_testcase { $repos = repository::get_instances(array('type'=>'user')); $repo = reset($repos); + /** @var \stored_file $file */ $file = null; foreach ($fs->get_area_files($user->ctxid, 'user', 'private') as $areafile) { if (!$areafile->is_directory()) { @@ -1892,6 +1894,7 @@ class file_storage_test extends \advanced_testcase { // Create two aliases linking the same original. + /** @var \stored_file $originalfile */ $originalfile = null; foreach ($fs->get_area_files($user->ctxid, 'user', 'private') as $areafile) { if (!$areafile->is_directory()) { diff --git a/lib/filestorage/tests/file_system_filedir_test.php b/lib/filestorage/tests/file_system_filedir_test.php index e75fdc9fdef..2d7532f405d 100644 --- a/lib/filestorage/tests/file_system_filedir_test.php +++ b/lib/filestorage/tests/file_system_filedir_test.php @@ -92,7 +92,7 @@ class file_system_filedir_test extends \advanced_testcase { * @param string $filename The file name to use in the stored_file * @param array $mockedmethods A list of methods you intend to override * If no methods are specified, only abstract functions are mocked. - * @return stored_file + * @return \stored_file */ protected function get_stored_file($filecontent, $filename = null, $mockedmethods = []) { $contenthash = \file_storage::hash_from_string($filecontent); @@ -120,7 +120,7 @@ class file_system_filedir_test extends \advanced_testcase { * * @param array $mockedmethods A list of methods you intend to override * If no methods are specified, only abstract functions are mocked. - * @return file_system + * @return \file_system */ protected function get_testable_mock($mockedmethods = []) { $fs = $this->getMockBuilder(file_system_filedir::class) diff --git a/lib/filestorage/tests/file_system_test.php b/lib/filestorage/tests/file_system_test.php index 94433665e04..e7f1cad1310 100644 --- a/lib/filestorage/tests/file_system_test.php +++ b/lib/filestorage/tests/file_system_test.php @@ -66,7 +66,7 @@ class file_system_test extends \advanced_testcase { * @param string $filename The file name to use in the stored_file * @param array $mockedmethods A list of methods you intend to override * If no methods are specified, only abstract functions are mocked. - * @return stored_file + * @return \stored_file */ protected function get_stored_file($filecontent, $filename = null, $mockedmethods = []) { $contenthash = \file_storage::hash_from_string($filecontent); diff --git a/lib/filestorage/tests/zip_packer_test.php b/lib/filestorage/tests/zip_packer_test.php index 1060fb0003c..41ea6bfffe7 100644 --- a/lib/filestorage/tests/zip_packer_test.php +++ b/lib/filestorage/tests/zip_packer_test.php @@ -612,7 +612,7 @@ class zip_packer_test extends \advanced_testcase implements file_progress { // The archive contains a single encrypted "hello.txt" file. $archive = __DIR__ . '/fixtures/passwordis1.zip'; - /** @var zip_packer $packer */ + /** @var \zip_packer $packer */ $packer = get_file_packer('application/zip'); $result = $packer->extract_to_pathname($archive, make_temp_directory('zip')); diff --git a/lib/form/classes/filetypes_util.php b/lib/form/classes/filetypes_util.php index 6021ce54061..872279134d1 100644 --- a/lib/form/classes/filetypes_util.php +++ b/lib/form/classes/filetypes_util.php @@ -259,7 +259,7 @@ class filetypes_util { * @param string|array $onlytypes Allow selection from these file types only; for example 'web_image'. * @param bool $allowall Allow to select 'All file types'. Does not apply with onlytypes are set. * @param string|array $current Current values that should be selected. - * @return object + * @return array */ public function data_for_browser($onlytypes=null, $allowall=true, $current=null) { diff --git a/lib/form/modgrade.php b/lib/form/modgrade.php index 479d9c8ed8d..e0107fa3187 100644 --- a/lib/form/modgrade.php +++ b/lib/form/modgrade.php @@ -353,7 +353,7 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_group { * * @param string $event Name of event * @param mixed $arg event arguments - * @param moodleform $caller calling object + * @param MoodleQuickForm $caller calling object * @return mixed */ public function onQuickFormEvent($event, $arg, &$caller) { diff --git a/lib/form/passwordunmask.php b/lib/form/passwordunmask.php index 2ac89811846..ae0f9af21d8 100644 --- a/lib/form/passwordunmask.php +++ b/lib/form/passwordunmask.php @@ -87,7 +87,7 @@ class MoodleQuickForm_passwordunmask extends MoodleQuickForm_password { * It turned out that wrapping whitespace can easily be pasted by accident when copying the text from elsewhere. * Such a mistake is very hard to debug as the whitespace is not displayed. * - * @param array $value Submitted value. + * @param string $value Submitted value. * @return string|null Validation error message or null. */ public function validateSubmitValue($value) { diff --git a/lib/form/selectgroups.php b/lib/form/selectgroups.php index 0719bedc617..8c61bb44129 100644 --- a/lib/form/selectgroups.php +++ b/lib/form/selectgroups.php @@ -50,7 +50,7 @@ class MoodleQuickForm_selectgroups extends HTML_QuickForm_element implements tem /** @var array Contains the select optgroups */ var $_optGroups = array(); - /** @var string Default values of the SELECT */ + /** @var array Default values of the SELECT */ var $_values = null; /** @var string html for help button, if empty then no help */ diff --git a/lib/form/tests/dateselector_test.php b/lib/form/tests/dateselector_test.php index d5f751b0a13..b3f1cd1fb44 100644 --- a/lib/form/tests/dateselector_test.php +++ b/lib/form/tests/dateselector_test.php @@ -47,7 +47,7 @@ require_once($CFG->libdir.'/formslib.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class dateselector_test extends \advanced_testcase { - /** @var MoodleQuickForm Keeps reference of dummy form object */ + /** @var \MoodleQuickForm Keeps reference of dummy form object */ private $mform; /** @var array test fixtures */ private $testvals; @@ -184,7 +184,7 @@ class temp_form_date extends moodleform { } /** * Returns form reference - * @return MoodleQuickForm + * @return \MoodleQuickForm */ public function getform() { $mform = $this->_form; diff --git a/lib/form/tests/datetimeselector_test.php b/lib/form/tests/datetimeselector_test.php index 3dc55562d11..e33983e9ed1 100644 --- a/lib/form/tests/datetimeselector_test.php +++ b/lib/form/tests/datetimeselector_test.php @@ -47,7 +47,7 @@ require_once($CFG->libdir.'/formslib.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class datetimeselector_test extends \advanced_testcase { - /** @var MoodleQuickForm Keeps reference of dummy form object */ + /** @var \MoodleQuickForm Keeps reference of dummy form object */ private $mform; /** @var array test fixtures */ private $testvals; @@ -198,7 +198,7 @@ class temp_form_datetime extends moodleform { } /** * Returns form reference. - * @return MoodleQuickForm + * @return \MoodleQuickForm */ public function getform() { $mform = $this->_form; diff --git a/lib/formslib.php b/lib/formslib.php index df47c7b09e0..7dde6309dbc 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -134,7 +134,7 @@ abstract class moodleform { /** @var MoodleQuickForm quickform object definition */ protected $_form; - /** @var array globals workaround */ + /** @var mixed globals workaround */ protected $_customdata; /** @var array submitted form data when using mforms with ajax */ @@ -691,7 +691,7 @@ abstract class moodleform { * * note: $slashed param removed * - * @return object submitted data; NULL if not valid or not submitted or cancelled + * @return stdClass|null submitted data; NULL if not valid or not submitted or cancelled */ function get_data() { $mform =& $this->_form; @@ -714,7 +714,7 @@ abstract class moodleform { * Return submitted data without validation or NULL if there is no submitted data. * note: $slashed param removed * - * @return object submitted data; NULL if not submitted + * @return stdClass|null submitted data; NULL if not submitted */ function get_submitted_data() { $mform =& $this->_form; @@ -2026,7 +2026,7 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { * clean their own data. * * @param string $elementname - * @param int $paramtype defines type of data contained in element. Use the constants PARAM_*. + * @param string $paramtype defines type of data contained in element. Use the constants PARAM_*. * {@link lib/moodlelib.php} for defined parameter types */ function setType($elementname, $paramtype) { @@ -2318,9 +2318,9 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless { * use addGroupRule instead of addRule. * * @param string $element Form element name - * @param string $message Message to display for invalid data + * @param string|null $message Message to display for invalid data * @param string $type Rule type, use getRegisteredRules() to get types - * @param string $format (optional)Required for extra rule data + * @param mixed $format (optional)Required for extra rule data * @param string $validation (optional)Where to perform validation: "server", "client" * @param bool $reset Client-side validation: reset the form element to its original value if there is an error? * @param bool $force Force the rule to be applied, even if the target form element does not exist @@ -3299,7 +3299,7 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{ * Adds required note, form attributes, validation javascript and form content. * * @global moodle_page $PAGE - * @param moodleform $form Passed by reference + * @param MoodleQuickForm $form Passed by reference */ function finishForm(&$form){ global $PAGE; diff --git a/lib/gdlib.php b/lib/gdlib.php index 9c7e50aae8d..bd69ece35fa 100644 --- a/lib/gdlib.php +++ b/lib/gdlib.php @@ -33,8 +33,8 @@ defined('MOODLE_INTERNAL') || die(); * Otherwise it reimplements the same behaviour. See the PHP manual page for more info. * * @link http://php.net/manual/en/function.imagecopyresampled.php - * @param resource $dst_img the destination GD image resource - * @param resource $src_img the source GD image resource + * @param resource|\GdImage $dst_img the destination GD image resource + * @param resource|\GdImage $src_img the source GD image resource * @param int $dst_x vthe X coordinate of the upper left corner in the destination image * @param int $dst_y the Y coordinate of the upper left corner in the destination image * @param int $src_x the X coordinate of the upper left corner in the source image @@ -312,7 +312,7 @@ function resize_image($filepath, $width, $height, $forcecanvas = false) { /** * Resize an image from an image object. * - * @param resource $original The image to work on. + * @param resource|\GdImage $original The image to work on. * @param array $imageinfo Contains [0] => originalwidth, [1] => originalheight. * @param int|null $width The max width of the resized image, or null to only use the height. * @param int|null $height The max height of the resized image, or null to only use the width. diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php index f4a195eb2c6..192bcb513c1 100644 --- a/lib/grade/grade_category.php +++ b/lib/grade/grade_category.php @@ -2558,7 +2558,7 @@ class grade_category extends grade_object { /** * Overrides grade_object::set_properties() to add special handling for changes to category aggregation types * - * @param stdClass $instance the object to set the properties on + * @param grade_category $instance the object to set the properties on * @param array|stdClass $params Either an associative array or an object containing property name, property value pairs */ public static function set_properties(&$instance, $params) { diff --git a/lib/grade/grade_object.php b/lib/grade/grade_object.php index ab2276a71a9..2378a738f9c 100644 --- a/lib/grade/grade_object.php +++ b/lib/grade/grade_object.php @@ -401,7 +401,7 @@ abstract class grade_object { * Given an associated array or object, cycles through each key/variable * and assigns the value to the corresponding variable in this object. * - * @param stdClass $instance The object to set the properties on + * @param grade_object $instance The object to set the properties on * @param array $params An array of properties to set like $propertyname => $propertyvalue * @return array|stdClass Either an associative array or an object containing property name, property value pairs */ diff --git a/lib/grade/tests/grade_category_test.php b/lib/grade/tests/grade_category_test.php index 3644cc6ff66..f5f2b151486 100644 --- a/lib/grade/tests/grade_category_test.php +++ b/lib/grade/tests/grade_category_test.php @@ -409,7 +409,7 @@ class grade_category_test extends \grade_base_testcase { /** * Test grade category aggregation using the supplied grade objects and aggregation method - * @param grade_category $grade_category the category to be tested + * @param \grade_category $grade_category the category to be tested * @param array $grade_items array of instance of grade_item * @param array $grade_grades array of instances of grade_grade * @param int $aggmethod the aggregation method to apply ie GRADE_AGGREGATE_MEAN @@ -433,9 +433,9 @@ class grade_category_test extends \grade_base_testcase { /** * Verify the value of the category grade item for $this->userid - * @param grade_category $grade_category the category to be tested + * @param \grade_category $grade_category the category to be tested * @param int $correctgrade the expected grade - * @param string msg The message that should be displayed if the correct grade is not found + * @param string $msg The message that should be displayed if the correct grade is not found * @return void */ protected function helper_test_grade_aggregation_result($grade_category, $correctgrade, $msg) { diff --git a/lib/grade/tests/grade_item_test.php b/lib/grade/tests/grade_item_test.php index 8f243a70065..53925e0a159 100644 --- a/lib/grade/tests/grade_item_test.php +++ b/lib/grade/tests/grade_item_test.php @@ -796,7 +796,7 @@ class grade_item_test extends \grade_base_testcase { * * @param int $courseid id of course * @param int $sortorder numeric sorting order of item - * @return stdClass grade item object from the database. + * @return \stdClass grade item object from the database. */ private function insert_fake_grade_item_sortorder($courseid, $sortorder) { global $DB, $CFG; diff --git a/lib/gradelib.php b/lib/gradelib.php index 2ea0cff7dde..936fc135c8b 100644 --- a/lib/gradelib.php +++ b/lib/gradelib.php @@ -439,7 +439,8 @@ function grade_regrade_final_grades_if_required($course, callable $callback = nu * @param string $itemmodule More specific then $itemtype. For example, 'forum' or 'quiz'. May be NULL for some item types * @param int $iteminstance ID of the item module * @param mixed $userid_or_ids Either a single user ID, an array of user IDs or null. If user ID or IDs are not supplied returns information about grade_item - * @return array Array of grade information objects (scaleid, name, grade and locked status, etc.) indexed with itemnumbers + * @return stdClass Object with keys {items, outcomes, errors}, where 'items' is an array of grade + * information objects (scaleid, name, grade and locked status, etc.) indexed with itemnumbers */ function grade_get_grades($courseid, $itemtype, $itemmodule, $iteminstance, $userid_or_ids=null) { global $CFG; @@ -1147,7 +1148,7 @@ function grade_recover_history_grades($userid, $courseid) { * @param int $userid If specified try to do a quick regrading of the grades of this user only * @param object $updated_item Optional grade item to be marked for regrading. It is required if $userid is set. * @param \core\progress\base $progress If provided, will be used to update progress on this long operation. - * @return bool true if ok, array of errors if problems found. Grade item id => error message + * @return array|true true if ok, array of errors if problems found. Grade item id => error message */ function grade_regrade_final_grades($courseid, $userid=null, $updated_item=null, $progress=null) { // This may take a very long time and extra memory. diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 3db5c2bb124..a20699e381e 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -7353,7 +7353,7 @@ function get_string_manager($forcereload=false) { * usually expressed as the filename in the language pack without the * .php on the end but can also be written as mod/forum or grade/export/xls. * If none is specified then moodle.php is used. - * @param string|object|array $a An object, string or number that can be used + * @param string|object|array|int $a An object, string or number that can be used * within translation strings * @param bool $lazyload If set to true a string object is returned instead of * the string itself. The string then isn't calculated until it is first used. @@ -7603,7 +7603,7 @@ class emoticon_manager { * * @see self::encode_stored_config() * @param string $encoded - * @return string|null + * @return array|null */ public function decode_stored_config($encoded) { $decoded = json_decode($encoded); @@ -10083,7 +10083,7 @@ function remove_dir($dir, $contentonly=false) { * Detect if an object or a class contains a given property * will take an actual object or the name of a class * - * @param mix $obj Name of class or real object to test + * @param mixed $obj Name of class or real object to test * @param string $property name of property to find * @return bool true if property exists */ @@ -10735,7 +10735,7 @@ class lang_string { * * @param string $identifier The strings identifier * @param string $component The strings component - * @param stdClass|array $a Any arguments the string requires + * @param stdClass|array|mixed $a Any arguments the string requires * @param string $lang The language to use when processing the string. * @throws coding_exception */ diff --git a/lib/navigationlib.php b/lib/navigationlib.php index f3547a6b940..7cb22e6c5bf 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -93,7 +93,7 @@ class navigation_node implements renderable { public $id = null; /** @var string|int The identifier for the node, used to retrieve the node */ public $key = null; - /** @var string The text to use for the node */ + /** @var string|lang_string The text to use for the node */ public $text = null; /** @var string Short text to use if requested [optional] */ public $shorttext = null; @@ -362,7 +362,7 @@ class navigation_node implements renderable { * Adds a navigation node as a child of this node. * * @param string $text - * @param moodle_url|action_link $action + * @param moodle_url|action_link|string $action * @param int $type * @param string $shorttext * @param string|int $key @@ -1166,7 +1166,7 @@ class navigation_node_collection implements IteratorAggregate, Countable { * * @param string|int $key The key of the node we want to find. * @param int $type One of navigation_node::TYPE_*. - * @return navigation_node|null + * @return navigation_node|false */ public function find($key, $type=null) { if ($type !== null && array_key_exists($type, $this->orderedcollection) && array_key_exists($key, $this->orderedcollection[$type])) { @@ -2362,7 +2362,7 @@ class global_navigation extends navigation_node { /** * Loads a stealth module from unavailable section * @param navigation_node $coursenode - * @param stdClass $modinfo + * @param stdClass|course_modinfo $modinfo * @return navigation_node or null if not accessible */ protected function load_stealth_activity(navigation_node $coursenode, $modinfo) { @@ -4267,7 +4267,7 @@ class flat_navigation extends navigation_node_collection { * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class settings_navigation extends navigation_node { - /** @var stdClass the current context */ + /** @var context the current context */ protected $context; /** @var moodle_page the moodle page that the navigation belongs to */ protected $page; @@ -5749,8 +5749,6 @@ class settings_navigation_ajax extends settings_navigation { /** * Initialise the site admin navigation. - * - * @return array An array of the expandable nodes */ public function initialise() { if ($this->initialised || during_initial_install()) { diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 2fe139b1124..578acbe8a97 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -3265,7 +3265,7 @@ class initials_bar implements renderable, templatable { public $urlvar; /** - * @var string URL object. + * @var moodle_url URL object. */ public $url; diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 77a83e3c26c..2bcc1b27619 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1806,7 +1806,7 @@ class core_renderer extends renderer_base { /** * Renders a Check API result * - * @param result $result + * @param core\check\result $result * @return string HTML fragment */ protected function render_check_result(core\check\result $result) { @@ -1816,7 +1816,7 @@ class core_renderer extends renderer_base { /** * Renders a Check API result * - * @param result $result + * @param core\check\result $result * @return string HTML fragment */ public function check_result(core\check\result $result) { @@ -2764,7 +2764,7 @@ class core_renderer extends renderer_base { * Theme developers: DO NOT OVERRIDE! Please override function * {@link core_renderer::render_file_picker()} instead. * - * @param array $options associative array with file manager options + * @param stdClass $options file manager options * options are: * maxbytes=>-1, * itemid=>0, @@ -4819,7 +4819,7 @@ EOD; * Renders a bar chart. * * @param \core\chart_bar $chart The chart. - * @return string. + * @return string */ public function render_chart_bar(\core\chart_bar $chart) { return $this->render_chart($chart); @@ -4829,7 +4829,7 @@ EOD; * Renders a line chart. * * @param \core\chart_line $chart The chart. - * @return string. + * @return string */ public function render_chart_line(\core\chart_line $chart) { return $this->render_chart($chart); @@ -4839,7 +4839,7 @@ EOD; * Renders a pie chart. * * @param \core\chart_pie $chart The chart. - * @return string. + * @return string */ public function render_chart_pie(\core\chart_pie $chart) { return $this->render_chart($chart); @@ -4850,7 +4850,7 @@ EOD; * * @param \core\chart_base $chart The chart. * @param bool $withtable Whether to include a data table with the chart. - * @return string. + * @return string */ public function render_chart(\core\chart_base $chart, $withtable = true) { $chartdata = json_encode($chart); diff --git a/lib/pagelib.php b/lib/pagelib.php index fc5b7ab32a6..7ec4659a7a3 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -523,7 +523,7 @@ class moodle_page { /** * Please do not call this method directly, use the ->category syntax. {@link moodle_page::__get()}. - * @return stdClass the category that the page course belongs to. If there isn't one + * @return stdClass|null the category that the page course belongs to. If there isn't one * (that is, if this is the front page course) returns null. */ protected function magic_get_category() { @@ -906,7 +906,7 @@ class moodle_page { /** * Returns the primary navigation object - * @return primary + * @return primaryoutput */ protected function magic_get_primarynavcombined() { if ($this->_primarynavcombined === null) { diff --git a/lib/pear/HTML/QuickForm.php b/lib/pear/HTML/QuickForm.php index fe0fcac580b..6cec481f024 100644 --- a/lib/pear/HTML/QuickForm.php +++ b/lib/pear/HTML/QuickForm.php @@ -722,7 +722,7 @@ class HTML_QuickForm extends HTML_Common { * @param string $name (optional)group name * @param string $groupLabel (optional)group label * @param string $separator (optional)string to separate elements - * @param string $appendName (optional)specify whether the group name should be + * @param bool $appendName (optional)specify whether the group name should be * used in the form element name ex: group[element] * @return object reference to added group of elements * @since 2.8 diff --git a/lib/phpunit/classes/util.php b/lib/phpunit/classes/util.php index 33583fafa22..5be1b2604b7 100644 --- a/lib/phpunit/classes/util.php +++ b/lib/phpunit/classes/util.php @@ -952,8 +952,8 @@ class phpunit_util extends testing_util { /** * Get the coverage config for the supplied includelist and excludelist configuration. * - * @param array[] $includelists The list of files/folders in the includelist. - * @param array[] $excludelists The list of files/folders in the excludelist. + * @param string[] $includelists The list of files/folders in the includelist. + * @param string[] $excludelists The list of files/folders in the excludelist. * @return string */ protected static function get_coverage_config(array $includelists, array $excludelists) : string { diff --git a/lib/portfolio/exporter.php b/lib/portfolio/exporter.php index 4aded629ef6..142857a63a8 100644 --- a/lib/portfolio/exporter.php +++ b/lib/portfolio/exporter.php @@ -87,7 +87,7 @@ class portfolio_exporter { private $alreadystolen; /** - * @var stored_file files that the exporter has written to this temp area keep track of + * @var stored_file[] files that the exporter has written to this temp area keep track of * this in case of duplicates within one export see MDL-16390 */ private $newfilehashes; diff --git a/lib/portfolio/formats.php b/lib/portfolio/formats.php index 09c45e72ebe..7d64d67a557 100644 --- a/lib/portfolio/formats.php +++ b/lib/portfolio/formats.php @@ -195,7 +195,7 @@ class portfolio_format_image extends portfolio_format_file { /** * Return all mimetypes that use image.gif (eg all images) * - * @return string + * @return array */ public static function mimetypes() { return file_get_typegroup('type', 'image'); diff --git a/lib/portfolio/plugin.php b/lib/portfolio/plugin.php index 9b25f3e5c45..05a1fd3c43f 100644 --- a/lib/portfolio/plugin.php +++ b/lib/portfolio/plugin.php @@ -59,7 +59,7 @@ abstract class portfolio_plugin_base { /** @var bool whether this instance is visible or not */ protected $visible; - /** @var array admin configured config use {@link set_config} and {@get_config} to access */ + /** @var stdClass admin configured config use {@see set_config} and {@see get_config} to access */ protected $config; /** @var array user config cache. keyed on userid and then on config field => value use {@link get_user_config} and {@link set_user_config} to access. */ @@ -634,7 +634,7 @@ abstract class portfolio_plugin_base { * like name, visible etc. * * @param string $field property name - * @return array|string|int|boolean value of the field + * @return mixed value of the field */ public final function get($field) { // This is a legacy change to the way files are get/set. diff --git a/lib/questionlib.php b/lib/questionlib.php index 65e88c94f7a..19c01ec9f0b 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -936,7 +936,7 @@ function question_load_questions($questionids, $extrafields = '', $join = '') { * * @param object $question the question to tidy. * @param stdClass $category The question_categories record for the given $question. - * @param stdClass[]|null $tagobjects The tags for the given $question. + * @param \core_tag_tag[]|null $tagobjects The tags for the given $question. * @param stdClass[]|null $filtercourses The courses to filter the course tags by. */ function _tidy_question($question, $category, array $tagobjects = null, array $filtercourses = null): void { @@ -1037,7 +1037,7 @@ function get_question_options(&$questions, $loadtags = false, $filtercourses = n * This function also search tag instances that may have a context id that don't match either a course or * question context and fix the data setting the correct context id. * - * @param stdClass[] $tagobjects The tags for the given $question. + * @param \core_tag_tag[] $tagobjects The tags for the given $question. * @param stdClass $categorycontext The question categories context. * @param stdClass[]|null $filtercourses The courses to filter the course tags by. * @return stdClass $sortedtagobjects Sorted tag objects. diff --git a/lib/tablelib.php b/lib/tablelib.php index 5109889a4dd..b128e94c3d2 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -151,6 +151,7 @@ class flexible_table { */ var $started_output = false; + /** @var table_dataformat_export_format */ var $exportclass = null; /** @@ -158,16 +159,16 @@ class flexible_table { */ private $prefs = array(); - /** @var $sheettitle */ + /** @var string $sheettitle */ protected $sheettitle; - /** @var $filename */ + /** @var string $filename */ protected $filename; /** @var array $hiddencolumns List of hidden columns. */ protected $hiddencolumns; - /** @var $resetting bool Whether the table preferences is resetting. */ + /** @var bool $resetting Whether the table preferences is resetting. */ protected $resetting; /** @@ -221,8 +222,8 @@ class flexible_table { /** * Get, and optionally set, the export class. - * @param $exportclass (optional) if passed, set the table to use this export class. - * @return table_default_export_format_parent the export class in use (after any set). + * @param table_dataformat_export_format $exportclass (optional) if passed, set the table to use this export class. + * @return table_dataformat_export_format the export class in use (after any set). */ function export_class_instance($exportclass = null) { if (!is_null($exportclass)) { @@ -532,7 +533,6 @@ class flexible_table { /** * Must be called after table is defined. Use methods above first. Cannot * use functions below till after calling this method. - * @return type? */ function setup() { @@ -567,7 +567,7 @@ class flexible_table { /** * Get the order by clause from the session or user preferences, for the table with id $uniqueid. * @param string $uniqueid the identifier for a table. - * @return SQL fragment that can be used in an ORDER BY clause. + * @return string SQL fragment that can be used in an ORDER BY clause. */ public static function get_sort_for_table($uniqueid) { global $SESSION; @@ -590,7 +590,7 @@ class flexible_table { /** * Prepare an an order by clause from the list of columns to be sorted. * @param array $cols column name => SORT_ASC or SORT_DESC - * @return SQL fragment that can be used in an ORDER BY clause. + * @return string SQL fragment that can be used in an ORDER BY clause. */ public static function construct_order_by($cols, $textsortcols=array()) { global $DB; @@ -611,7 +611,7 @@ class flexible_table { } /** - * @return SQL fragment that can be used in an ORDER BY clause. + * @return string SQL fragment that can be used in an ORDER BY clause. */ public function get_sql_sort() { return self::construct_order_by($this->get_sort_columns(), $this->column_textsort); @@ -2246,10 +2246,10 @@ class table_dataformat_export_format extends table_default_export_format_parent /** @var \core\dataformat\base $dataformat */ protected $dataformat; - /** @var $rownum */ + /** @var int $rownum */ protected $rownum = 0; - /** @var $columns */ + /** @var array $columns */ protected $columns; /** diff --git a/lib/testing/generator/block_generator.php b/lib/testing/generator/block_generator.php index 3c4d9a480a5..b2aa8a2ef46 100644 --- a/lib/testing/generator/block_generator.php +++ b/lib/testing/generator/block_generator.php @@ -36,7 +36,7 @@ defined('MOODLE_INTERNAL') || die(); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class testing_block_generator extends component_generator_base { - /** @var number of created instances */ + /** @var int number of created instances */ protected $instancecount = 0; /** diff --git a/lib/testing/generator/data_generator.php b/lib/testing/generator/data_generator.php index 0c426d1fb50..1dc371438f6 100644 --- a/lib/testing/generator/data_generator.php +++ b/lib/testing/generator/data_generator.php @@ -437,7 +437,7 @@ EOD; * Create course section if does not exist yet * @param array|stdClass $record must contain 'course' and 'section' attributes * @param array|null $options - * @return stdClass + * @return section_info * @throws coding_exception */ public function create_course_section($record = null, array $options = null) { @@ -959,7 +959,7 @@ EOD; * * @param int|string $role either an int role id or a string role shortname. * @param int $userid - * @param int $contextid Defaults to the system context + * @param int|context $contextid Defaults to the system context * @return int new/existing id of the assignment */ public function role_assign($role, $userid, $contextid = false) { @@ -1140,7 +1140,7 @@ EOD; /** * Helper function used to create an LTI tool. * - * @param array $data + * @param stdClass $data * @return stdClass the tool */ public function create_lti_tool($data = array()) { @@ -1393,7 +1393,7 @@ EOD; * * @param \stdClass $course The course to enrol in * @param string $role The role to give within the course - * @param \stdClass $userparams User parameters + * @param \stdClass|array $userparams User parameters * @return \stdClass The created user */ public function create_and_enrol($course, $role = 'student', $userparams = null, $enrol = 'manual', diff --git a/lib/testing/generator/module_generator.php b/lib/testing/generator/module_generator.php index bb4ef49f11b..c260242c348 100644 --- a/lib/testing/generator/module_generator.php +++ b/lib/testing/generator/module_generator.php @@ -38,7 +38,7 @@ defined('MOODLE_INTERNAL') || die(); abstract class testing_module_generator extends component_generator_base { /** - * @var number of created instances + * @var int number of created instances */ protected $instancecount = 0; diff --git a/lib/testing/lib.php b/lib/testing/lib.php index bd4ba1e3a78..5622537a9a2 100644 --- a/lib/testing/lib.php +++ b/lib/testing/lib.php @@ -274,7 +274,7 @@ function testing_update_composer_dependencies(bool $selfupdate = true, bool $upd * paths returned by the shell. * * @param string $path - * @return string. + * @return string */ function testing_cli_fix_directory_separator($path) { global $CFG; diff --git a/lib/tests/accesslib_has_capability_test.php b/lib/tests/accesslib_has_capability_test.php index fda323e038a..8a274c6c6fd 100644 --- a/lib/tests/accesslib_has_capability_test.php +++ b/lib/tests/accesslib_has_capability_test.php @@ -514,7 +514,7 @@ class accesslib_has_capability_test extends \advanced_testcase { * * @dataProvider login_as_provider * @param string $loginascontext - * @param string $testcontexts + * @param array $testcontexts */ public function test_login_as_admin(string $loginascontext, array $testcontexts): void { $this->resetAfterTest(); @@ -538,7 +538,7 @@ class accesslib_has_capability_test extends \advanced_testcase { * * @dataProvider login_as_provider * @param string $loginascontext - * @param string $testcontexts + * @param array $testcontexts */ public function test_login_as_user(string $loginascontext, array $testcontexts): void { $this->resetAfterTest(); diff --git a/lib/tests/core_renderer_template_exploit_test.php b/lib/tests/core_renderer_template_exploit_test.php index c003e52d8b8..771ad6be66a 100644 --- a/lib/tests/core_renderer_template_exploit_test.php +++ b/lib/tests/core_renderer_template_exploit_test.php @@ -388,7 +388,7 @@ class core_renderer_template_exploit_test extends \advanced_testcase { /** * Test that the mustache_helper_collection class correctly strips * @dataProvider get_template_testcases() - * @param string $templates The template to add + * @param array $templates The template to add * @param string $torender The name of the template to render * @param array $context The template context * @param array $helpers Mustache helpers to add diff --git a/lib/tests/event/contentbank_content_created_test.php b/lib/tests/event/contentbank_content_created_test.php index 90b76708045..b83e6c5337e 100644 --- a/lib/tests/event/contentbank_content_created_test.php +++ b/lib/tests/event/contentbank_content_created_test.php @@ -63,6 +63,7 @@ class contentbank_content_created_test extends \advanced_testcase { $sink = $this->redirectEvents(); // Create a content bank content. + /** @var \core_contentbank_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('core_contentbank'); $contents = $generator->generate_contentbank_data('contenttype_testable', 1); $content = array_shift($contents); diff --git a/lib/tests/event/contentbank_content_deleted_test.php b/lib/tests/event/contentbank_content_deleted_test.php index 4af8cc5d45e..8e9191b131a 100644 --- a/lib/tests/event/contentbank_content_deleted_test.php +++ b/lib/tests/event/contentbank_content_deleted_test.php @@ -61,6 +61,7 @@ class contentbank_content_deleted_test extends \advanced_testcase { $systemcontext = \context_system::instance(); // Create a content bank content. + /** @var \core_contentbank_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('core_contentbank'); $contents = $generator->generate_contentbank_data('contenttype_testable', 3); $content = array_shift($contents); diff --git a/lib/tests/event/contentbank_content_updated_test.php b/lib/tests/event/contentbank_content_updated_test.php index b1a71a3def6..9292785824b 100644 --- a/lib/tests/event/contentbank_content_updated_test.php +++ b/lib/tests/event/contentbank_content_updated_test.php @@ -60,6 +60,7 @@ class contentbank_content_updated_test extends \advanced_testcase { $systemcontext = \context_system::instance(); // Create a content bank content. + /** @var \core_contentbank_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('core_contentbank'); $contents = $generator->generate_contentbank_data('contenttype_testable', 1); $content = array_shift($contents); diff --git a/lib/tests/event/contentbank_content_viewed_test.php b/lib/tests/event/contentbank_content_viewed_test.php index a8f0524df44..191cdb45c18 100644 --- a/lib/tests/event/contentbank_content_viewed_test.php +++ b/lib/tests/event/contentbank_content_viewed_test.php @@ -61,6 +61,7 @@ class contentbank_content_viewed_test extends \advanced_testcase { $contenttype = new \contenttype_testable\contenttype(); // Create a content bank content. + /** @var \core_contentbank_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('core_contentbank'); $contents = $generator->generate_contentbank_data('contenttype_testable', 1); $content = array_shift($contents); diff --git a/lib/tests/event/context_locked_test.php b/lib/tests/event/context_locked_test.php index c9ebc235ef0..05a875beea3 100644 --- a/lib/tests/event/context_locked_test.php +++ b/lib/tests/event/context_locked_test.php @@ -58,6 +58,7 @@ class context_locked_test extends \advanced_testcase { $catcontext = \context_coursecat::instance($category->id); $course = self::getDataGenerator()->create_course(['category' => $category->id]); $coursecontext = \context_course::instance($course->id); + /** @var \mod_forum_generator $activitygenerator */ $activitygenerator = self::getDataGenerator()->get_plugin_generator('mod_forum'); $activity = $activitygenerator->create_instance(['course' => $course->id]); $activitycontext = \context_module::instance($activity->cmid); diff --git a/lib/tests/fixtures/testable_plugin_manager.php b/lib/tests/fixtures/testable_plugin_manager.php index 507bd000248..8080157eaa2 100644 --- a/lib/tests/fixtures/testable_plugin_manager.php +++ b/lib/tests/fixtures/testable_plugin_manager.php @@ -113,7 +113,7 @@ class testable_core_plugin_manager extends core_plugin_manager { /** * Adds fake plugin information from record. * - * @param stdClass $record + * @param testable_plugininfo_base $record * @return void */ public function add_fake_plugin_info($record): void { diff --git a/lib/tests/h5p_clean_orphaned_records_task_test.php b/lib/tests/h5p_clean_orphaned_records_task_test.php index 561c2516c94..48992e9b168 100644 --- a/lib/tests/h5p_clean_orphaned_records_task_test.php +++ b/lib/tests/h5p_clean_orphaned_records_task_test.php @@ -49,6 +49,7 @@ class h5p_clean_orphaned_records_task_test extends advanced_testcase { $context = context_module::instance($activity->cmid); // Create a fake deploy H5P file. + /** @var \core_h5p_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('core_h5p'); $generator->create_export_file($activity->filename, $context->id, 'mod_h5pactivity', 'package'); diff --git a/lib/tests/moodlelib_test.php b/lib/tests/moodlelib_test.php index b78d3d3deb0..0abcc021c3e 100644 --- a/lib/tests/moodlelib_test.php +++ b/lib/tests/moodlelib_test.php @@ -1315,7 +1315,7 @@ class moodlelib_test extends \advanced_testcase { * * @dataProvider shorten_filenames_provider * - * @param string $filenames + * @param array $filenames * @param int $length * @param string $expected * @param boolean $includehash diff --git a/lib/tests/performance/filtersettingsperformancetester.php b/lib/tests/performance/filtersettingsperformancetester.php index 3cea4e089af..c4f4b0b0d82 100644 --- a/lib/tests/performance/filtersettingsperformancetester.php +++ b/lib/tests/performance/filtersettingsperformancetester.php @@ -53,6 +53,7 @@ $requiredtables = array('context', 'filter_active', 'filter_config'); $realdb = $DB; $testdb = moodle_database::get_driver_instance($CFG->dbtype, $CFG->dblibrary); $testdb->connect($CFG->dbhost, $CFG->dbuser, $CFG->dbpass, $CFG->dbname, $CFG->unittestprefix); +/** @var moodle_database $DB */ $DB = $testdb; $dbman = $testdb->get_manager(); $issetup = 0; diff --git a/lib/tests/questionlib_test.php b/lib/tests/questionlib_test.php index 1b93d96d59d..966ed480e29 100644 --- a/lib/tests/questionlib_test.php +++ b/lib/tests/questionlib_test.php @@ -72,6 +72,7 @@ class questionlib_test extends \advanced_testcase { // Generate an assignment with due date (will generate a course event). $quiz = $this->getDataGenerator()->create_module('quiz', $options); + /** @var \core_question_generator $qgen */ $qgen = $this->getDataGenerator()->get_plugin_generator('core_question'); switch ($type) { @@ -168,6 +169,7 @@ class questionlib_test extends \advanced_testcase { // Create a couple of categories and questions. $context1 = \context_coursecat::instance($coursecat1->id); $context2 = \context_coursecat::instance($coursecat2->id); + /** @var \core_question_generator $questiongenerator */ $questiongenerator = $this->getDataGenerator()->get_plugin_generator('core_question'); $questioncat1 = $questiongenerator->create_question_category(array('contextid' => $context1->id)); @@ -281,6 +283,7 @@ class questionlib_test extends \advanced_testcase { // Setup. $context = \context_system::instance(); + /** @var \core_question_generator $qgen */ $qgen = $this->getDataGenerator()->get_plugin_generator('core_question'); $qcat = $qgen->create_question_category(array('contextid' => $context->id)); $q1 = $qgen->create_question('shortanswer', null, array('category' => $qcat->id)); @@ -303,6 +306,7 @@ class questionlib_test extends \advanced_testcase { // Setup. $context = \context_system::instance(); + /** @var \core_question_generator $qgen */ $qgen = $this->getDataGenerator()->get_plugin_generator('core_question'); $qcat = $qgen->create_question_category(array('contextid' => $context->id)); $q1 = $qgen->create_question('shortanswer', null, array('category' => $qcat->id)); @@ -1634,7 +1638,8 @@ class questionlib_test extends \advanced_testcase { // Create the test data. $generator = $this->getDataGenerator(); - $questiongenerator = $generator->get_plugin_generator('core_question'); + /** @var \core_question_generator $questiongenerator */ + $questiongenerator = $generator->get_plugin_generator('core_question'); $category = $generator->create_category(); $context = \context_coursecat::instance($category->id); @@ -1715,6 +1720,7 @@ class questionlib_test extends \advanced_testcase { // Create the test data. $generator = $this->getDataGenerator(); + /** @var \core_question_generator $questiongenerator */ $questiongenerator = $generator->get_plugin_generator('core_question'); $user = $generator->create_user(); $otheruser = $generator->create_user(); @@ -1761,6 +1767,7 @@ class questionlib_test extends \advanced_testcase { // Create the test data. $generator = $this->getDataGenerator(); + /** @var \core_question_generator $questiongenerator */ $questiongenerator = $generator->get_plugin_generator('core_question'); $user = $generator->create_user(); $otheruser = $generator->create_user(); @@ -1807,6 +1814,7 @@ class questionlib_test extends \advanced_testcase { // Create the test data. $generator = $this->getDataGenerator(); + /** @var \core_question_generator $questiongenerator */ $questiongenerator = $generator->get_plugin_generator('core_question'); $user = $generator->create_user(); $otheruser = $generator->create_user(); @@ -1853,6 +1861,7 @@ class questionlib_test extends \advanced_testcase { // Create the test data. $generator = $this->getDataGenerator(); + /** @var \core_question_generator $questiongenerator */ $questiongenerator = $generator->get_plugin_generator('core_question'); $user = $generator->create_user(); $otheruser = $generator->create_user(); @@ -1909,6 +1918,7 @@ class questionlib_test extends \advanced_testcase { // Create the test data. $generator = $this->getDataGenerator(); + /** @var \core_question_generator $questiongenerator */ $questiongenerator = $generator->get_plugin_generator('core_question'); $user = $generator->create_user(); $otheruser = $generator->create_user(); @@ -1945,6 +1955,7 @@ class questionlib_test extends \advanced_testcase { public function test_question_has_capability_on_wrong_param_type() { // Create the test data. $generator = $this->getDataGenerator(); + /** @var \core_question_generator $questiongenerator */ $questiongenerator = $generator->get_plugin_generator('core_question'); $user = $generator->create_user(); @@ -1976,6 +1987,7 @@ class questionlib_test extends \advanced_testcase { public function test_question_categorylist_parents() { $this->resetAfterTest(); $generator = $this->getDataGenerator(); + /** @var \core_question_generator $questiongenerator */ $questiongenerator = $generator->get_plugin_generator('core_question'); $category = $generator->create_category(); $context = \context_coursecat::instance($category->id); @@ -2121,6 +2133,7 @@ class questionlib_test extends \advanced_testcase { public function test_is_latest() { global $DB; $this->resetAfterTest(); + /** @var \core_question_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('core_question'); $qcat1 = $generator->create_question_category(['name' => 'My category', 'sortorder' => 1, 'idnumber' => 'myqcat']); $question = $generator->create_question('shortanswer', null, ['name' => 'q1', 'category' => $qcat1->id]); @@ -2141,6 +2154,7 @@ class questionlib_test extends \advanced_testcase { $this->resetAfterTest(); // Setup. $context = \context_system::instance(); + /** @var \core_question_generator $qgen */ $qgen = $this->getDataGenerator()->get_plugin_generator('core_question'); $qcat = $qgen->create_question_category(array('contextid' => $context->id)); $q1 = $qgen->create_question('shortanswer', null, array('category' => $qcat->id)); @@ -2177,6 +2191,7 @@ class questionlib_test extends \advanced_testcase { $this->resetAfterTest(); // Setup. $context = \context_system::instance(); + /** @var \core_question_generator $qgen */ $qgen = $this->getDataGenerator()->get_plugin_generator('core_question'); $qcat = $qgen->create_question_category(array('contextid' => $context->id)); $q1 = $qgen->create_question('shortanswer', null, array('category' => $qcat->id)); @@ -2206,6 +2221,7 @@ class questionlib_test extends \advanced_testcase { $this->resetAfterTest(); // Setup. $context = \context_system::instance(); + /** @var \core_question_generator $qgen */ $qgen = $this->getDataGenerator()->get_plugin_generator('core_question'); $qcat = $qgen->create_question_category(array('contextid' => $context->id)); $q1 = $qgen->create_question('shortanswer', null, array('category' => $qcat->id)); @@ -2236,6 +2252,7 @@ class questionlib_test extends \advanced_testcase { $this->resetAfterTest(); // Setup. $context = \context_system::instance(); + /** @var \core_question_generator $qgen */ $qgen = $this->getDataGenerator()->get_plugin_generator('core_question'); $qcat = $qgen->create_question_category(array('contextid' => $context->id)); $q1 = $qgen->create_question('shortanswer', null, array('category' => $qcat->id)); diff --git a/lib/tests/task/logging_test.php b/lib/tests/task/logging_test.php index ee0df88197d..e7ab3dba398 100644 --- a/lib/tests/task/logging_test.php +++ b/lib/tests/task/logging_test.php @@ -475,7 +475,7 @@ class logging_test extends \advanced_testcase { /** * Create and configure a mocked task logger. * - * @return task_logger + * @return logging_test_mocked_logger */ protected function get_mocked_logger() { global $CFG; diff --git a/lib/tests/update_api_test.php b/lib/tests/update_api_test.php index 504041ce42f..0e9cd7b03ae 100644 --- a/lib/tests/update_api_test.php +++ b/lib/tests/update_api_test.php @@ -41,6 +41,7 @@ class update_api_test extends \advanced_testcase { */ public function test_convert_branch_numbering_format() { + /** @var \core\update\testable_api $client */ $client = \core\update\testable_api::client(); $this->assertSame('2.9', $client->convert_branch_numbering_format(29)); diff --git a/lib/weblib.php b/lib/weblib.php index bc40502da56..59cbb8c2706 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -113,7 +113,6 @@ function s($var) { * @see s() * * @param string $var the string potentially containing HTML characters - * @return string */ function p($var) { echo s($var); @@ -1237,7 +1236,7 @@ function format_text_menu() { * @param string $text The text to be formatted. This is raw text originally from user input. * @param int $format Identifier of the text format to be used * [FORMAT_MOODLE, FORMAT_HTML, FORMAT_PLAIN, FORMAT_MARKDOWN] - * @param object/array $options text formatting options + * @param stdClass|array $options text formatting options * @param int $courseiddonotuse deprecated course id, use context option instead * @return string */ @@ -2693,7 +2692,7 @@ function print_recent_activity_note($time, $user, $text, $link, $return=false, $ * outputs a simple list structure in XHTML. * The data is taken from the serialised array stored in the course record. * - * @param course $course A {@link $COURSE} object. + * @param stdClass $course A course object. * @param array $sections * @param course_modinfo $modinfo * @param string $strsection @@ -3564,7 +3563,7 @@ class error_log_progress_trace extends progress_trace { * @package core */ class progress_trace_buffer extends progress_trace { - /** @var progres_trace */ + /** @var progress_trace */ protected $trace; /** @var bool do we pass output out */ protected $passthrough; @@ -3734,7 +3733,7 @@ function print_password_policy() { * which format to output the doclink in. * @param string|object|array $a An object, string or number that can be used * within translation strings - * @return Object An object containing: + * @return stdClass An object containing: * - heading: Any heading that there may be for this help string. * - text: The wiki-formatted help string. * - doclink: An object containing a link, the linktext, and any additional diff --git a/lib/xapi/classes/local/statement.php b/lib/xapi/classes/local/statement.php index af69b5a5587..379152c4a2d 100644 --- a/lib/xapi/classes/local/statement.php +++ b/lib/xapi/classes/local/statement.php @@ -66,7 +66,7 @@ class statement implements JsonSerializable { /** @var string The statement stored. */ protected $stored = null; - /** @var authority The statement authority. */ + /** @var item_actor The statement authority. */ protected $authority = null; /** @var string The statement version. */ @@ -414,7 +414,7 @@ class statement implements JsonSerializable { /** * Return the statement authority if it is defined. * - * @return item|null + * @return item_actor|null */ public function get_authority(): ?item_actor { return $this->authority; diff --git a/lib/xapi/classes/local/statement/item_group.php b/lib/xapi/classes/local/statement/item_group.php index 1773793ceb5..323467ffc7c 100644 --- a/lib/xapi/classes/local/statement/item_group.php +++ b/lib/xapi/classes/local/statement/item_group.php @@ -41,10 +41,10 @@ defined('MOODLE_INTERNAL') || die(); */ class item_group extends item_actor { - /** @var timestamp The statement timestamp. */ + /** @var array */ protected $users; - /** @var timestamp The statement timestamp. */ + /** @var stdClass */ protected $group; /** diff --git a/lib/xapi/tests/local/statement/item_attachment_test.php b/lib/xapi/tests/local/statement/item_attachment_test.php index 581ed8940c0..ee1c51f8cb9 100644 --- a/lib/xapi/tests/local/statement/item_attachment_test.php +++ b/lib/xapi/tests/local/statement/item_attachment_test.php @@ -52,7 +52,7 @@ class item_attachment_test extends advanced_testcase { /** * return a generic data to create a valid item. * - * @return sdtClass the creation data + * @return \stdClass the creation data */ private function get_generic_data(): \stdClass { return (object) [ diff --git a/lib/xapi/tests/local/statement/item_result_test.php b/lib/xapi/tests/local/statement/item_result_test.php index 15a12127500..b6c25b8ae7f 100644 --- a/lib/xapi/tests/local/statement/item_result_test.php +++ b/lib/xapi/tests/local/statement/item_result_test.php @@ -56,7 +56,7 @@ class item_result_test extends advanced_testcase { /** * Return a generic data to create a valid item. * - * @return sdtClass the creation data + * @return \stdClass the creation data */ private function get_generic_data(): \stdClass { return (object) [ diff --git a/lib/xmldb/xmldb_field.php b/lib/xmldb/xmldb_field.php index 433911f70ce..970a50131a8 100644 --- a/lib/xmldb/xmldb_field.php +++ b/lib/xmldb/xmldb_field.php @@ -90,7 +90,7 @@ class xmldb_field extends xmldb_object { * @param bool $notnull XMLDB_NOTNULL or null (or false) * @param bool $sequence XMLDB_SEQUENCE or null (or false) * @param mixed $default meaningful default o null (or false) - * @param xmldb_object $previous + * @param string $previous */ public function __construct($name, $type=null, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) { $this->type = null; @@ -112,7 +112,7 @@ class xmldb_field extends xmldb_object { * @param bool $notnull XMLDB_NOTNULL or null (or false) * @param bool $sequence XMLDB_SEQUENCE or null (or false) * @param mixed $default meaningful default o null (or false) - * @param xmldb_object $previous + * @param string $previous */ public function set_attributes($type, $precision=null, $unsigned=null, $notnull=null, $sequence=null, $default=null, $previous=null) { $this->type = $type; @@ -535,7 +535,7 @@ class xmldb_field extends xmldb_object { /** * This function will set all the attributes of the xmldb_field object * based on information passed in one ADOField - * @param string $adofield + * @param database_column_info $adofield * @return void, sets $this->type */ public function setFromADOField($adofield) { diff --git a/lib/xmldb/xmldb_object.php b/lib/xmldb/xmldb_object.php index a104ec0a60a..9a69bd8a365 100644 --- a/lib/xmldb/xmldb_object.php +++ b/lib/xmldb/xmldb_object.php @@ -34,10 +34,10 @@ class xmldb_object { /** @var string comment on object */ protected $comment; - /** @var xmldb_object */ + /** @var string */ protected $previous; - /** @var xmldb_object */ + /** @var string */ protected $next; /** @var string hash of object */ @@ -101,7 +101,7 @@ class xmldb_object { /** * This function will return the name of the previous xmldb_object - * @return xmldb_object + * @return string */ public function getPrevious() { return $this->previous; @@ -109,7 +109,7 @@ class xmldb_object { /** * This function will return the name of the next xmldb_object - * @return xmldb_object + * @return string */ public function getNext() { return $this->next; @@ -141,7 +141,7 @@ class xmldb_object { /** * This function will set the previous of the xmldb_object - * @param xmldb_object $previous + * @param string $previous */ public function setPrevious($previous) { $this->previous = $previous; @@ -149,7 +149,7 @@ class xmldb_object { /** * This function will set the next of the xmldb_object - * @param xmldb_object $next + * @param string $next */ public function setNext($next) { $this->next = $next; diff --git a/lib/xmldb/xmldb_structure.php b/lib/xmldb/xmldb_structure.php index d3a69efa497..3195813f810 100644 --- a/lib/xmldb/xmldb_structure.php +++ b/lib/xmldb/xmldb_structure.php @@ -34,7 +34,7 @@ class xmldb_structure extends xmldb_object { /** @var string */ protected $version; - /** @var array tables */ + /** @var xmldb_table[] tables */ protected $tables; /** diff --git a/mod/assign/classes/output/grading_app.php b/mod/assign/classes/output/grading_app.php index f2107c5d034..2770beee0b1 100644 --- a/mod/assign/classes/output/grading_app.php +++ b/mod/assign/classes/output/grading_app.php @@ -66,7 +66,7 @@ class grading_app implements templatable, renderable { * * @param int $userid The user we will open the grading app too. * @param int $groupid If groups are enabled this is the current course group. - * @param assign $assignment The assignment class + * @param \assign $assignment The assignment class */ public function __construct($userid, $groupid, $assignment) { $this->userid = $userid; diff --git a/mod/assign/classes/output/renderer.php b/mod/assign/classes/output/renderer.php index 38a580be60c..3b1f5cf0214 100644 --- a/mod/assign/classes/output/renderer.php +++ b/mod/assign/classes/output/renderer.php @@ -49,8 +49,8 @@ class renderer extends \plugin_renderer_base { * @param int $userid * @param string $filearea * @param string $component - * @param stdClass $course - * @param stdClass $coursemodule + * @param \stdClass $course + * @param \stdClass $coursemodule * @return string */ public function assign_files(\context $context, $userid, $filearea, $component, $course = null, $coursemodule = null) { diff --git a/mod/assign/classes/privacy/assign_plugin_request_data.php b/mod/assign/classes/privacy/assign_plugin_request_data.php index 4bb664d9cc2..f241e9db090 100644 --- a/mod/assign/classes/privacy/assign_plugin_request_data.php +++ b/mod/assign/classes/privacy/assign_plugin_request_data.php @@ -36,7 +36,7 @@ defined('MOODLE_INTERNAL') || die(); */ class assign_plugin_request_data { - /** @var context The context that we are dealing with. */ + /** @var \context The context that we are dealing with. */ protected $context; /** @var object For submisisons the submission object, for feedback the grade object. */ @@ -57,7 +57,7 @@ class assign_plugin_request_data { /** @var array The grades related to the users added. */ protected $grades = []; - /** @var assign The assign object */ + /** @var \assign The assign object */ protected $assign; /** @@ -91,7 +91,7 @@ class assign_plugin_request_data { /** * Getter for this attribute. * - * @return context Context + * @return \context Context */ public function get_context() { return $this->context; @@ -127,7 +127,7 @@ class assign_plugin_request_data { /** * Getter for this attribute. * - * @return assign The assign object. + * @return \assign The assign object. */ public function get_assign() { return $this->assign; diff --git a/mod/assign/classes/privacy/provider.php b/mod/assign/classes/privacy/provider.php index 469e32f515c..79642382fcc 100644 --- a/mod/assign/classes/privacy/provider.php +++ b/mod/assign/classes/privacy/provider.php @@ -487,7 +487,7 @@ class provider implements * Find out if this user has graded any users. * * @param int $userid The user ID (potential teacher). - * @param assign $assign The assignment object. + * @param \assign $assign The assignment object. * @return array If successful an array of objects with userids that this user graded, otherwise false. */ protected static function get_graded_users(int $userid, \assign $assign) { diff --git a/mod/assign/feedback/comments/tests/privacy/provider_test.php b/mod/assign/feedback/comments/tests/privacy/provider_test.php index 19685771315..3403aa459ea 100644 --- a/mod/assign/feedback/comments/tests/privacy/provider_test.php +++ b/mod/assign/feedback/comments/tests/privacy/provider_test.php @@ -41,8 +41,8 @@ class provider_test extends \mod_assign\privacy\provider_test { * Convenience function for creating feedback data. * * @param object $assign assign object - * @param stdClass $student user object - * @param stdClass $teacher user object + * @param \stdClass $student user object + * @param \stdClass $teacher user object * @param string $submissiontext Submission text * @param string $feedbacktext Feedback text * @return array Feedback plugin object and the grade object. diff --git a/mod/assign/feedback/editpdf/classes/annotation.php b/mod/assign/feedback/editpdf/classes/annotation.php index 11ea11e671c..0bf90282a6d 100644 --- a/mod/assign/feedback/editpdf/classes/annotation.php +++ b/mod/assign/feedback/editpdf/classes/annotation.php @@ -68,7 +68,7 @@ class annotation { /** * Convert a compatible stdClass into an instance of this class. - * @param stdClass $record + * @param \stdClass $record */ public function __construct(\stdClass $record = null) { if ($record) { diff --git a/mod/assign/feedback/editpdf/classes/combined_document.php b/mod/assign/feedback/editpdf/classes/combined_document.php index d757599f191..8ff098107f3 100644 --- a/mod/assign/feedback/editpdf/classes/combined_document.php +++ b/mod/assign/feedback/editpdf/classes/combined_document.php @@ -136,7 +136,7 @@ class combined_document { /** * Set the completed combined file. * - * @param stored_file $file The completed document for all files to be combined. + * @param \stored_file $file The completed document for all files to be combined. * @return $this */ public function set_combined_file($file) { @@ -171,7 +171,7 @@ class combined_document { /** * Set all source files which are to be combined. * - * @param stored_file|conversion[] $files The complete list of all source files to be combined. + * @param \stored_file|conversion[] $files The complete list of all source files to be combined. * @return $this */ public function set_source_files($files) { @@ -183,7 +183,7 @@ class combined_document { /** * Add an additional source file to the end of the existing list. * - * @param stored_file|conversion $file The file to add to the end of the list. + * @param \stored_file|conversion $file The file to add to the end of the list. * @return $this */ public function add_source_file($file) { diff --git a/mod/assign/feedback/editpdf/classes/comments_quick_list.php b/mod/assign/feedback/editpdf/classes/comments_quick_list.php index deb8be23708..c9775de34b2 100644 --- a/mod/assign/feedback/editpdf/classes/comments_quick_list.php +++ b/mod/assign/feedback/editpdf/classes/comments_quick_list.php @@ -52,7 +52,7 @@ class comments_quick_list { * @param string $commenttext * @param int $width * @param string $colour - * @return stdClass - the comment record (with new id set) + * @return \stdClass - the comment record (with new id set) */ public static function add_comment($commenttext, $width, $colour) { global $DB, $USER; diff --git a/mod/assign/feedback/editpdf/classes/document_services.php b/mod/assign/feedback/editpdf/classes/document_services.php index 4986b0a6478..522821f2d2e 100644 --- a/mod/assign/feedback/editpdf/classes/document_services.php +++ b/mod/assign/feedback/editpdf/classes/document_services.php @@ -91,7 +91,7 @@ EOD; * This function will take an int or an assignment instance and * return an assignment instance. It is just for convenience. * @param int|\assign $assignment - * @return assign + * @return \assign */ private static function get_assignment_from_param($assignment) { global $CFG; @@ -642,7 +642,7 @@ EOD; * @param int|\assign $assignment * @param int $userid * @param int $attemptnumber (-1 means latest attempt) - * @return stored_file + * @return \stored_file */ public static function generate_feedback_document($assignment, $userid, $attemptnumber) { global $CFG; @@ -826,7 +826,7 @@ EOD; * @param int|\assign $assignment * @param int $userid * @param int $attemptnumber (-1 means latest attempt) - * @return stored_file + * @return \stored_file */ public static function get_feedback_document($assignment, $userid, $attemptnumber) { diff --git a/mod/assign/feedback/editpdf/classes/page_editor.php b/mod/assign/feedback/editpdf/classes/page_editor.php index ce86fee65f0..401b12c42d8 100644 --- a/mod/assign/feedback/editpdf/classes/page_editor.php +++ b/mod/assign/feedback/editpdf/classes/page_editor.php @@ -315,7 +315,7 @@ class page_editor { * being procssed when using applytoall. * * @param int|\assign $assignment - * @param stdClass $grade + * @param \stdClass $grade * @param int $sourceuserid * @return bool */ diff --git a/mod/assign/feedback/editpdf/classes/pdf.php b/mod/assign/feedback/editpdf/classes/pdf.php index fd187be70be..1eb6453fb81 100644 --- a/mod/assign/feedback/editpdf/classes/pdf.php +++ b/mod/assign/feedback/editpdf/classes/pdf.php @@ -705,7 +705,7 @@ class pdf extends TcpdfFpdi { /** * Check to see if PDF is version 1.4 (or below); if not: use ghostscript to convert it * - * @param stored_file $file + * @param \stored_file $file * @return string path to copy or converted pdf (false == fail) */ public static function ensure_pdf_compatible(\stored_file $file) { diff --git a/mod/assign/feedback/editpdf/tests/feedback_test.php b/mod/assign/feedback/editpdf/tests/feedback_test.php index e18a4b994a2..de03154fd08 100644 --- a/mod/assign/feedback/editpdf/tests/feedback_test.php +++ b/mod/assign/feedback/editpdf/tests/feedback_test.php @@ -50,8 +50,8 @@ class feedback_test extends \advanced_testcase { /** * Helper method to add a file to a submission. * - * @param stdClass $student Student submitting. - * @param assign $assign Assignment being submitted. + * @param \stdClass $student Student submitting. + * @param \assign $assign Assignment being submitted. * @param bool $textfile Use textfile fixture instead of pdf. */ protected function add_file_submission($student, $assign, $textfile = false) { diff --git a/mod/assign/feedback/editpdf/tests/privacy/provider_test.php b/mod/assign/feedback/editpdf/tests/privacy/provider_test.php index 0b6f8b9d4ea..0c29df160e2 100644 --- a/mod/assign/feedback/editpdf/tests/privacy/provider_test.php +++ b/mod/assign/feedback/editpdf/tests/privacy/provider_test.php @@ -53,9 +53,9 @@ class provider_test extends \mod_assign\privacy\provider_test { /** * Convenience function for creating feedback data. * - * @param object $assign assign object - * @param stdClass $student user object - * @param stdClass $teacher user object + * @param object $assign assign object + * @param \stdClass $student user object + * @param \stdClass $teacher user object * @return array Feedback plugin object and the grade object. */ protected function create_feedback($assign, $student, $teacher) { diff --git a/mod/assign/feedback/file/tests/privacy/provider_test.php b/mod/assign/feedback/file/tests/privacy/provider_test.php index 96928247662..5eb848cd689 100644 --- a/mod/assign/feedback/file/tests/privacy/provider_test.php +++ b/mod/assign/feedback/file/tests/privacy/provider_test.php @@ -43,8 +43,8 @@ class provider_test extends \mod_assign\privacy\provider_test { * Convenience function for creating feedback data. * * @param object $assign assign object - * @param stdClass $student user object - * @param stdClass $teacher user object + * @param \stdClass $student user object + * @param \stdClass $teacher user object * @param string $submissiontext Submission text * @param string $feedbacktext Feedback text * @return array Feedback plugin object and the grade object. diff --git a/mod/assign/lib.php b/mod/assign/lib.php index 2c2413416a6..9158e763dcc 100644 --- a/mod/assign/lib.php +++ b/mod/assign/lib.php @@ -200,7 +200,7 @@ function assign_reset_gradebook($courseid, $type='') { /** * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the assignment. - * @param moodleform $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function assign_reset_course_form_definition(&$mform) { $mform->addElement('header', 'assignheader', get_string('modulenameplural', 'assign')); diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 656e85e73e3..ab4086dbfc0 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -9629,8 +9629,8 @@ class assign { * Get the correct submission statement depending on single submisison, team submission or team submission * where all team memebers must submit. * - * @param array $adminconfig - * @param assign $instance + * @param stdClass $adminconfig + * @param stdClass $instance * @param context $context * * @return string diff --git a/mod/assign/submission/file/classes/event/assessable_uploaded.php b/mod/assign/submission/file/classes/event/assessable_uploaded.php index d270822f3ff..0d7eb9f41c8 100644 --- a/mod/assign/submission/file/classes/event/assessable_uploaded.php +++ b/mod/assign/submission/file/classes/event/assessable_uploaded.php @@ -74,7 +74,7 @@ class assessable_uploaded extends \core\event\assessable_uploaded { /** * Sets the legacy event data. * - * @param stdClass $legacyfiles legacy event data. + * @param \stdClass $legacyfiles legacy event data. * @return void */ public function set_legacy_files($legacyfiles) { diff --git a/mod/bigbluebuttonbn/classes/recording.php b/mod/bigbluebuttonbn/classes/recording.php index fd8b7fb729d..34bcb7556c0 100644 --- a/mod/bigbluebuttonbn/classes/recording.php +++ b/mod/bigbluebuttonbn/classes/recording.php @@ -208,7 +208,7 @@ class recording extends persistent { * Get select for given group mode and context * * @param int $groupmode - * @param context $context + * @param \context $context * @param int $courseid * @param int $groupid * @param int $groupingid diff --git a/mod/bigbluebuttonbn/classes/settings.php b/mod/bigbluebuttonbn/classes/settings.php index 038726d2902..95cae03cff5 100644 --- a/mod/bigbluebuttonbn/classes/settings.php +++ b/mod/bigbluebuttonbn/classes/settings.php @@ -43,7 +43,7 @@ use mod_bigbluebuttonbn\local\proxy\bigbluebutton_proxy; */ class settings { - /** @var admin_setting shared value */ + /** @var admin_category shared value */ private $admin; /** @var bool Module is enabled */ diff --git a/mod/bigbluebuttonbn/lib.php b/mod/bigbluebuttonbn/lib.php index a1ca80886e1..c51159e8c4a 100644 --- a/mod/bigbluebuttonbn/lib.php +++ b/mod/bigbluebuttonbn/lib.php @@ -273,9 +273,9 @@ function bigbluebuttonbn_get_extra_capabilities() { /** * Called by course/reset.php * - * @param object $mform + * @param MoodleQuickForm $mform */ -function bigbluebuttonbn_reset_course_form_definition(object &$mform) { +function bigbluebuttonbn_reset_course_form_definition(&$mform) { $items = reset::reset_course_items(); $mform->addElement('header', 'bigbluebuttonbnheader', get_string('modulenameplural', 'bigbluebuttonbn')); foreach ($items as $item => $default) { @@ -388,7 +388,7 @@ function bigbluebuttonbn_get_coursemodule_info($coursemodule) { * Serves the bigbluebuttonbn attachments. Implements needed access control ;-). * * @param stdClass $course course object - * @param cm_info $cm course module object + * @param stdClass $cm course module object * @param context $context context object * @param string $filearea file area * @param array $args extra arguments diff --git a/mod/book/lib.php b/mod/book/lib.php index 34cdd815967..d5a0d964862 100644 --- a/mod/book/lib.php +++ b/mod/book/lib.php @@ -191,7 +191,7 @@ function book_reset_userdata($data) { /** * The elements to add the course reset form. * - * @param moodleform $mform + * @param MoodleQuickForm $mform */ function book_reset_course_form_definition(&$mform) { $mform->addElement('header', 'bookheader', get_string('modulenameplural', 'book')); diff --git a/mod/chat/lib.php b/mod/chat/lib.php index 02c61134f8e..2be31aac5aa 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -1191,7 +1191,7 @@ function chat_print_overview() { * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the chat. * - * @param object $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function chat_reset_course_form_definition(&$mform) { $mform->addElement('header', 'chatheader', get_string('modulenameplural', 'chat')); diff --git a/mod/choice/lib.php b/mod/choice/lib.php index d91cb22e9a2..b9c3cbbbaad 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -721,7 +721,7 @@ function choice_get_post_actions() { * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the choice. * - * @param object $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function choice_reset_course_form_definition(&$mform) { $mform->addElement('header', 'choiceheader', get_string('modulenameplural', 'choice')); diff --git a/mod/data/lib.php b/mod/data/lib.php index 3aba50ad4fc..6dba4b82548 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -2726,7 +2726,7 @@ function data_preset_path($course, $userid, $shortname) { * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the data. * - * @param $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function data_reset_course_form_definition(&$mform) { $mform->addElement('header', 'dataheader', get_string('modulenameplural', 'data')); diff --git a/mod/feedback/item/multichoicerated/lib.php b/mod/feedback/item/multichoicerated/lib.php index ad347c8252d..54e62ccafc8 100644 --- a/mod/feedback/item/multichoicerated/lib.php +++ b/mod/feedback/item/multichoicerated/lib.php @@ -73,6 +73,11 @@ class feedback_item_multichoicerated extends feedback_item_base { $this->item_form = new feedback_multichoicerated_form('edit_item.php', $customdata); } + /** + * Saves item + * + * @return stdClass + */ public function save_item() { global $DB; diff --git a/mod/feedback/lib.php b/mod/feedback/lib.php index 3c7c9f0a3c9..86b9065c969 100644 --- a/mod/feedback/lib.php +++ b/mod/feedback/lib.php @@ -677,7 +677,7 @@ function feedback_reset_userdata($data) { * * @global object * @uses FEEDBACK_RESETFORM_RESET - * @param object $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function feedback_reset_course_form_definition(&$mform) { global $COURSE, $DB; @@ -1181,7 +1181,7 @@ function feedback_get_receivemail_users($cmid, $groups = false) { * @param int $courseid * @param string $name the name of template shown in the templatelist * @param int $ispublic 0:privat 1:public - * @return int the new templateid + * @return stdClass the new template */ function feedback_create_template($courseid, $name, $ispublic = 0) { global $DB; @@ -1966,7 +1966,7 @@ function feedback_delete_completedtmp() { * * @global object * @param int $feedbackid - * @return mixed false if there already is a pagebreak on last position or the id of the pagebreak-item + * @return int|false false if there already is a pagebreak on last position or the id of the pagebreak-item */ function feedback_create_pagebreak($feedbackid) { global $DB; diff --git a/mod/feedback/tests/generator/lib.php b/mod/feedback/tests/generator/lib.php index 1eedc41fb0f..9b39bc191b4 100644 --- a/mod/feedback/tests/generator/lib.php +++ b/mod/feedback/tests/generator/lib.php @@ -179,7 +179,7 @@ class mod_feedback_generator extends testing_module_generator { * * @param object $feedback feedback record * @param array $record (optional) to override default values - * @return int + * @return stdClass */ public function create_item_info($feedback, $record = array()) { global $DB, $CFG; @@ -195,7 +195,7 @@ class mod_feedback_generator extends testing_module_generator { 'template' => 0, 'name' => 'Feedback question item ' . $position, 'label' => 'Feedback label ' . $position, - 'presentation' => $itemobj::MODE_COURSE, + 'presentation' => \feedback_item_info::MODE_COURSE, 'typ' => 'info', 'hasvalue' => 0, 'position' => $position, @@ -214,7 +214,7 @@ class mod_feedback_generator extends testing_module_generator { * * @param object $feedback feedback record * @param array $record (optional) to override default values - * @return int + * @return stdClass */ public function create_item_label($feedback, $record = array()) { global $DB, $CFG; @@ -257,7 +257,7 @@ class mod_feedback_generator extends testing_module_generator { * * @param object $feedback feedback record * @param array $record (optional) to override default values - * @return int + * @return stdClass */ public function create_item_multichoice($feedback, $record = array()) { global $DB, $CFG; @@ -304,7 +304,7 @@ class mod_feedback_generator extends testing_module_generator { * * @param object $feedback feedback record * @param array $record (optional) to override default values - * @return int + * @return stdClass */ public function create_item_multichoicerated($feedback, $record = array()) { global $DB, $CFG; @@ -353,7 +353,7 @@ class mod_feedback_generator extends testing_module_generator { * * @param object $feedback feedback record * @param array $record (optional) to override default values - * @return int + * @return stdClass */ public function create_item_numeric($feedback, $record = array()) { global $DB, $CFG; @@ -398,7 +398,7 @@ class mod_feedback_generator extends testing_module_generator { * * @param object $feedback feedback record * @param array $record (optional) to override default values - * @return int + * @return stdClass */ public function create_item_textarea($feedback, $record = array()) { global $DB, $CFG; @@ -437,7 +437,7 @@ class mod_feedback_generator extends testing_module_generator { * * @param object $feedback feedback record * @param array $record (optional) to override default values - * @return int + * @return stdClass */ public function create_item_textfield($feedback, $record = array()) { global $DB, $CFG; @@ -475,7 +475,7 @@ class mod_feedback_generator extends testing_module_generator { * Create pagebreak. * * @param object $feedback feedback record - * @return mixed false if there already is a pagebreak on last position or the id of the pagebreak-item + * @return int|false false if there already is a pagebreak on last position or the id of the pagebreak-item */ public function create_item_pagebreak($feedback) { global $CFG; diff --git a/mod/forum/classes/output/forum_post.php b/mod/forum/classes/output/forum_post.php index b3862879934..52c51bc8d8e 100644 --- a/mod/forum/classes/output/forum_post.php +++ b/mod/forum/classes/output/forum_post.php @@ -544,7 +544,7 @@ class forum_post implements \renderable, \templatable { * The date of the post, formatted according to the postto user's * preferences. * - * @return string. + * @return string */ public function get_postdate() { global $CFG; diff --git a/mod/forum/lib.php b/mod/forum/lib.php index aa2f40b3db5..d02c887f0d5 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1336,7 +1336,7 @@ function forum_get_user_involved_discussions($forumid, $userid) { * @global object * @param int $forumid * @param int $userid - * @return array of counts or false + * @return stdClass|false collection of counts or false */ function forum_count_user_posts($forumid, $userid) { global $CFG, $DB; @@ -5360,7 +5360,7 @@ function forum_reset_userdata($data) { /** * Called by course/reset.php * - * @param $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function forum_reset_course_form_definition(&$mform) { $mform->addElement('header', 'forumheader', get_string('modulenameplural', 'forum')); diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 003c1eccd17..c8bcafaefa5 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -1009,8 +1009,8 @@ function glossary_get_entries($glossaryid, $entrylist, $pivot = "") { /** * @global object * @global object - * @param object $concept - * @param string $courseid + * @param string $concept + * @param int $courseid * @return array */ function glossary_get_entries_search($concept, $courseid) { @@ -2791,7 +2791,7 @@ function glossary_get_post_actions() { /** * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the glossary. - * @param object $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function glossary_reset_course_form_definition(&$mform) { $mform->addElement('header', 'glossaryheader', get_string('modulenameplural', 'glossary')); diff --git a/mod/h5pactivity/lib.php b/mod/h5pactivity/lib.php index 84dcaa2781c..114abcdbf6b 100644 --- a/mod/h5pactivity/lib.php +++ b/mod/h5pactivity/lib.php @@ -242,7 +242,7 @@ function h5pactivity_rescale_activity_grades(stdClass $course, stdClass $cm, flo * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the H5P activity. * - * @param object $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function h5pactivity_reset_course_form_definition(&$mform): void { $mform->addElement('header', 'h5pactivityheader', get_string('modulenameplural', 'mod_h5pactivity')); diff --git a/mod/imscp/lib.php b/mod/imscp/lib.php index ad8b4efa260..17a2ad94b80 100644 --- a/mod/imscp/lib.php +++ b/mod/imscp/lib.php @@ -248,7 +248,7 @@ function imscp_get_file_areas($course, $cm, $context) { * * @package mod_imscp * @category files - * @param stdClass $browser file browser + * @param file_browser $browser file browser * @param stdClass $areas file areas * @param stdClass $course course object * @param stdClass $cm course module object diff --git a/mod/lesson/lib.php b/mod/lesson/lib.php index 9e48012c159..f651cdd09d4 100644 --- a/mod/lesson/lib.php +++ b/mod/lesson/lib.php @@ -832,7 +832,7 @@ function lesson_process_post_save(&$lesson) { * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the lesson. * - * @param $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function lesson_reset_course_form_definition(&$mform) { $mform->addElement('header', 'lessonheader', get_string('modulenameplural', 'lesson')); @@ -1181,7 +1181,7 @@ function lesson_get_file_areas() { * @package mod_lesson * @category files * @global stdClass $CFG - * @param file_browse $browser file browser instance + * @param file_browser $browser file browser instance * @param array $areas file areas * @param stdClass $course course object * @param stdClass $cm course module object diff --git a/mod/lesson/tests/generator/lib.php b/mod/lesson/tests/generator/lib.php index 53fcfa6a251..e41d07846e0 100644 --- a/mod/lesson/tests/generator/lib.php +++ b/mod/lesson/tests/generator/lib.php @@ -120,7 +120,7 @@ class mod_lesson_generator extends testing_module_generator { * Create True/false question pages. * @param object $lesson * @param array $record - * @return int + * @return \stdClass */ public function create_question_truefalse($lesson, $record = array()) { global $DB, $CFG; diff --git a/mod/lti/classes/local/ltiservice/resource_base.php b/mod/lti/classes/local/ltiservice/resource_base.php index 19fefa51081..f4bcb0823df 100644 --- a/mod/lti/classes/local/ltiservice/resource_base.php +++ b/mod/lti/classes/local/ltiservice/resource_base.php @@ -135,7 +135,7 @@ abstract class resource_base { /** * Get the resource's service. * - * @return mixed + * @return service_base */ public function get_service() { diff --git a/mod/page/lib.php b/mod/page/lib.php index bda4a4fd616..2aad2eceb1a 100644 --- a/mod/page/lib.php +++ b/mod/page/lib.php @@ -259,7 +259,7 @@ function page_get_file_areas($course, $cm, $context) { * * @package mod_page * @category files - * @param stdClass $browser file browser instance + * @param file_browser $browser file browser instance * @param stdClass $areas file areas * @param stdClass $course course object * @param stdClass $cm course module object diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index f68a84b821e..0f89d9403bc 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -417,7 +417,7 @@ function quiz_delete_all_attempts($quiz) { /** * Delete all the attempts belonging to a user in a particular quiz. * - * @param stdClass $quiz The quiz object. + * @param \mod_quiz\quiz_settings $quiz The quiz object. * @param stdClass $user The user object. */ function quiz_delete_user_attempts($quiz, $user) { @@ -1492,7 +1492,7 @@ function quiz_questions_in_use($questionids) { * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the quiz. * - * @param $mform the course reset form that is being built. + * @param MoodleQuickForm $mform the course reset form that is being built. */ function quiz_reset_course_form_definition($mform) { $mform->addElement('header', 'quizheader', get_string('modulenameplural', 'quiz')); diff --git a/mod/quiz/report/statistics/report.php b/mod/quiz/report/statistics/report.php index c99971496ae..d116ea32a44 100644 --- a/mod/quiz/report/statistics/report.php +++ b/mod/quiz/report/statistics/report.php @@ -762,7 +762,8 @@ class quiz_statistics_report extends report_base { * * @param int $lastcachetime the time the stats were last cached. * @param int $quizid the quiz id. - * @param array $groupstudentsjoins (joins, wheres, params) for students in the group or empty array if groups not used. + * @param \core\dml\sql_join $groupstudentsjoins (joins, wheres, params) for students in the group + * or empty array if groups not used. * @param string $whichattempts which attempts to use, represented internally as one of the constants as used in * $quiz->grademethod ie. * QUIZ_GRADEAVERAGE, QUIZ_GRADEHIGHEST, QUIZ_ATTEMPTLAST or QUIZ_ATTEMPTFIRST diff --git a/mod/resource/lib.php b/mod/resource/lib.php index 563d2422bc5..eee7f1e6db2 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -299,7 +299,7 @@ function resource_get_file_areas($course, $cm, $context) { * * @package mod_resource * @category files - * @param stdClass $browser file browser instance + * @param file_browser $browser file browser instance * @param stdClass $areas file areas * @param stdClass $course course object * @param stdClass $cm course module object diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index 43457071a11..ddd4864753a 100644 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -342,11 +342,10 @@ function scorm_delete_instance($id) { * user has done with a given particular instance of this module * Used for user activity reports. * - * @global stdClass - * @param int $course Course id - * @param int $user User id - * @param int $mod - * @param int $scorm The scorm id + * @param stdClass $course Course object + * @param stdClass $user User + * @param stdClass $mod + * @param stdClass $scorm The scorm * @return mixed */ function scorm_user_outline($course, $user, $mod, $scorm) { @@ -772,7 +771,7 @@ function scorm_option2text($scorm) { * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the scorm. * - * @param object $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function scorm_reset_course_form_definition(&$mform) { $mform->addElement('header', 'scormheader', get_string('modulenameplural', 'scorm')); diff --git a/mod/survey/lib.php b/mod/survey/lib.php index 3249aec2a85..e3cc8f9b004 100644 --- a/mod/survey/lib.php +++ b/mod/survey/lib.php @@ -395,7 +395,7 @@ function survey_get_user_answers($surveyid, $questionid, $groupid, $sort="sa.ans * @param int $surveyid * @param int $questionid * @param int $userid - * @return array + * @return stdClass|false */ function survey_get_user_answer($surveyid, $questionid, $userid) { global $DB; @@ -722,7 +722,7 @@ function survey_get_post_actions() { * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the survey. * - * @param object $mform form passed by reference + * @param MoodleQuickForm $mform form passed by reference */ function survey_reset_course_form_definition(&$mform) { $mform->addElement('header', 'surveyheader', get_string('modulenameplural', 'survey')); diff --git a/mod/url/classes/search/activity.php b/mod/url/classes/search/activity.php index c5baae213b5..3bcb01aad83 100644 --- a/mod/url/classes/search/activity.php +++ b/mod/url/classes/search/activity.php @@ -49,9 +49,9 @@ class activity extends \core_search\base_activity { * * Overwrites base_activity to add the provided URL as description. * - * @param stdClass $record + * @param \stdClass $record * @param array $options - * @return \core_search\document + * @return \core_search\document|false */ public function get_document($record, $options = array()) { $doc = parent::get_document($record, $options); diff --git a/mod/url/locallib.php b/mod/url/locallib.php index 03465793756..b3998efae91 100644 --- a/mod/url/locallib.php +++ b/mod/url/locallib.php @@ -75,7 +75,7 @@ function url_fix_submitted_url($url) { * * This function does not include any XSS protection. * - * @param string $url + * @param stdClass $url * @param object $cm * @param object $course * @param object $config diff --git a/mod/wiki/locallib.php b/mod/wiki/locallib.php index b4e123067fa..b06909e896e 100644 --- a/mod/wiki/locallib.php +++ b/mod/wiki/locallib.php @@ -509,6 +509,7 @@ function wiki_get_missing_or_empty_pages($swid) { * Get pages list in wiki * @param int $swid sub wiki id * @param string $sort How to sort the pages. By default, title ASC. + * @return stdClass[] */ function wiki_get_page_list($swid, $sort = 'title ASC') { global $DB; @@ -648,7 +649,7 @@ function wiki_parse_content($markup, $pagecontent, $options = array()) { * !!!!!! IMPORTANT !!!!!! * It is critical that you call format_string on the content before it is used. * - * @param string|page_wiki $link name of a page + * @param string|stdClass $link name of a page or page object. * @param array $options * @return array Array('content' => string, 'url' => string, 'new' => bool, 'link_info' => array) * diff --git a/mod/workshop/classes/privacy/provider.php b/mod/workshop/classes/privacy/provider.php index 828461d80a3..5bd88708192 100644 --- a/mod/workshop/classes/privacy/provider.php +++ b/mod/workshop/classes/privacy/provider.php @@ -293,7 +293,7 @@ class provider implements * his/her exported personal data. For example, we need to know what were the instructions for submissions or what * was the phase of the workshop when it was exported. * - * @param context $context Workshop module content. + * @param \context $context Workshop module content. * @param stdClass $user User for which we are exporting data. * @param stdClass $data Base data about the workshop instance to append to. * @param array $subcontext Subcontext path items to eventually write files into. diff --git a/privacy/classes/local/metadata/collection.php b/privacy/classes/local/metadata/collection.php index 0e7668ede3f..805f1265b80 100644 --- a/privacy/classes/local/metadata/collection.php +++ b/privacy/classes/local/metadata/collection.php @@ -44,7 +44,7 @@ class collection { protected $component; /** - * @var array The collection of metadata items. + * @var type[] The collection of metadata items. */ protected $collection = []; @@ -201,7 +201,7 @@ class collection { /** * The content of this collection. * - * @return types\type[] + * @return type[] */ public function get_collection() { return $this->collection; diff --git a/privacy/classes/local/request/writer.php b/privacy/classes/local/request/writer.php index ff04f3d495d..80d77ca281f 100644 --- a/privacy/classes/local/request/writer.php +++ b/privacy/classes/local/request/writer.php @@ -75,7 +75,7 @@ class writer { */ public static function setup_real_writer_instance() { if (!PHPUNIT_TEST) { - throw new coding_exception('setup_real_writer_instance() is only for use with PHPUnit tests.'); + throw new \coding_exception('setup_real_writer_instance() is only for use with PHPUnit tests.'); } $instance = static::instance(); diff --git a/privacy/classes/tests/request/content_writer.php b/privacy/classes/tests/request/content_writer.php index 3a8c64e7e30..3ad7c498869 100644 --- a/privacy/classes/tests/request/content_writer.php +++ b/privacy/classes/tests/request/content_writer.php @@ -231,7 +231,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * Get all data within the subcontext. * * @param array $subcontext The location within the current context that this data belongs. - * @return array The metadata as a series of keys to value + descrition objects. + * @return \stdClass|array The metadata as a series of keys to value + description objects. */ public function get_data(array $subcontext = []) { return $this->fetch_data_root($this->data, $subcontext); @@ -263,7 +263,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * Get all metadata within the subcontext. * * @param array $subcontext The location within the current context that this data belongs. - * @return array The metadata as a series of keys to value + descrition objects. + * @return \stdClass|array The metadata as a series of keys to value + description objects. */ public function get_all_metadata(array $subcontext = []) { return $this->fetch_data_root($this->metadata, $subcontext); @@ -275,7 +275,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 string $key The metadata to be fetched within the context + subcontext. * @param boolean $valueonly Whether to fetch only the value, rather than the value + description. - * @return array The metadata as a series of keys to value + descrition objects. + * @return \stdClass|array|null The metadata as a series of keys to value + description objects. */ public function get_metadata(array $subcontext, $key, $valueonly = true) { $keys = $this->get_all_metadata($subcontext); @@ -312,7 +312,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 string $filename The name of the intended filename. - * @return array The metadata as a series of keys to value + descrition objects. + * @return \stdClass|array The metadata as a series of keys to value + description objects. */ public function get_related_data(array $subcontext = [], $filename = null) { $current = $this->fetch_data_root($this->relateddata, $subcontext); @@ -510,7 +510,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * @param \stdClass $base The base to use - e.g. $this->data * @param array $subcontext The subcontext to fetch * @param int $temporarycontextid A temporary context ID to use for the fetch. - * @return array + * @return \stdClass|array */ protected function fetch_root($base, $subcontext, $temporarycontextid = null) { $contextid = !empty($temporarycontextid) ? $temporarycontextid : $this->context->id; @@ -540,7 +540,7 @@ class content_writer implements \core_privacy\local\request\content_writer { * * @param \stdClass $base The base to use - e.g. $this->data * @param array $subcontext The subcontext to fetch - * @return array + * @return \stdClass|array */ protected function fetch_data_root($base, $subcontext) { $root = $this->fetch_root($base, $subcontext); diff --git a/question/bank/customfields/classes/customfield/question_handler.php b/question/bank/customfields/classes/customfield/question_handler.php index 14a5ab2142c..71a907a77f7 100644 --- a/question/bank/customfields/classes/customfield/question_handler.php +++ b/question/bank/customfields/classes/customfield/question_handler.php @@ -125,7 +125,7 @@ class question_handler extends \core_customfield\handler { * Used primarily in showing or not the field in the question bank table. * * @param field_controller $field The field trying to be viewed. - * @param context $context The context the field is being displayed in. + * @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 { diff --git a/question/classes/engine/variants/least_used_strategy.php b/question/classes/engine/variants/least_used_strategy.php index 346174c62ae..779f88c7709 100644 --- a/question/classes/engine/variants/least_used_strategy.php +++ b/question/classes/engine/variants/least_used_strategy.php @@ -50,8 +50,8 @@ class least_used_strategy implements \question_variant_selection_strategy { /** * Constructor. - * @param question_usage_by_activity $quba the question usage we will be picking variants for. - * @param qubaid_condition $qubaids ids of the usages to consider when counting previous uses of each variant. + * @param \question_usage_by_activity $quba the question usage we will be picking variants for. + * @param \qubaid_condition $qubaids ids of the usages to consider when counting previous uses of each variant. */ public function __construct(\question_usage_by_activity $quba, \qubaid_condition $qubaids) { $questionidtoseed = array(); diff --git a/rating/classes/phpunit/privacy_helper.php b/rating/classes/phpunit/privacy_helper.php index 329d5054e34..b9f14024405 100644 --- a/rating/classes/phpunit/privacy_helper.php +++ b/rating/classes/phpunit/privacy_helper.php @@ -42,7 +42,7 @@ trait privacy_helper { * * @param \context $context The context being stored. * @param array $subcontext The subcontext path to check. - * @return array + * @return \stdClass|array */ protected function get_ratings_on_subcontext(\context $context, array $subcontext) { $writer = \core_privacy\local\request\writer::with_context($context); diff --git a/rating/lib.php b/rating/lib.php index a7339d25d15..d20191d7ff8 100644 --- a/rating/lib.php +++ b/rating/lib.php @@ -46,7 +46,7 @@ define ('RATING_DEFAULT_SCALE', 5); class rating implements renderable { /** - * @var stdClass The context in which this rating exists + * @var context The context in which this rating exists */ public $context; diff --git a/repository/lib.php b/repository/lib.php index 1a66a017a42..f10d82e1912 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -519,7 +519,7 @@ abstract class repository implements cacheable_object { public $disabled = false; /** @var int repository instance id */ public $id; - /** @var stdClass current context */ + /** @var context current context */ public $context; /** @var array repository options */ public $options; @@ -2307,7 +2307,7 @@ abstract class repository implements cacheable_object { * format and stores formatted values. * * @param array|stdClass $listing result of get_listing() or search() or file_get_drafarea_files() - * @return array + * @return stdClass */ public static function prepare_listing($listing) { $wasobject = false; @@ -2425,7 +2425,7 @@ abstract class repository implements cacheable_object { /** * Edit/Create Admin Settings Moodle form * - * @param moodleform $mform Moodle form (passed by reference) + * @param MoodleQuickForm $mform Moodle form (passed by reference) * @param string $classname repository class name */ public static function type_config_form($mform, $classname = 'repository') { @@ -3118,12 +3118,12 @@ final class repository_type_form extends moodleform { /** * Generate all options needed by filepicker * - * @param array $args including following keys + * @param stdClass $args including following keys * context * accepted_types * return_types * - * @return array the list of repository instances, including meta infomation, containing the following keys + * @return stdClass the list of repository instances, including meta infomation, containing the following keys * externallink * repositories * accepted_types diff --git a/repository/recent/tests/lib_test.php b/repository/recent/tests/lib_test.php index 7038b493d4e..270e1f841aa 100644 --- a/repository/recent/tests/lib_test.php +++ b/repository/recent/tests/lib_test.php @@ -46,7 +46,7 @@ class lib_test extends \advanced_testcase { /** @var repository Recent repository */ private $repo; - /** @var context repository */ + /** @var \context repository */ private $usercontext; /** @@ -170,7 +170,7 @@ class lib_test extends \advanced_testcase { * @param string $filename file name * @param string $filearea file area * @param int $itemid item id - * @return stored_file the newly created file + * @return \stored_file the newly created file */ private function create_test_file($filename, $filearea, $itemid = 0) { global $USER; @@ -192,11 +192,11 @@ class lib_test extends \advanced_testcase { /** * Create reference file * - * @param stored_file $file source file + * @param \stored_file $file source file * @param string $filename file name * @param string $filearea file area * @param int $itemid item id - * @return stored_file the newly created file + * @return \stored_file the newly created file */ private function create_reference_file($file, $filename, $filearea, $itemid = 0) { global $USER, $DB; diff --git a/repository/tests/privacy/provider_test.php b/repository/tests/privacy/provider_test.php index 85dcd5a5356..d6b4b845663 100644 --- a/repository/tests/privacy/provider_test.php +++ b/repository/tests/privacy/provider_test.php @@ -263,7 +263,6 @@ class provider_test extends \core_privacy\tests\provider_testcase { * * @param int $userid The Id of the User used for testing. * @param int $noscenarios The number of repository_instance records to create for the User. - * @throws dml_exception */ private function setup_test_scenario_data($userid, $noscenarios) { global $DB; diff --git a/search/classes/base_activity.php b/search/classes/base_activity.php index 66ea4e1cca2..713fa6d813c 100644 --- a/search/classes/base_activity.php +++ b/search/classes/base_activity.php @@ -81,7 +81,7 @@ abstract class base_activity extends base_mod { * content. Any activity can overwrite this function if it is interested in setting other fields than the * default ones, or to fill description optional fields with extra stuff. * - * @param stdClass $record + * @param \stdClass $record * @param array $options * @return \core_search\document */ diff --git a/search/engine/simpledb/tests/engine_test.php b/search/engine/simpledb/tests/engine_test.php index 01e4e8d22cf..22fdc0ff59e 100644 --- a/search/engine/simpledb/tests/engine_test.php +++ b/search/engine/simpledb/tests/engine_test.php @@ -43,7 +43,7 @@ class engine_test extends \advanced_testcase { protected $engine = null; /** - * @var core_search_generator + * @var \core_search_generator */ protected $generator = null; @@ -337,8 +337,6 @@ class engine_test extends \advanced_testcase { /** * Tries out deleting data for a context or a course. - * - * @throws moodle_exception */ public function test_deleted_contexts_and_courses() { // Create some courses and activities. @@ -375,7 +373,6 @@ class engine_test extends \advanced_testcase { * * @param string $searchword Word to match within the content field * @param string[] $expected Array of expected result titles, in alphabetical order - * @throws dml_exception */ protected function assert_raw_index_contents(string $searchword, array $expected) { global $DB; diff --git a/search/engine/solr/tests/engine_test.php b/search/engine/solr/tests/engine_test.php index 97b505869c7..7b52d2c97c7 100644 --- a/search/engine/solr/tests/engine_test.php +++ b/search/engine/solr/tests/engine_test.php @@ -1287,9 +1287,6 @@ class engine_test extends \advanced_testcase { /** * Tries out deleting data for a context or a course. - * - * @throws coding_exception - * @throws moodle_exception */ public function test_deleted_contexts_and_courses() { // Create some courses and activities. diff --git a/search/tests/base_activity_test.php b/search/tests/base_activity_test.php index 544b7c1f3bf..ebd615e48d8 100644 --- a/search/tests/base_activity_test.php +++ b/search/tests/base_activity_test.php @@ -36,7 +36,7 @@ class base_activity_test extends \advanced_testcase { protected $search = null; /** - * @var Instace of core_search_generator. + * @var \core_search_generator Instace of core_search_generator. */ protected $generator = null; @@ -45,10 +45,10 @@ class base_activity_test extends \advanced_testcase { */ protected $engine = null; - /** @var context[] Array of test contexts */ + /** @var \context[] Array of test contexts */ protected $contexts; - /** @var stdClass[] Array of test forum objects */ + /** @var \stdClass[] Array of test forum objects */ protected $forums; public function setUp(): void { @@ -256,7 +256,7 @@ class base_activity_test extends \advanced_testcase { /** * Utility function to convert recordset to array for testing. * - * @param moodle_recordset $rs Recordset to convert + * @param \moodle_recordset $rs Recordset to convert * @return array Array indexed by number (0, 1, 2, ...) */ protected static function recordset_to_indexed_array(\moodle_recordset $rs) { diff --git a/search/tests/base_block_test.php b/search/tests/base_block_test.php index c802fb28777..7ce367c960b 100644 --- a/search/tests/base_block_test.php +++ b/search/tests/base_block_test.php @@ -216,7 +216,7 @@ class base_block_test extends \advanced_testcase { /** * Utility function to convert recordset to array for testing. * - * @param moodle_recordset $rs Recordset to convert + * @param \moodle_recordset $rs Recordset to convert * @return array Array indexed by number (0, 1, 2, ...) */ protected static function recordset_to_indexed_array(\moodle_recordset $rs) { diff --git a/search/tests/top_result_test.php b/search/tests/top_result_test.php index 9fda6cf16c7..7a69a8f846d 100644 --- a/search/tests/top_result_test.php +++ b/search/tests/top_result_test.php @@ -16,6 +16,8 @@ namespace core_search; +use stdClass; + defined('MOODLE_INTERNAL') || die(); global $CFG; diff --git a/tag/classes/tests/privacy_helper.php b/tag/classes/tests/privacy_helper.php index cba779bd291..0ffe6f0dd6c 100644 --- a/tag/classes/tests/privacy_helper.php +++ b/tag/classes/tests/privacy_helper.php @@ -42,7 +42,7 @@ trait privacy_helper { * * @param \context $context The context being stored. * @param array $subcontext The subcontext path to check. - * @return array + * @return \stdClass|array */ protected function get_tags_on_subcontext(\context $context, array $subcontext) { $writer = \core_privacy\local\request\writer::with_context($context); diff --git a/tag/tests/taglib_test.php b/tag/tests/taglib_test.php index 91a4681c593..1cc7f127592 100644 --- a/tag/tests/taglib_test.php +++ b/tag/tests/taglib_test.php @@ -1977,8 +1977,8 @@ class taglib_test extends \advanced_testcase { * @param string $component * @param string $itemtype * @param int $itemid - * @param context $context - * @return stdClass + * @param \context $context + * @return \stdClass */ protected function add_tag_instance(core_tag_tag $tag, $component, $itemtype, $itemid, $context) { global $DB; diff --git a/user/classes/output/myprofile/manager.php b/user/classes/output/myprofile/manager.php index d3064250344..559692fbe55 100644 --- a/user/classes/output/myprofile/manager.php +++ b/user/classes/output/myprofile/manager.php @@ -37,7 +37,7 @@ class manager { /** * Parse all callbacks and builds the tree. * - * @param integer $user ID of the user for which the profile is displayed. + * @param \stdClass $user user for which the profile is displayed. * @param bool $iscurrentuser true if the profile being viewed is of current user, else false. * @param \stdClass $course Course object * diff --git a/user/editlib.php b/user/editlib.php index 92e829ef857..e02ad6617cf 100644 --- a/user/editlib.php +++ b/user/editlib.php @@ -244,7 +244,7 @@ function useredit_update_interests($user, $interests) { /** * Powerful function that is used by edit and editadvanced to add common form elements/rules/etc. * - * @param moodleform $mform + * @param MoodleQuickForm $mform * @param array $editoroptions * @param array $filemanageroptions * @param stdClass $user diff --git a/user/externallib.php b/user/externallib.php index 8a6e8e0acc2..84127412756 100644 --- a/user/externallib.php +++ b/user/externallib.php @@ -1112,7 +1112,7 @@ class core_user_external extends \core_external\external_api { * Create user return value description. * * @param array $additionalfields some additional field - * @return single_structure_description + * @return external_description */ public static function user_description($additionalfields = array()) { $userfields = array( diff --git a/user/lib.php b/user/lib.php index 2ab18a227cd..cb801303d88 100644 --- a/user/lib.php +++ b/user/lib.php @@ -33,7 +33,7 @@ define('USER_FILTER_STRING', 6); * Creates a user * * @throws moodle_exception - * @param stdClass $user user to create + * @param stdClass|array $user user to create * @param bool $updatepassword if true, authentication plugin will update password. * @param bool $triggerevent set false if user_created event should not be triggred. * This will not affect user_password_updated event triggering. @@ -144,7 +144,7 @@ function user_create_user($user, $updatepassword = true, $triggerevent = true) { * Update a user with a user object (will compare against the ID) * * @throws moodle_exception - * @param stdClass $user the user to update + * @param stdClass|array $user the user to update * @param bool $updatepassword if true, authentication plugin will update password. * @param bool $triggerevent set false if user_updated event should not be triggred. * This will not affect user_password_updated event triggering. @@ -1321,7 +1321,7 @@ function user_get_lastaccess_sql($columnname, $accesssince, $tableprefix, $havea * @param string $itemtype - Only user_roles is supported. * @param string $itemid - Courseid and userid separated by a : * @param string $newvalue - json encoded list of roleids. - * @return \core\output\inplace_editable + * @return \core\output\inplace_editable|null */ function core_user_inplace_editable($itemtype, $itemid, $newvalue) { if ($itemtype === 'user_roles') { diff --git a/user/profile/field/social/define.class.php b/user/profile/field/social/define.class.php index 61a02fc4b8e..283da7cd4ed 100644 --- a/user/profile/field/social/define.class.php +++ b/user/profile/field/social/define.class.php @@ -33,7 +33,7 @@ class profile_define_social extends profile_define_base { /** * Prints out the form snippet for the part of creating or editing a profile field common to all data types. * - * @param moodleform $form instance of the moodleform class + * @param MoodleQuickForm $form instance of the moodleform class */ public function define_form_common(&$form) { $availablenetworks = profilefield_social\helper::get_networks(); @@ -53,7 +53,7 @@ class profile_define_social extends profile_define_base { /** * Alter form based on submitted or existing data. * - * @param moodleform $form + * @param MoodleQuickForm $form */ public function define_after_data(&$form) { if (isset($form->_defaultValues['name'])) { diff --git a/user/tests/group_non_members_selector_test.php b/user/tests/group_non_members_selector_test.php index 46e07a01e7b..04524a72cdc 100644 --- a/user/tests/group_non_members_selector_test.php +++ b/user/tests/group_non_members_selector_test.php @@ -35,8 +35,6 @@ class group_non_members_selector_test extends \advanced_testcase { /** * Test find_users that only return group non members - * - * @throws coding_exception */ public function test_find_users_only_return_group_non_member() { $this->resetAfterTest(); diff --git a/user/tests/privacy/provider_test.php b/user/tests/privacy/provider_test.php index ffba864a7b4..a908701a4b7 100644 --- a/user/tests/privacy/provider_test.php +++ b/user/tests/privacy/provider_test.php @@ -405,8 +405,8 @@ class provider_test extends provider_testcase { /** * Create user data for a user. * - * @param stdClass $user A user object. - * @param stdClass $course A course. + * @param \stdClass $user A user object. + * @param \stdClass $course A course. */ protected function create_data_for_user($user, $course) { global $DB; diff --git a/webservice/rest/tests/server_test.php b/webservice/rest/tests/server_test.php index 3d7c47d5602..e1b781b1faa 100644 --- a/webservice/rest/tests/server_test.php +++ b/webservice/rest/tests/server_test.php @@ -201,7 +201,7 @@ class server_test extends \advanced_testcase { /** * @dataProvider xmlize_provider - * @param external_description $description The data structure. + * @param \core_external\external_description $description The data structure. * @param mixed $value The value to xmlise. * @param mixed $expected The expected output. */ diff --git a/webservice/soap/locallib.php b/webservice/soap/locallib.php index 593f2d9c288..3b10ee4a30f 100644 --- a/webservice/soap/locallib.php +++ b/webservice/soap/locallib.php @@ -139,6 +139,7 @@ class webservice_soap_server extends webservice_base_server { 'function' => 'unknown' ) ); + /** @var \core\event\webservice_function_called $event */ $event = \core\event\webservice_function_called::create($params); $event->trigger(); diff --git a/webservice/tests/helpers.php b/webservice/tests/helpers.php index 8d0f2c2c131..025da61c34f 100644 --- a/webservice/tests/helpers.php +++ b/webservice/tests/helpers.php @@ -30,7 +30,7 @@ abstract class externallib_advanced_testcase extends advanced_testcase { * The function creates a student $USER if $USER->id is empty * * @param string $capability capability name - * @param int $contextid + * @param int|context $contextid * @param int $roleid * @return int the role id - mainly returned for creation, so calling function can reuse it */ diff --git a/webservice/tests/lib_test.php b/webservice/tests/lib_test.php index 287485ffacf..4ebc79801a7 100644 --- a/webservice/tests/lib_test.php +++ b/webservice/tests/lib_test.php @@ -146,8 +146,6 @@ class lib_test extends \advanced_testcase { /** * Tests update_token_lastaccess() function. - * - * @throws dml_exception */ public function test_update_token_lastaccess() { global $DB; @@ -286,7 +284,7 @@ class lib_test extends \advanced_testcase { $user = $this->getDataGenerator()->create_user(); - /** @var core_webservice_generator $generator */ + /** @var \core_webservice_generator $generator */ $generator = $this->getDataGenerator()->get_plugin_generator('core_webservice'); $service = $generator->create_service(['name' => 'My test service', 'shortname' => 'mytestservice']); @@ -416,7 +414,7 @@ class webservice_dummy extends \webservice_base_server { /** * Send the error information to the WS client. * - * @param exception $ex + * @param \Exception $ex */ protected function send_error($ex = null) { // Just a method stub. No need to implement at the moment since it's not really being used for this test case for now.