Skip to content

Commit

Permalink
MDL-77164 various: fix incorrect phpdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Apr 13, 2023
1 parent 4d765cd commit 8fc1486
Show file tree
Hide file tree
Showing 327 changed files with 644 additions and 533 deletions.
4 changes: 1 addition & 3 deletions admin/presets/classes/local/setting/adminpresets_setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function set_attribute_value($name, $value) {
/**
* 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.
Expand Down Expand Up @@ -209,8 +209,6 @@ public function save_attributes_values() {
* @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.
Expand Down
3 changes: 2 additions & 1 deletion admin/presets/classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ public function get_site_settings(): array {
* @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;
Expand Down
2 changes: 1 addition & 1 deletion admin/presets/classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function export_user_data(approved_contextlist $contextlist) {
/**
* 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.
Expand Down
5 changes: 2 additions & 3 deletions admin/roles/classes/allow_view_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ protected function set_allow($fromroleid, $targetroleid) {

/**
* 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;
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/admin_presets/classes/local/action/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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. **/
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/analytics/classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static function potential_contexts(?string $query = null, ?int $modelid =
* 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(
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/analytics/classes/output/restorable_models.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(array $models) {
/**
* 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) {
Expand Down
1 change: 0 additions & 1 deletion admin/tool/brickfield/classes/brickfieldconnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ protected function get_registration_id_for_credentials(string $apikey = null, st
/**
* Get the check registration API URI.
* @return string
* @throws dml_exception
*/
protected function get_baseapiuri(): string {
$baseapiuri = get_config(manager::PLUGINNAME, 'baseapiuri');
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/brickfield/classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ public static function store_result_summary(int $courseid = null) {
* 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;
Expand Down
4 changes: 3 additions & 1 deletion admin/tool/dataprivacy/classes/metadata_registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
namespace tool_dataprivacy;

use core_privacy\local\metadata\types\type;

defined('MOODLE_INTERNAL') || die();

/**
Expand Down Expand Up @@ -114,7 +116,7 @@ public function get_registry_metadata() {
/**
* 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.
Expand Down
1 change: 1 addition & 0 deletions admin/tool/log/classes/plugininfo/logstore.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public function get_settings_section_name() {

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();

Expand Down
3 changes: 2 additions & 1 deletion admin/tool/lp/classes/external.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
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;
Expand Down Expand Up @@ -109,7 +110,7 @@ public static function data_for_competency_frameworks_manage_page_parameters() {
/**
* 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) {
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/lp/classes/output/manage_competencies_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/lp/classes/output/user_competency_summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct(user_competency $usercompetency, array $related = ar
* Export the data.
*
* @param renderer_base $output
* @return stdClass
* @return \stdClass
*/
public function export_for_template(renderer_base $output) {
if (!isset($related['user'])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
*/
class user_competency_summary_in_plan implements renderable, templatable {

/** @var competencyid */
/** @var int competencyid */
protected $competencyid;

/** @var planid */
/** @var int planid */
protected $planid;

/**
Expand All @@ -58,8 +58,8 @@ public function __construct($competencyid, $planid) {
/**
* 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;
Expand Down
26 changes: 13 additions & 13 deletions admin/tool/usertours/classes/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -88,7 +88,7 @@ public static function get_edit_step_link($tourid, $stepid = null, $targettype =
* @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');
Expand All @@ -107,7 +107,7 @@ public static function get_move_tour_link($tourid, $direction = self::MOVE_DOWN)
* @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');
Expand All @@ -126,7 +126,7 @@ public static function get_move_step_link($stepid, $direction = self::MOVE_DOWN)
* @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');
Expand All @@ -141,7 +141,7 @@ public static function get_new_step_link($tourid, $targettype = null) {
* 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', [
Expand All @@ -154,7 +154,7 @@ public static function get_view_tour_link($tourid) {
* 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', [
Expand All @@ -168,7 +168,7 @@ public static function get_reset_tour_for_all_link($tourid) {
* 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');
Expand All @@ -186,7 +186,7 @@ public static function get_edit_tour_link($tourid = null) {
/**
* 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', [
Expand All @@ -200,7 +200,7 @@ public static function get_import_tour_link() {
* 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', [
Expand All @@ -215,7 +215,7 @@ public static function get_export_tour_link($tourid) {
* 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', [
Expand All @@ -230,7 +230,7 @@ public static function get_duplicate_tour_link($tourid) {
* 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', [
Expand All @@ -243,7 +243,7 @@ public static function get_delete_tour_link($tourid) {
/**
* 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');
Expand Down Expand Up @@ -295,7 +295,7 @@ public static function get_filler_icon($options = array()) {
* 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', [
Expand Down
12 changes: 6 additions & 6 deletions admin/tool/usertours/classes/step.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public function set_sortorder($value) {
/**
* 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);
Expand All @@ -397,7 +397,7 @@ public function get_moveup_link() {
/**
* 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);
Expand Down Expand Up @@ -464,7 +464,7 @@ public function set_config($key, $value) {
/**
* 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);
Expand All @@ -473,7 +473,7 @@ public function get_edit_link() {
/**
* 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);
Expand Down Expand Up @@ -674,7 +674,7 @@ public static function get_config_keys() {
/**
* 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) {
Expand All @@ -694,7 +694,7 @@ public function add_config_to_form(\MoodleQuickForm $mform) {
/**
* 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
*/
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/usertours/classes/tour.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public function set_endtourlabel(string $value): 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);
Expand All @@ -376,7 +376,7 @@ public function get_view_link() {
/**
* 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);
Expand Down
2 changes: 1 addition & 1 deletion auth/db/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ function get_userlist() {
* 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));
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/restore_plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 8fc1486

Please sign in to comment.