This commit is contained in:
Huong Nguyen
2024-08-20 09:30:44 +07:00
395 changed files with 787 additions and 785 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ class utils {
* @return void
*/
public static function data_exportdata(int $dataid, array $fields, array $selectedfields, entries_exporter $exporter,
int $currentgroup = 0, context $context = null, bool $userdetails = false, bool $time = false, bool $approval = false,
int $currentgroup = 0, ?context $context = null, bool $userdetails = false, bool $time = false, bool $approval = false,
bool $tags = false, bool $includefiles = true): void {
global $DB;
+1 -1
View File
@@ -52,7 +52,7 @@ class entry extends \core_search\base_mod {
* @param \context|null $context Optional context to restrict scope of returned results
* @return moodle_recordset|null Recordset (or null if no results)
*/
public function get_document_recordset($modifiedfrom = 0, \context $context = null) {
public function get_document_recordset($modifiedfrom = 0, ?\context $context = null) {
global $DB;
list ($contextjoin, $contextparams) = $this->get_context_restriction_sql(
+1 -1
View File
@@ -93,7 +93,7 @@ class template {
* @param array $options an array of extra diplay options
* @param array $fields alternative array of fields (for preview presets)
*/
public function __construct(manager $manager, string $templatecontent, array $options = [], array $fields = null) {
public function __construct(manager $manager, string $templatecontent, array $options = [], ?array $fields = null) {
$this->manager = $manager;
$this->instance = $manager->get_instance();
$this->templatecontent = $templatecontent;
+1 -1
View File
@@ -1552,7 +1552,7 @@ function data_grade_item_delete($data) {
* @param moodle_url|null $jumpurl a moodle_url by which to jump back to the record list (can be null)
* @return mixed string with all parsed entries or nothing if $return is false
*/
function data_print_template($templatename, $records, $data, $search='', $page=0, $return=false, moodle_url $jumpurl=null) {
function data_print_template($templatename, $records, $data, $search='', $page=0, $return=false, ?moodle_url $jumpurl=null) {
debugging(
'data_print_template is deprecated. Use mod_data\\manager::get_template and mod_data\\template::parse_entries instead',
DEBUG_DEVELOPER
+4 -4
View File
@@ -68,7 +68,7 @@ class mod_data_generator extends testing_module_generator {
* @param array $options
* @return StdClass
*/
public function create_instance($record = null, array $options = null) {
public function create_instance($record = null, ?array $options = null) {
// Note, the parent class does not type $record to cast to array and then to object.
$record = (object) (array) $record;
@@ -89,7 +89,7 @@ class mod_data_generator extends testing_module_generator {
* @param stdClass|null $data
* @return data_field_base
*/
public function create_field(stdClass $record = null, $data = null) {
public function create_field(?stdClass $record = null, $data = null) {
$record = (array) $record;
$this->databasefieldcount++;
@@ -214,7 +214,7 @@ class mod_data_generator extends testing_module_generator {
* @param int $userid if defined, it will be the author of the entry
* @return int id of the generated record in table {data_records}
*/
public function create_entry($data, array $contents, $groupid = 0, $tags = [], array $options = null, int $userid = 0) {
public function create_entry($data, array $contents, $groupid = 0, $tags = [], ?array $options = null, int $userid = 0) {
global $DB, $USER, $CFG;
// Set current user if defined.
@@ -387,7 +387,7 @@ class mod_data_generator extends testing_module_generator {
* @param stdClass|null $record The preset information, like 'name'.
* @return preset The preset that has been created.
*/
public function create_preset(stdClass $instance, stdClass $record = null): preset {
public function create_preset(stdClass $instance, ?stdClass $record = null): preset {
global $USER;
if (is_null($record)) {