MDL-74465 blocks: improve phpdocs

This commit is contained in:
Marina Glancy 2023-02-28 15:22:25 +00:00
parent f7a8df253b
commit 854dd65966
3 changed files with 10 additions and 9 deletions

View file

@ -289,7 +289,7 @@ class block_edit_form extends moodleform {
/** /**
* Override this to create any form fields specific to this type of block. * Override this to create any form fields specific to this type of block.
* @param object $mform the form being built. * @param \MoodleQuickForm $mform the form being built.
*/ */
protected function specific_definition($mform) { protected function specific_definition($mform) {
// By default, do nothing. // By default, do nothing.

View file

@ -71,13 +71,13 @@ class block_base {
/** /**
* An object to contain the information to be displayed in the block. * An object to contain the information to be displayed in the block.
* @var stdObject $content * @var stdClass $content
*/ */
var $content = NULL; var $content = NULL;
/** /**
* The initialized instance of this block object. * The initialized instance of this block object.
* @var block $instance * @var stdClass $instance
*/ */
var $instance = NULL; var $instance = NULL;
@ -89,13 +89,13 @@ class block_base {
/** /**
* This blocks's context. * This blocks's context.
* @var stdClass * @var context
*/ */
public $context = NULL; public $context = NULL;
/** /**
* An object containing the instance configuration information for the current instance of this block. * An object containing the instance configuration information for the current instance of this block.
* @var stdObject $config * @var stdClass $config
*/ */
var $config = NULL; var $config = NULL;
@ -462,7 +462,7 @@ class block_base {
* table and the current page. (See {@link block_manager::load_blocks()}.) * table and the current page. (See {@link block_manager::load_blocks()}.)
* *
* @param stdClass $instance data from block_insances, block_positions, etc. * @param stdClass $instance data from block_insances, block_positions, etc.
* @param moodle_page $the page this block is on. * @param moodle_page $page the page this block is on.
*/ */
function _load_instance($instance, $page) { function _load_instance($instance, $page) {
if (!empty($instance->configdata)) { if (!empty($instance->configdata)) {

View file

@ -1295,8 +1295,8 @@ class block_manager {
* Get the appropriate list of editing icons for a block. This is used * Get the appropriate list of editing icons for a block. This is used
* to set {@link block_contents::$controls} in {@link block_base::get_contents_for_output()}. * to set {@link block_contents::$controls} in {@link block_base::get_contents_for_output()}.
* *
* @param $output The core_renderer to use when generating the output. (Need to get icon paths.) * @param block_base $block
* @return an array in the format for {@link block_contents::$controls} * @return array an array in the format for {@link block_contents::$controls}
*/ */
public function edit_controls($block) { public function edit_controls($block) {
global $CFG; global $CFG;
@ -2081,7 +2081,7 @@ function block_instance_by_id($blockinstanceid) {
* Creates a new instance of the specified block class. * Creates a new instance of the specified block class.
* *
* @param string $blockname the name of the block. * @param string $blockname the name of the block.
* @param $instance block_instances DB table row (optional). * @param stdClass $instance block_instances DB table row (optional).
* @param moodle_page $page the page this block is appearing on. * @param moodle_page $page the page this block is appearing on.
* @return block_base the requested block instance. * @return block_base the requested block instance.
*/ */
@ -2090,6 +2090,7 @@ function block_instance($blockname, $instance = NULL, $page = NULL) {
return false; return false;
} }
$classname = 'block_'.$blockname; $classname = 'block_'.$blockname;
/** @var block_base $retval */
$retval = new $classname; $retval = new $classname;
if($instance !== NULL) { if($instance !== NULL) {
if (is_null($page)) { if (is_null($page)) {