From 94bda235325f735c3fe6fa1b338f99c8bd317264 Mon Sep 17 00:00:00 2001 From: Meirza Date: Thu, 9 Feb 2023 08:46:55 +0700 Subject: [PATCH] MDL-77350 report: 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. --- report/competency/classes/output/report.php | 2 ++ report/infectedfiles/classes/table/infectedfiles_table.php | 4 ++++ report/log/user.php | 4 ---- report/outline/tests/lib_test.php | 1 - report/participation/index.php | 1 - report/progress/tests/report_progress_helper_testcase.php | 3 +++ 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/report/competency/classes/output/report.php b/report/competency/classes/output/report.php index d7926053258..6527b013b1b 100644 --- a/report/competency/classes/output/report.php +++ b/report/competency/classes/output/report.php @@ -55,6 +55,8 @@ class report implements renderable, templatable { protected $moduleid; /** @var array $competencies */ protected $competencies; + /** @var int The user id */ + protected $userid; /** * Construct this renderable. diff --git a/report/infectedfiles/classes/table/infectedfiles_table.php b/report/infectedfiles/classes/table/infectedfiles_table.php index 358e9d8c45f..8e3fee288cd 100644 --- a/report/infectedfiles/classes/table/infectedfiles_table.php +++ b/report/infectedfiles/classes/table/infectedfiles_table.php @@ -37,6 +37,10 @@ require_once($CFG->libdir . '/tablelib.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class infectedfiles_table extends \table_sql implements \renderable { + + /** @var int current page. */ + protected $page; + /** * Table constructor * diff --git a/report/log/user.php b/report/log/user.php index 4bd72c61435..103f3f659eb 100644 --- a/report/log/user.php +++ b/report/log/user.php @@ -137,10 +137,6 @@ if (!empty($reportlog->selectedlogreader)) { echo $output->reader_selector($reportlog); -if ($mode === 'all') { - $reportlog->selecteddate = 0; -} - // Print the graphic chart accordingly to the mode (all, today). echo '
'; report_log_print_graph($course, $user, $mode, 0, $logreader); diff --git a/report/outline/tests/lib_test.php b/report/outline/tests/lib_test.php index ecd938e57d9..5a3d16989be 100644 --- a/report/outline/tests/lib_test.php +++ b/report/outline/tests/lib_test.php @@ -63,7 +63,6 @@ class lib_test extends \advanced_testcase { public function setUp(): void { $this->user = $this->getDataGenerator()->create_user(); - $this->user2 = $this->getDataGenerator()->create_user(); $this->course = $this->getDataGenerator()->create_course(); $this->tree = new \core_user\output\myprofile\tree(); $this->coursecontext = \context_course::instance($this->course->id); diff --git a/report/participation/index.php b/report/participation/index.php index 6683087ee89..08eb85e71d5 100644 --- a/report/participation/index.php +++ b/report/participation/index.php @@ -147,7 +147,6 @@ if (!empty($instanceid) && !empty($roleid)) { } $table = new flexible_table('course-participation-'.$course->id.'-'.$cm->id.'-'.$roleid); - $table->course = $course; $actionheader = !empty($action) ? get_string($action) : get_string('allactions'); diff --git a/report/progress/tests/report_progress_helper_testcase.php b/report/progress/tests/report_progress_helper_testcase.php index 3360f35b6d2..02bce7c70dd 100644 --- a/report/progress/tests/report_progress_helper_testcase.php +++ b/report/progress/tests/report_progress_helper_testcase.php @@ -32,6 +32,9 @@ defined('MOODLE_INTERNAL') || die(); */ class report_progress_helper_testcase extends advanced_testcase { + /** @var testing_data_generator data generator.*/ + protected $generator; + /** * Set up testcase. */