diff --git a/admin/webservice/tokens.php b/admin/webservice/tokens.php index 5f4e0875df2..cd9903c5f35 100644 --- a/admin/webservice/tokens.php +++ b/admin/webservice/tokens.php @@ -168,7 +168,6 @@ foreach ($filterdata->services as $i => $serviceid) { $table->define_baseurl($baseurl); $table->attributes['class'] = 'admintable generaltable'; -$table->data = []; $table->out(30, false); echo $OUTPUT->footer(); diff --git a/auth/email/tests/external/external_test.php b/auth/email/tests/external/external_test.php index e69e90e585b..79cd4226fff 100644 --- a/auth/email/tests/external/external_test.php +++ b/auth/email/tests/external/external_test.php @@ -45,6 +45,12 @@ require_once($CFG->dirroot . '/webservice/tests/helpers.php'); */ class external_test extends externallib_advanced_testcase { + /** @var int custom profile field1 ID. */ + protected $field1; + + /** @var int custom profile field2 ID. */ + protected $field2; + /** * Set up for every test */ diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index 567d00c6f29..eff6fe2d913 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -86,6 +86,18 @@ require_once($CFG->dirroot.'/auth/ldap/locallib.php'); */ class auth_plugin_ldap extends auth_plugin_base { + /** @var string */ + protected $roleauth; + + /** @var string */ + public $pluginconfig; + + /** @var LDAP\Connection LDAP connection. */ + protected $ldapconnection; + + /** @var int */ + protected $ldapconns = 0; + /** * Init plugin config from database settings depending on the plugin auth type. */ diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index ade0cc3b88a..f86b3b4495b 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -32,6 +32,9 @@ require_once($CFG->libdir.'/authlib.php'); */ class auth_plugin_mnet extends auth_plugin_base { + /** @var mnet_environment mnet environment. */ + protected $mnet; + /** * Constructor. */ diff --git a/availability/condition/completion/classes/frontend.php b/availability/condition/completion/classes/frontend.php index c6466854874..b2c36e5078e 100644 --- a/availability/condition/completion/classes/frontend.php +++ b/availability/condition/completion/classes/frontend.php @@ -37,7 +37,7 @@ class frontend extends \core_availability\frontend { /** * @var array Cached init parameters */ - protected $cacheparams = []; + protected $cacheinitparams = []; /** * @var string IDs of course, cm, and section for cache (if any) diff --git a/badges/classes/backpack_api2p1.php b/badges/classes/backpack_api2p1.php index f3829089252..c5fec6f4128 100644 --- a/badges/classes/backpack_api2p1.php +++ b/badges/classes/backpack_api2p1.php @@ -81,7 +81,7 @@ class backpack_api2p1 { if (!empty($externalbackpack)) { $this->externalbackpack = $externalbackpack; $this->backpackapiversion = $externalbackpack->apiversion; - $this->get_clientid = $this->get_clientid($externalbackpack->oauth2_issuerid); + $this->get_clientid($externalbackpack->oauth2_issuerid); if (!($this->tokendata = $this->get_stored_token($externalbackpack->id)) && $this->backpackapiversion != OPEN_BADGES_V2P1) { diff --git a/badges/classes/backpack_api2p1_mapping.php b/badges/classes/backpack_api2p1_mapping.php index 7419f3b65e2..f2a5a4f2194 100644 --- a/badges/classes/backpack_api2p1_mapping.php +++ b/badges/classes/backpack_api2p1_mapping.php @@ -67,6 +67,12 @@ class backpack_api2p1_mapping { /** @var boolean Differentiate the function that can be called on a user backpack or a site backpack. */ private $isuserbackpack; + /** @var mixed List of parameters for this method. */ + protected $postparams; + + /** @var int OpenBadges version 1 or 2. */ + protected $backpackapiversion; + /** * Create a mapping. * diff --git a/badges/classes/backpack_api_mapping.php b/badges/classes/backpack_api_mapping.php index 4c10f672a77..36ec0bc2e28 100644 --- a/badges/classes/backpack_api_mapping.php +++ b/badges/classes/backpack_api_mapping.php @@ -79,6 +79,12 @@ class backpack_api_mapping { /** @var string Error string from authentication request. */ private static $authenticationerror = ''; + /** @var mixed List of parameters for this method. */ + protected $postparams; + + /** @var int OpenBadges version 1 or 2. */ + protected $backpackapiversion; + /** * Create a mapping. * diff --git a/badges/classes/badge.php b/badges/classes/badge.php index 284556154db..93ee6d32a03 100644 --- a/badges/classes/badge.php +++ b/badges/classes/badge.php @@ -129,6 +129,24 @@ class badge { /** @var array Badge criteria */ public $criteria = array(); + /** @var int|null Total users which have the award. Called from badges_get_badges() */ + public $awards; + + /** @var string|null The name of badge status. Called from badges_get_badges() */ + public $statstring; + + /** @var int|null The date the badges were issued. Called from badges_get_badges() */ + public $dateissued; + + /** @var string|null Unique hash. Called from badges_get_badges() */ + public $uniquehash; + + /** @var string|null Message format. Called from file_prepare_standard_editor() */ + public $messageformat; + + /** @var array Message editor. Called from file_prepare_standard_editor() */ + public $message_editor = []; + /** * Constructs with badge details. * @@ -240,7 +258,16 @@ class badge { foreach (get_object_vars($this) as $k => $v) { $fordb->{$k} = $v; } + // TODO: We need to making it more simple. + // Since the variables are not exist in the badge table, + // unsetting them is a must to avoid errors. unset($fordb->criteria); + unset($fordb->awards); + unset($fordb->statstring); + unset($fordb->dateissued); + unset($fordb->uniquehash); + unset($fordb->messageformat); + unset($fordb->message_editor); $fordb->timemodified = time(); if ($DB->update_record_raw('badge', $fordb)) { diff --git a/badges/classes/output/external_backpacks_page.php b/badges/classes/output/external_backpacks_page.php index 195658ce6c6..e1f309d6a63 100644 --- a/badges/classes/output/external_backpacks_page.php +++ b/badges/classes/output/external_backpacks_page.php @@ -39,6 +39,12 @@ use core_badges\external\backpack_exporter; */ class external_backpacks_page implements \renderable { + /** @var \moodle_url Badges backpacks URL. */ + protected $url; + + /** @var array List the backpacks at site level. */ + protected $backpacks = []; + /** * Constructor. * @param \moodle_url $url diff --git a/badges/classes/output/external_backpacks_table.php b/badges/classes/output/external_backpacks_table.php index 72393f18da9..46a54c6f553 100644 --- a/badges/classes/output/external_backpacks_table.php +++ b/badges/classes/output/external_backpacks_table.php @@ -48,9 +48,9 @@ class external_backpacks_table extends table_sql { public function __construct() { parent::__construct('backpacks'); - $this->context = \context_system::instance(); + $context = \context_system::instance(); // This object should not be used without the right permissions. - require_capability('moodle/badges:manageglobalsettings', $this->context); + require_capability('moodle/badges:manageglobalsettings', $context); // Define columns in the table. $this->define_table_columns(); diff --git a/badges/criteria/award_criteria.php b/badges/criteria/award_criteria.php index b568df3257e..ef55ade8c9f 100644 --- a/badges/criteria/award_criteria.php +++ b/badges/criteria/award_criteria.php @@ -128,6 +128,24 @@ abstract class award_criteria { */ public $params = array(); + /** + * Criteria type. + * @var string + */ + public $criteriatype; + + /** + * Required parameters. + * @var string + */ + public $required_param = ''; + + /** + * Optional parameters. + * @var array + */ + public $optional_params = []; + /** * The base constructor * diff --git a/blocks/glossary_random/block_glossary_random.php b/blocks/glossary_random/block_glossary_random.php index 4b1e1493dc5..0982014a5fd 100644 --- a/blocks/glossary_random/block_glossary_random.php +++ b/blocks/glossary_random/block_glossary_random.php @@ -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'); } diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 8ae2c1eff7e..33e788b935b 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -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; } } diff --git a/blocks/myoverview/classes/output/main.php b/blocks/myoverview/classes/output/main.php index f8226c276b7..90b42c1752b 100644 --- a/blocks/myoverview/classes/output/main.php +++ b/blocks/myoverview/classes/output/main.php @@ -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 diff --git a/blocks/recentlyaccesseditems/tests/observer_test.php b/blocks/recentlyaccesseditems/tests/observer_test.php index 6b1b30e56dd..774cb86d972 100644 --- a/blocks/recentlyaccesseditems/tests/observer_test.php +++ b/blocks/recentlyaccesseditems/tests/observer_test.php @@ -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 */ diff --git a/blog/locallib.php b/blog/locallib.php index f2b3f2293f6..979b17ceeed 100644 --- a/blog/locallib.php +++ b/blog/locallib.php @@ -68,6 +68,69 @@ class blog_entry implements renderable { /** @var StdClass Data needed to render the entry */ public $renderable; + /** @var string summary format. */ + public string $summaryformat; + + /** @var array summary editor. */ + public array $summary_editor; + + /** @var string */ + public $summarytrust; + + /** @var int course associated with the blog post. */ + public $courseassoc; + + /** @var string module associated with the blog post. */ + public $modassoc; + + /** @var mixed attachment. */ + public $attachment_filemanager; + + /** @var string blog post body. */ + public $body; + + /** @var int attachment entry id. */ + public $entryid; + + /** @var string|null submit button. */ + public $submitbutton; + + /** @var string|null user alias. */ + public $useridalias; + + /** @var string|null user picture. */ + public $picture; + + /** @var string|null user first name. */ + public $firstname; + + /** @var string|null user middle name. */ + public $middlename; + + /** @var string|null user last name. */ + public $lastname; + + /** @var string|null user first name phonetic. */ + public $firstnamephonetic; + + /** @var string|null user last name phonetic. */ + public $lastnamephonetic; + + /** @var string|null user alternate name. */ + public $alternatename; + + /** @var string|null user email address. */ + public $email; + + /** @var string */ + public $action; + + /** @var string|null user picture description. */ + public $imagealt; + + /** @var int module instance id. */ + public $modid; + /** * Constructor. If given an id, will fetch the corresponding record from the DB. * diff --git a/blog/tests/external/external_test.php b/blog/tests/external/external_test.php index c51ec1436a4..c1dc8f13b46 100644 --- a/blog/tests/external/external_test.php +++ b/blog/tests/external/external_test.php @@ -48,6 +48,9 @@ class external_test extends \advanced_testcase { private $tagid; private $postid; + /** @var string publish state. */ + protected $publishstate; + protected function setUp(): void { global $DB, $CFG; parent::setUp(); diff --git a/cache/classes/config.php b/cache/classes/config.php index 021e2a69dd9..115b5ef3869 100644 --- a/cache/classes/config.php +++ b/cache/classes/config.php @@ -65,6 +65,12 @@ class cache_config { */ protected $configdefinitionmappings = array(); + /** + * The locking mappings that have been configured. + * @var array + */ + protected $configlockmappings = []; + /** * An array of configured cache lock instances. * @var array diff --git a/cache/classes/dummystore.php b/cache/classes/dummystore.php index bcc9ca1e72f..f268cef50c9 100644 --- a/cache/classes/dummystore.php +++ b/cache/classes/dummystore.php @@ -59,6 +59,12 @@ class cachestore_dummy extends cache_store { */ protected $store = array(); + /** + * Cache definition + * @var cache_definition + */ + protected $definition; + /** * Constructs a dummy store instance. * @param string $name @@ -119,6 +125,8 @@ class cachestore_dummy extends cache_store { } else { $this->persist = !$definition->use_static_acceleration(); } + + $this->definition = $definition; } /** diff --git a/cache/classes/loaders.php b/cache/classes/loaders.php index b008ae1079b..8f32d6560da 100644 --- a/cache/classes/loaders.php +++ b/cache/classes/loaders.php @@ -173,6 +173,19 @@ class cache implements cache_loader { */ protected $subloader = false; + /** + * Gets set to true if the cache writes (set|delete) must have a manual lock created first. + * @var bool + */ + protected $requirelockingbeforewrite = false; + + /** + * Gets set to true if the cache's primary store natively supports locking. + * If it does then we use that, otherwise we need to instantiate a second store to use for locking. + * @var cache_store|null + */ + protected $nativelocking = null; + /** * Creates a new cache instance for a pre-defined definition. * diff --git a/calendar/lib.php b/calendar/lib.php index 41de255e92d..14f2c7941c0 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1066,6 +1066,18 @@ class calendar_information { /** @var string The calendar's view mode. */ protected $viewmode; + /** @var \stdClass course data. */ + public $course; + + /** @var int day. */ + protected $day; + + /** @var int month. */ + protected $month; + + /** @var int year. */ + protected $year; + /** * Creates a new instance * diff --git a/calendar/tests/event_factory_test.php b/calendar/tests/event_factory_test.php index 044341ec99a..52ef17fa40c 100644 --- a/calendar/tests/event_factory_test.php +++ b/calendar/tests/event_factory_test.php @@ -75,7 +75,10 @@ class event_factory_test extends \advanced_testcase { } if ($expectedattributevalue) { - $this->assertEquals($instance->testattribute, $expectedattributevalue); + $this->assertEquals( + $instance->get_description()->get_value(), + $expectedattributevalue + ); } } @@ -368,7 +371,6 @@ class event_factory_test extends \advanced_testcase { 'location' => 'Test location', ], 'actioncallbackapplier' => function(event_interface $event) { - $event->testattribute = 'Hello'; return $event; }, 'visibilitycallbackapplier' => function(event_interface $event) { @@ -403,7 +405,6 @@ class event_factory_test extends \advanced_testcase { 'location' => 'Test location', ], 'actioncallbackapplier' => function(event_interface $event) { - $event->testattribute = 'Hello'; return $event; }, 'visibilitycallbackapplier' => function(event_interface $event) { @@ -438,7 +439,6 @@ class event_factory_test extends \advanced_testcase { 'location' => 'Test location', ], 'actioncallbackapplier' => function(event_interface $event) { - $event->testattribute = 'Hello'; return $event; }, 'visibilitycallbackapplier' => function(event_interface $event) { diff --git a/comment/lib.php b/comment/lib.php index b1074f31b21..7c3c8853c1f 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -96,6 +96,8 @@ class comment { private static $comment_page = null; /** @var string comment itemid component in non-javascript UI */ private static $comment_component = null; + /** @var stdClass comment paramaters for callback. */ + protected $comment_param; /** * Construct function of comment class, initialise diff --git a/comment/locallib.php b/comment/locallib.php index 3e771cca166..d3b0004162b 100644 --- a/comment/locallib.php +++ b/comment/locallib.php @@ -27,6 +27,24 @@ class comment_manager { /** @var int The number of comments to display per page */ private $perpage; + /** @var stdClass Course data. */ + protected $course; + + /** @var context|bool To store the context object or false if not found. */ + protected $context; + + /** @var stdClass Course module. */ + protected $cm; + + /** @var course_modinfo Module information for course, or null if resetting. */ + protected $modinfo; + + /** @var string plugin type. */ + protected $plugintype; + + /** @var string plugin name. */ + protected $pluginname; + /** * Constructs the comment_manage object */ diff --git a/competency/classes/competency.php b/competency/classes/competency.php index 5942a623369..5df830220b9 100644 --- a/competency/classes/competency.php +++ b/competency/classes/competency.php @@ -53,6 +53,9 @@ class competency extends persistent { /** @var competency Object before update. */ protected $beforeupdate = null; + /** @var competency|null To store new parent. */ + protected $newparent; + /** * Return the definition of the properties of this model. * diff --git a/competency/tests/competency_override_test.php b/competency/tests/competency_override_test.php index d0e4fb48b78..d4296d0d3b8 100644 --- a/competency/tests/competency_override_test.php +++ b/competency/tests/competency_override_test.php @@ -25,6 +25,36 @@ namespace core_competency; */ class competency_override_test extends \advanced_testcase { + /** @var \stdClass course record. */ + protected $course; + + /** @var \stdClass user record. */ + protected $user; + + /** @var \stdClass block instance record. */ + protected $scale; + + /** @var competency_framework loading competency frameworks from the DB. */ + protected $framework; + + /** @var plan loading competency plans from the DB. */ + protected $plan; + + /** @var competency loading competency from the DB. */ + protected $comp1; + + /** @var competency loading competency from the DB. */ + protected $comp2; + + /** @var \stdClass course module. */ + protected $cm; + + /** @var \completion_info completion information. */ + protected $completion; + + /** @var \context_course context course. */ + protected $context; + public function setUp(): void { $this->resetAfterTest(true); $this->setAdminUser(); diff --git a/competency/tests/external/external_test.php b/competency/tests/external/external_test.php index cf43e0ecdf9..04ad174dc1f 100644 --- a/competency/tests/external/external_test.php +++ b/competency/tests/external/external_test.php @@ -94,8 +94,11 @@ class external_test extends externallib_advanced_testcase { /** @var string catscaleconfiguration */ protected $scaleconfiguration3 = null; - /** @var string catscaleconfiguration */ - protected $catscaleconfiguration4 = null; + /** @var string category scale configuration. */ + protected $scaleconfiguration4 = null; + + /** @var \core_course_category course category record. */ + protected $othercategory = null; /** * Setup function- we will create a course and add an assign instance to it. diff --git a/completion/completion_completion.php b/completion/completion_completion.php index d1dc22b7670..54adf228420 100644 --- a/completion/completion_completion.php +++ b/completion/completion_completion.php @@ -66,6 +66,8 @@ class completion_completion extends data_object { /* @var int Flag to trigger cron aggregation (timestamp) */ public $reaggregate; + /** @var float user's course grade. */ + public $gradefinal; /** * Finds and returns a data_object instance based on params. diff --git a/completion/criteria/completion_criteria.php b/completion/criteria/completion_criteria.php index 16443835b29..5b634e89d3b 100644 --- a/completion/criteria/completion_criteria.php +++ b/completion/criteria/completion_criteria.php @@ -152,6 +152,12 @@ abstract class completion_criteria extends data_object { /* @var int Role ID that has the ability to mark a user as complete (for role completion) */ public $role; + /** @var string course instance. */ + public $courseinstance; + + /** @var mixed time end. */ + public $timeend; + /** * Finds and returns all data_object instances based on params. * diff --git a/completion/data_object.php b/completion/data_object.php index 515fef7a008..730ae53010e 100644 --- a/completion/data_object.php +++ b/completion/data_object.php @@ -64,6 +64,9 @@ abstract class data_object { /* @var int The primary key */ public $id; + /** @var int completed status. */ + public $completedself; + /** * Constructor. Optionally (and by default) attempts to fetch corresponding row from DB. diff --git a/course/format/classes/output/local/content/section.php b/course/format/classes/output/local/content/section.php index dcac5d6b982..29402de5394 100644 --- a/course/format/classes/output/local/content/section.php +++ b/course/format/classes/output/local/content/section.php @@ -79,6 +79,8 @@ class section implements named_templatable, renderable { /** @var bool if the section is considered stealth */ protected $isstealth = false; + /** @var string control menu class. */ + protected $controlmenuclass; /** * Constructor. diff --git a/enrol/ldap/lib.php b/enrol/ldap/lib.php index df57f2ae327..947af72c6e8 100644 --- a/enrol/ldap/lib.php +++ b/enrol/ldap/lib.php @@ -40,6 +40,9 @@ class enrol_ldap_plugin extends enrol_plugin { */ protected $userobjectclass; + /** @var LDAP\Connection LDAP connection. */ + protected $ldapconnection; + /** * Constructor for the plugin. In addition to calling the parent * constructor, we define and 'fix' some settings depending on the diff --git a/enrol/ldap/settingslib.php b/enrol/ldap/settingslib.php index ce372c90bda..1327f286293 100644 --- a/enrol/ldap/settingslib.php +++ b/enrol/ldap/settingslib.php @@ -29,6 +29,9 @@ class admin_setting_configtext_trim_lower extends admin_setting_configtext { /* @var boolean whether to lowercase the value or not before writing in to the db */ private $lowercase; + /** @var bool To store enable/disabled status of the input field. */ + protected $enabled; + /** * Constructor: uses parent::__construct * diff --git a/enrol/lti/ims-blti/OAuth.php b/enrol/lti/ims-blti/OAuth.php index abfe8434a59..5ff5e89308b 100644 --- a/enrol/lti/ims-blti/OAuth.php +++ b/enrol/lti/ims-blti/OAuth.php @@ -13,6 +13,9 @@ class OAuthConsumer { public $key; public $secret; + /** @var string|null To store callback_url. */ + protected $callback_url; + function __construct($key, $secret, $callback_url=NULL) { $this->key = $key; $this->secret = $secret; diff --git a/enrol/lti/ims-blti/readme_moodle.txt b/enrol/lti/ims-blti/readme_moodle.txt index fcd298b6d3b..c62a949148d 100644 --- a/enrol/lti/ims-blti/readme_moodle.txt +++ b/enrol/lti/ims-blti/readme_moodle.txt @@ -7,3 +7,4 @@ In future releases we should look into using a supported library. 2022-01-20 - MDL-73523 - Conditional openssl_free_key() use, deprecated by PHP 8.0 2022-03-05 - MDL-73520 - replace deprecated php_errormsg with error_get_last(), deprecated by PHP 8.0 2023-05-03 - MDL-77840 - Throw exception on openssl_sign to avoid null reaching base64_encode, deprecated by PHP 8.1 +2023-05-17 - MDL-77350 - Added $callback_url property to class OAuthConsumer to comply with PHP 8.2 diff --git a/enrol/renderer.php b/enrol/renderer.php index 8b24daca2c9..b5423ae8b9e 100644 --- a/enrol/renderer.php +++ b/enrol/renderer.php @@ -351,6 +351,9 @@ class course_enrolment_table extends html_table implements renderable { 'alternatename', 'username', 'idnumber', 'email', 'phone1', 'phone2', 'institution', 'department', 'lastaccess', 'lastcourseaccess'); + /** @var bool To store status of Other users page. */ + public $otherusers; + /** * Constructs the table * @@ -644,8 +647,6 @@ class course_enrolment_users_table extends course_enrolment_table { */ class course_enrolment_other_users_table extends course_enrolment_table { - public $otherusers = true; - /** * Constructs the table * diff --git a/favourites/classes/local/entity/favourite.php b/favourites/classes/local/entity/favourite.php index a10a8f27014..f8a564dd8d2 100644 --- a/favourites/classes/local/entity/favourite.php +++ b/favourites/classes/local/entity/favourite.php @@ -59,6 +59,9 @@ class favourite { /** @var int $timemodified the time at which the last modification of the favourite took place.*/ public $timemodified; + /** @var string $uniquekey favourite unique key.*/ + public $uniquekey; + /** * Favourite constructor. * @param string $component the frankenstyle name of the component containing the favourited item. E.g. 'core_course'. diff --git a/favourites/classes/local/repository/favourite_repository.php b/favourites/classes/local/repository/favourite_repository.php index c9403be5b55..f65461a583e 100644 --- a/favourites/classes/local/repository/favourite_repository.php +++ b/favourites/classes/local/repository/favourite_repository.php @@ -95,7 +95,8 @@ class favourite_repository implements favourite_repository_interface { 'ordering' => false, 'timecreated' => false, 'timemodified' => false, - 'id' => false + 'id' => false, + 'uniquekey' => false ]; $requiredfields = array_filter($allowedfields, function($field) { diff --git a/favourites/tests/repository_test.php b/favourites/tests/repository_test.php index 1488096b4c9..c83efcbcc29 100644 --- a/favourites/tests/repository_test.php +++ b/favourites/tests/repository_test.php @@ -81,28 +81,6 @@ class repository_test extends \advanced_testcase { $favouritesrepo->add($favcourse); } - /** - * Tests that malformed favourites cannot be saved. - */ - public function test_add_malformed_favourite() { - list($user1context, $user2context, $course1context, $course2context) = $this->setup_users_and_courses(); - - // Create a favourites repository and favourite a course. - $favouritesrepo = new favourite_repository($user1context); - - $favcourse = new favourite( - 'core_course', - 'course', - $course1context->instanceid, - $course1context->id, - $user1context->instanceid - ); - $favcourse->something = 'something'; - - $this->expectException('moodle_exception'); - $favouritesrepo->add($favcourse); - } - /** * Tests that incomplete favourites cannot be saved. */ diff --git a/filter/tex/latex.php b/filter/tex/latex.php index 825a63072b0..9a6b3294df9 100644 --- a/filter/tex/latex.php +++ b/filter/tex/latex.php @@ -10,6 +10,9 @@ var $temp_dir; var $error; + /** @var bool To store value of supported_platform. */ + protected $supported_platform; + /** * Constructor - create temporary directories and build paths to * external 'helper' binaries. diff --git a/media/player/videojs/classes/plugin.php b/media/player/videojs/classes/plugin.php index eb7c2189ef1..8694163551d 100644 --- a/media/player/videojs/classes/plugin.php +++ b/media/player/videojs/classes/plugin.php @@ -285,7 +285,7 @@ class media_videojs_plugin extends core_media_player_native { $url = reset($urls); // Check against regex. - if (preg_match($this->get_regex_youtube(), $url->out(false), $this->matches)) { + if (preg_match($this->get_regex_youtube(), $url->out(false), $matches)) { $this->youtube = true; return array($url); } diff --git a/message/output/popup/tests/api_test.php b/message/output/popup/tests/api_test.php index df6371c15a9..b94f1dd43d1 100644 --- a/message/output/popup/tests/api_test.php +++ b/message/output/popup/tests/api_test.php @@ -34,6 +34,9 @@ require_once($CFG->dirroot . '/message/output/popup/tests/base.php'); class api_test extends \advanced_testcase { use \message_popup_test_helper; + /** @var \phpunit_message_sink message redirection. */ + public $messagesink; + /** * Test set up. * diff --git a/message/output/popup/tests/externallib_test.php b/message/output/popup/tests/externallib_test.php index 5e5d4b33729..1b27e023057 100644 --- a/message/output/popup/tests/externallib_test.php +++ b/message/output/popup/tests/externallib_test.php @@ -37,6 +37,9 @@ require_once($CFG->dirroot . '/message/output/popup/tests/base.php'); class externallib_test extends \advanced_testcase { use message_popup_test_helper; + /** @var \phpunit_message_sink message redirection. */ + public $messagesink; + /** * Test set up. * diff --git a/mod/h5pactivity/classes/local/attempt.php b/mod/h5pactivity/classes/local/attempt.php index d039b3a1e85..4e8724feeb5 100644 --- a/mod/h5pactivity/classes/local/attempt.php +++ b/mod/h5pactivity/classes/local/attempt.php @@ -52,7 +52,6 @@ class attempt { */ public function __construct(stdClass $record) { $this->record = $record; - $this->results = null; } /** diff --git a/portfolio/mahara/lib.php b/portfolio/mahara/lib.php index ee725bd2c07..09ae1eb89f0 100644 --- a/portfolio/mahara/lib.php +++ b/portfolio/mahara/lib.php @@ -50,6 +50,9 @@ class portfolio_plugin_mahara extends portfolio_plugin_pull_base { private $totalsize; // total size of all included files added together private $continueurl; // if we've been sent back a specific url to continue to (eg folder id) + /** @var mnet_environment the equivalent of old $MNET global. */ + public $mnet; + protected function init() { $this->mnet = get_mnet_environment(); } diff --git a/rating/tests/externallib_test.php b/rating/tests/externallib_test.php index 32d16c3b2bf..e4890ed1f76 100644 --- a/rating/tests/externallib_test.php +++ b/rating/tests/externallib_test.php @@ -46,6 +46,45 @@ require_once($CFG->dirroot . '/rating/lib.php'); */ class externallib_test extends externallib_advanced_testcase { + /** @var \stdClass course record. */ + protected $course; + + /** @var \stdClass user record. */ + protected $student1; + + /** @var \stdClass user record. */ + protected $teacher1; + + /** @var \stdClass user record. */ + protected $student2; + + /** @var \stdClass user record. */ + protected $teacher2; + + /** @var \stdClass user record. */ + protected $student3; + + /** @var \stdClass user record. */ + protected $teacher3; + + /** @var \stdClass activity record. */ + protected $forum; + + /** @var \stdClass activity record. */ + protected $discussion; + + /** @var int context instance ID. */ + protected $contextid; + + /** @var \stdClass forum post. */ + protected $post; + + /** @var \stdClass a fieldset object, false or exception if error not found. */ + protected $studentrole; + + /** @var \stdClass a fieldset object, false or exception if error not found. */ + protected $teacherrole; + /* * Set up for every test */ 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 '