MDL-77350 blocks: Added class properties that are not declared

In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
This commit is contained in:
Meirza 2023-01-19 22:11:11 +07:00
parent 2fb9f3ab02
commit 078055a51f
4 changed files with 33 additions and 3 deletions

View File

@ -35,6 +35,9 @@ class block_glossary_random extends block_base {
*/
protected $glossarycm = null;
/** @var stdClass course data. */
public $course;
function init() {
$this->title = get_string('pluginname','block_glossary_random');
}

View File

@ -855,9 +855,6 @@ class block_tree extends block_list {
$this->get_required_javascript();
$this->get_content();
$content = $output->tree_block_contents($this->content->items,array('class'=>'block_tree list'));
if (isset($this->id) && !is_numeric($this->id)) {
$content = $output->box($content, 'block_tree_box', $this->id);
}
return $content;
}
}

View File

@ -152,6 +152,9 @@ class main implements renderable, templatable {
*/
private $customfieldvalue;
/** @var bool true if grouping selector should be shown, otherwise false. */
protected $displaygroupingselector;
/**
* main constructor.
* Initialize the user preferences

View File

@ -32,6 +32,33 @@ require_once($CFG->dirroot . '/mod/assign/tests/generator.php');
class observer_test extends \advanced_testcase {
use \mod_assign_test_generator;
/** @var string Table name. */
protected $table;
/** @var \stdClass course data. */
protected $course;
/** @var \stdClass student data. */
protected $student;
/** @var \stdClass teacher data. */
protected $teacher;
/** @var \stdClass student role. */
protected $studentrole;
/** @var \stdClass teacher role. */
protected $teacherrole;
/** @var \stdClass course forum. */
protected $forum;
/** @var \stdClass course glossary. */
protected $glossary;
/** @var \stdClass course chat. */
protected $chat;
/**
* Set up for every test
*/