Skip to content

Commit

Permalink
MDL-77350 search: Added class properties that are not declared
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
meirzamoodle committed May 15, 2023
1 parent 4fbb4f5 commit f0aa52f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
7 changes: 7 additions & 0 deletions search/classes/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ abstract class base {
*/
protected static $levels = [CONTEXT_SYSTEM];

/**
* An area id from the componentname and the area name.
*
* @var string
*/
public $areaid;

/**
* Constructor.
*
Expand Down
3 changes: 3 additions & 0 deletions search/classes/base_activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ abstract class base_activity extends base_mod {
*/
protected static $levels = [CONTEXT_MODULE];

/** @var array activity data instance. */
public $activitiesdata = [];

/**
* Returns recordset containing all activities within the given context.
*
Expand Down
27 changes: 27 additions & 0 deletions search/engine/simpledb/tests/privacy/provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,33 @@
*/
class provider_test extends \core_privacy\tests\provider_testcase {

/** @var \search_simpledb\engine database engine. */
protected $engine;

/** @var \testable_core_search core search class adapted to unit test. */
protected $search;

/** @var \core_search_generator core search generator class adapted to unit test. */
protected $generator = null;

/** @var \stdClass course record.*/
protected $c1;

/** @var \stdClass course record.*/
protected $c2;

/** @var \context_course context instance. */
protected $c1context;

/** @var \context_course context instance. */
protected $c2context;

/** @var \stdClass user record. */
protected $u1;

/** @var \stdClass user record. */
protected $u2;

public function setUp(): void {
global $DB;

Expand Down
3 changes: 3 additions & 0 deletions search/tests/fixtures/mock_search_engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class engine extends \core_search\engine {
/** @var array Schema updates applied */
protected $schemaupdates = [];

/** @var array delete of course index. */
protected $deletes = [];

public function is_installed() {
return true;
}
Expand Down

0 comments on commit f0aa52f

Please sign in to comment.