mirror of
https://github.com/moodle/moodle.git
synced 2025-08-03 08:09:47 +02:00
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle
This commit is contained in:
commit
3278ce7aba
1147 changed files with 2621 additions and 2617 deletions
|
@ -35,7 +35,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ class provider implements
|
|||
* @param collection $collection A list of information about this component
|
||||
* @return collection The collection object filled out with information about this component.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
// These tables are really data about site configuration and not user data.
|
||||
|
||||
// The adminpresets includes information about which user performed a configuration change using the admin_presets
|
||||
|
@ -74,7 +74,7 @@ class provider implements
|
|||
* @param int $userid The user to search.
|
||||
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
return new contextlist();
|
||||
}
|
||||
|
||||
|
|
|
@ -617,7 +617,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
* @param bool $croninfrequent
|
||||
* @return string HTML to output.
|
||||
*/
|
||||
public function cron_infrequent_warning(bool $croninfrequent) : string {
|
||||
public function cron_infrequent_warning(bool $croninfrequent): string {
|
||||
global $CFG;
|
||||
|
||||
if (!$croninfrequent) {
|
||||
|
|
|
@ -99,7 +99,7 @@ abstract class core_role_allow_role_page {
|
|||
* @param int $fromroleid
|
||||
* @param int $targetroleid
|
||||
*/
|
||||
protected abstract function set_allow($fromroleid, $targetroleid);
|
||||
abstract protected function set_allow($fromroleid, $targetroleid);
|
||||
|
||||
/**
|
||||
* Load the current allows from the database.
|
||||
|
@ -183,11 +183,11 @@ abstract class core_role_allow_role_page {
|
|||
* Snippet of text displayed above the table, telling the admin what to do.
|
||||
* @return string
|
||||
*/
|
||||
public abstract function get_intro_text();
|
||||
abstract public function get_intro_text();
|
||||
|
||||
/**
|
||||
* Returns the allow class respective event class name.
|
||||
* @return string
|
||||
*/
|
||||
protected abstract function get_eventclass();
|
||||
abstract protected function get_eventclass();
|
||||
}
|
||||
|
|
|
@ -142,12 +142,12 @@ abstract class core_role_capability_table_base {
|
|||
/**
|
||||
* For subclasses to override, output header cells, after the initial capability one.
|
||||
*/
|
||||
protected abstract function add_header_cells();
|
||||
abstract protected function add_header_cells();
|
||||
|
||||
/**
|
||||
* For subclasses to override, return the number of cells that add_header_cells/add_row_cells output.
|
||||
*/
|
||||
protected abstract function num_extra_columns();
|
||||
abstract protected function num_extra_columns();
|
||||
|
||||
/**
|
||||
* For subclasses to override. Allows certain capabilties
|
||||
|
@ -191,5 +191,5 @@ abstract class core_role_capability_table_base {
|
|||
* @param stdClass $capability the capability this row relates to.
|
||||
* @return string html of row cells
|
||||
*/
|
||||
protected abstract function add_row_cells($capability);
|
||||
abstract protected function add_row_cells($capability);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
|
|||
}
|
||||
}
|
||||
|
||||
protected abstract function load_parent_permissions();
|
||||
abstract protected function load_parent_permissions();
|
||||
|
||||
/**
|
||||
* Update $this->permissions based on submitted data, while making a list of
|
||||
|
@ -156,7 +156,7 @@ abstract class core_role_capability_table_with_risks extends core_role_capabilit
|
|||
return $rowclasses;
|
||||
}
|
||||
|
||||
protected abstract function add_permission_cells($capability);
|
||||
abstract protected function add_permission_cells($capability);
|
||||
|
||||
protected function add_row_cells($capability) {
|
||||
$cells = $this->add_permission_cells($capability);
|
||||
|
|
|
@ -53,7 +53,7 @@ class provider implements
|
|||
* @param collection $collection An object for storing metadata.
|
||||
* @return collection The metadata.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
$rolecapabilities = [
|
||||
'roleid' => 'privacy:metadata:role_capabilities:roleid',
|
||||
'capability' => 'privacy:metadata:role_capabilities:capability',
|
||||
|
@ -100,7 +100,7 @@ class provider implements
|
|||
* @param int $userid The user ID.
|
||||
* @return contextlist The list of context IDs.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
global $DB;
|
||||
|
||||
$contextlist = new contextlist();
|
||||
|
|
|
@ -31,7 +31,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class import_model extends \moodleform {
|
|||
*
|
||||
* @return null
|
||||
*/
|
||||
public function definition () {
|
||||
public function definition() {
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('header', 'settingsheader', get_string('importmodel', 'tool_analytics'));
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -157,7 +157,7 @@ class renderer extends plugin_renderer_base {
|
|||
* @throws \coding_exception
|
||||
* @throws \moodle_exception
|
||||
*/
|
||||
public function analysisbutton(int $courseid) : string {
|
||||
public function analysisbutton(int $courseid): string {
|
||||
$link = new moodle_url(accessibility::get_plugin_url(), [
|
||||
'action' => 'requestanalysis',
|
||||
'courseid' => $courseid
|
||||
|
|
|
@ -30,7 +30,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -52,7 +52,7 @@ class provider implements
|
|||
* @param collection $collection The initialised collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
// The tool_cohortroles plugin utilises the mdl_tool_cohortroles table.
|
||||
$collection->add_database_table(
|
||||
'tool_cohortroles',
|
||||
|
@ -77,7 +77,7 @@ class provider implements
|
|||
* @param int $userid The user to search.
|
||||
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
$contextlist = new contextlist();
|
||||
|
||||
// When we process user deletions and expiries, we always delete from the user context.
|
||||
|
|
|
@ -30,7 +30,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -60,7 +60,7 @@ class langstring_test extends advanced_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function fix_syntax_data() : array {
|
||||
public function fix_syntax_data(): array {
|
||||
return [
|
||||
// Syntax sanity v1 strings.
|
||||
[
|
||||
|
|
|
@ -79,7 +79,7 @@ class phpparser_test extends advanced_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function parse_provider() : array {
|
||||
public function parse_provider(): array {
|
||||
return [
|
||||
'Invalid PHP code' => [
|
||||
'No PHP code', [], false
|
||||
|
|
|
@ -168,7 +168,7 @@ class api {
|
|||
*
|
||||
* @return array An array of the DPO role shortnames
|
||||
*/
|
||||
public static function get_dpo_role_names() : array {
|
||||
public static function get_dpo_role_names(): array {
|
||||
global $DB;
|
||||
|
||||
$dporoleids = self::get_assigned_privacy_officer_roles();
|
||||
|
@ -524,7 +524,7 @@ class api {
|
|||
* @param array $userids
|
||||
* @return array
|
||||
*/
|
||||
public static function find_ongoing_request_types_for_users(array $userids) : array {
|
||||
public static function find_ongoing_request_types_for_users(array $userids): array {
|
||||
global $DB;
|
||||
|
||||
if (empty($userids)) {
|
||||
|
@ -1201,7 +1201,7 @@ class api {
|
|||
* @return contextlist_collection The collection of approved_contextlist objects.
|
||||
*/
|
||||
public static function get_approved_contextlist_collection_for_collection(contextlist_collection $collection,
|
||||
\stdClass $foruser, int $type) : contextlist_collection {
|
||||
\stdClass $foruser, int $type): contextlist_collection {
|
||||
|
||||
// Create the approved contextlist collection object.
|
||||
$approvedcollection = new contextlist_collection($collection->get_userid());
|
||||
|
@ -1326,7 +1326,7 @@ class api {
|
|||
* @param \DateInterval $interval
|
||||
* @return string
|
||||
*/
|
||||
public static function format_retention_period(\DateInterval $interval) : string {
|
||||
public static function format_retention_period(\DateInterval $interval): string {
|
||||
// It is one or another.
|
||||
if ($interval->y) {
|
||||
$formattedtime = get_string('numyears', 'moodle', $interval->format('%y'));
|
||||
|
|
|
@ -241,7 +241,7 @@ class data_request extends persistent {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_resettable() : bool {
|
||||
public function is_resettable(): bool {
|
||||
if (api::DATAREQUEST_TYPE_OTHERS == $this->get('type')) {
|
||||
// It is not possible to reset 'other' reqeusts.
|
||||
return false;
|
||||
|
@ -260,7 +260,7 @@ class data_request extends persistent {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_active() : bool {
|
||||
public function is_active(): bool {
|
||||
$active = [
|
||||
api::DATAREQUEST_STATUS_APPROVED => true,
|
||||
];
|
||||
|
@ -275,7 +275,7 @@ class data_request extends persistent {
|
|||
*
|
||||
* @return self
|
||||
*/
|
||||
public function resubmit_request() : data_request {
|
||||
public function resubmit_request(): data_request {
|
||||
if ($this->is_active()) {
|
||||
$this->set('status', api::DATAREQUEST_STATUS_REJECTED)->save();
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ class expired_context extends \core\persistent {
|
|||
* @param int[] $roleids
|
||||
* @return expired_context
|
||||
*/
|
||||
protected function set_roleids_for(string $field, array $roleids) : expired_context {
|
||||
protected function set_roleids_for(string $field, array $roleids): expired_context {
|
||||
$roledata = json_encode($roleids);
|
||||
|
||||
$this->raw_set($field, $roledata);
|
||||
|
@ -211,7 +211,7 @@ class expired_context extends \core\persistent {
|
|||
* @param int[] $roleids
|
||||
* @return expired_context
|
||||
*/
|
||||
protected function set_unexpiredroles(array $roleids) : expired_context {
|
||||
protected function set_unexpiredroles(array $roleids): expired_context {
|
||||
$this->set_roleids_for('unexpiredroles', $roleids);
|
||||
|
||||
return $this;
|
||||
|
@ -223,7 +223,7 @@ class expired_context extends \core\persistent {
|
|||
* @param int[] $roleids
|
||||
* @return expired_context
|
||||
*/
|
||||
public function add_expiredroles(array $roleids) : expired_context {
|
||||
public function add_expiredroles(array $roleids): expired_context {
|
||||
$existing = $this->get('expiredroles');
|
||||
$newvalue = array_merge($existing, $roleids);
|
||||
|
||||
|
@ -238,7 +238,7 @@ class expired_context extends \core\persistent {
|
|||
* @param int[] $roleids
|
||||
* @return unexpired_context
|
||||
*/
|
||||
public function add_unexpiredroles(array $roleids) : expired_context {
|
||||
public function add_unexpiredroles(array $roleids): expired_context {
|
||||
$existing = $this->get('unexpiredroles');
|
||||
$newvalue = array_merge($existing, $roleids);
|
||||
|
||||
|
@ -253,7 +253,7 @@ class expired_context extends \core\persistent {
|
|||
* @param int[] $roleids
|
||||
* @return expired_context
|
||||
*/
|
||||
protected function set_expiredroles(array $roleids) : expired_context {
|
||||
protected function set_expiredroles(array $roleids): expired_context {
|
||||
$this->set_roleids_for('expiredroles', $roleids);
|
||||
|
||||
return $this;
|
||||
|
@ -285,7 +285,7 @@ class expired_context extends \core\persistent {
|
|||
* @param boolean $save
|
||||
* @return expired_context
|
||||
*/
|
||||
public static function create_from_expiry_info(\context $context, expiry_info $info, bool $save = true) : expired_context {
|
||||
public static function create_from_expiry_info(\context $context, expiry_info $info, bool $save = true): expired_context {
|
||||
$record = (object) [
|
||||
'contextid' => $context->id,
|
||||
'status' => self::STATUS_EXPIRED,
|
||||
|
@ -309,7 +309,7 @@ class expired_context extends \core\persistent {
|
|||
* @param expiry_info $info
|
||||
* @return $this
|
||||
*/
|
||||
public function update_from_expiry_info(expiry_info $info) : expired_context {
|
||||
public function update_from_expiry_info(expiry_info $info): expired_context {
|
||||
$save = false;
|
||||
|
||||
// Compare the expiredroles.
|
||||
|
@ -353,7 +353,7 @@ class expired_context extends \core\persistent {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function can_process_deletion() : bool {
|
||||
public function can_process_deletion(): bool {
|
||||
return ($this->get('status') == self::STATUS_APPROVED);
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,7 @@ class expired_context extends \core\persistent {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_complete() : bool {
|
||||
public function is_complete(): bool {
|
||||
return ($this->get('status') == self::STATUS_CLEANED);
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,7 @@ class expired_context extends \core\persistent {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_fully_expired() : bool {
|
||||
public function is_fully_expired(): bool {
|
||||
return $this->get('defaultexpired') && empty($this->get('unexpiredroles'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ class expired_contexts_manager {
|
|||
*
|
||||
* @return int[] The number of contexts flagged as expired for courses, and users.
|
||||
*/
|
||||
public function flag_expired_contexts() : array {
|
||||
public function flag_expired_contexts(): array {
|
||||
$this->trace->output('Checking requirements');
|
||||
if (!$this->check_requirements()) {
|
||||
$this->trace->output('Requirements not met. Cannot process expired retentions.', 1);
|
||||
|
@ -151,7 +151,7 @@ class expired_contexts_manager {
|
|||
* @param string $contextpath A contexpath to restrict results to
|
||||
* @return \stdClass[]
|
||||
*/
|
||||
protected static function get_nested_expiry_info($contextpath = '') : array {
|
||||
protected static function get_nested_expiry_info($contextpath = ''): array {
|
||||
$coursepaths = self::get_nested_expiry_info_for_courses($contextpath);
|
||||
$userpaths = self::get_nested_expiry_info_for_user($contextpath);
|
||||
|
||||
|
@ -164,7 +164,7 @@ class expired_contexts_manager {
|
|||
* @param string $contextpath A contexpath to restrict results to
|
||||
* @return \stdClass[]
|
||||
*/
|
||||
protected static function get_nested_expiry_info_for_courses($contextpath = '') : array {
|
||||
protected static function get_nested_expiry_info_for_courses($contextpath = ''): array {
|
||||
global $DB;
|
||||
|
||||
$contextfields = \context_helper::get_preload_record_columns_sql('ctx');
|
||||
|
@ -217,7 +217,7 @@ class expired_contexts_manager {
|
|||
* @param string $contextpath A contexpath to restrict results to
|
||||
* @return \stdClass[]
|
||||
*/
|
||||
protected static function get_nested_expiry_info_for_user($contextpath = '') : array {
|
||||
protected static function get_nested_expiry_info_for_user($contextpath = ''): array {
|
||||
global $DB;
|
||||
|
||||
$contextfields = \context_helper::get_preload_record_columns_sql('ctx');
|
||||
|
@ -262,7 +262,7 @@ class expired_contexts_manager {
|
|||
* @param array $params The params required by the SQL.
|
||||
* @return \stdClass[]
|
||||
*/
|
||||
protected static function get_nested_expiry_info_from_sql(string $sql, array $params) : array {
|
||||
protected static function get_nested_expiry_info_from_sql(string $sql, array $params): array {
|
||||
global $DB;
|
||||
|
||||
$fulllist = $DB->get_recordset_sql($sql, $params);
|
||||
|
@ -334,7 +334,7 @@ class expired_contexts_manager {
|
|||
* @param \context $context
|
||||
* @return bool
|
||||
*/
|
||||
protected static function is_eligible_for_deletion(array &$pathstoskip, \context $context) : bool {
|
||||
protected static function is_eligible_for_deletion(array &$pathstoskip, \context $context): bool {
|
||||
$shouldskip = false;
|
||||
// Check whether any of the child contexts are ineligble.
|
||||
$shouldskip = !empty(array_filter($pathstoskip, function($path) use ($context) {
|
||||
|
@ -361,7 +361,7 @@ class expired_contexts_manager {
|
|||
*
|
||||
* @return int[] The number of deleted contexts.
|
||||
*/
|
||||
public function process_approved_deletions() : array {
|
||||
public function process_approved_deletions(): array {
|
||||
$this->trace->output('Checking requirements');
|
||||
if (!$this->check_requirements()) {
|
||||
$this->trace->output('Requirements not met. Cannot process expired retentions.', 1);
|
||||
|
@ -538,7 +538,7 @@ class expired_contexts_manager {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected static function require_all_end_dates_for_user_deletion() : bool {
|
||||
protected static function require_all_end_dates_for_user_deletion(): bool {
|
||||
$requireenddate = get_config('tool_dataprivacy', 'requireallenddatesforuserdeletion');
|
||||
|
||||
return !empty($requireenddate);
|
||||
|
@ -563,7 +563,7 @@ class expired_contexts_manager {
|
|||
* @param int $comparisondate The date for comparison
|
||||
* @return bool
|
||||
*/
|
||||
protected static function has_expired(string $period, int $comparisondate) : bool {
|
||||
protected static function has_expired(string $period, int $comparisondate): bool {
|
||||
$dt = new \DateTime();
|
||||
$dt->setTimestamp($comparisondate);
|
||||
$dt->add(new \DateInterval($period));
|
||||
|
@ -578,7 +578,7 @@ class expired_contexts_manager {
|
|||
* @param int $comparisondate The date for comparison
|
||||
* @return expiry_info
|
||||
*/
|
||||
protected static function get_expiry_info(purpose $purpose, int $comparisondate = 0) : expiry_info {
|
||||
protected static function get_expiry_info(purpose $purpose, int $comparisondate = 0): expiry_info {
|
||||
$overrides = $purpose->get_purpose_overrides();
|
||||
$expiredroles = $unexpiredroles = [];
|
||||
if (empty($overrides)) {
|
||||
|
@ -730,7 +730,7 @@ class expired_contexts_manager {
|
|||
* @param \context $context
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_role_users_for_expired_context(expired_context $expiredctx, \context $context) : \stdClass {
|
||||
protected function get_role_users_for_expired_context(expired_context $expiredctx, \context $context): \stdClass {
|
||||
$expiredroles = $expiredctx->get('expiredroles');
|
||||
$expiredroleusers = [];
|
||||
if (!empty($expiredroles)) {
|
||||
|
@ -782,7 +782,7 @@ class expired_contexts_manager {
|
|||
* @param \context $context
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_context_expired(\context $context) : bool {
|
||||
public static function is_context_expired(\context $context): bool {
|
||||
$parents = $context->get_parent_contexts(true);
|
||||
foreach ($parents as $parent) {
|
||||
if ($parent instanceof \context_course) {
|
||||
|
@ -805,7 +805,7 @@ class expired_contexts_manager {
|
|||
* @param \stdClass $course
|
||||
* @return bool
|
||||
*/
|
||||
protected static function is_course_expired(\stdClass $course) : bool {
|
||||
protected static function is_course_expired(\stdClass $course): bool {
|
||||
$context = \context_course::instance($course->id);
|
||||
|
||||
return self::is_course_context_expired($context);
|
||||
|
@ -818,7 +818,7 @@ class expired_contexts_manager {
|
|||
* @param \context $context
|
||||
* @return bool
|
||||
*/
|
||||
protected static function is_course_context_expired(\context $context) : bool {
|
||||
protected static function is_course_context_expired(\context $context): bool {
|
||||
$expiryrecords = self::get_nested_expiry_info_for_courses($context->path);
|
||||
|
||||
return !empty($expiryrecords[$context->path]) && $expiryrecords[$context->path]->info->is_fully_expired();
|
||||
|
@ -839,7 +839,7 @@ class expired_contexts_manager {
|
|||
* @param \context_user $context
|
||||
* @return bool
|
||||
*/
|
||||
protected static function are_user_context_dependencies_expired(\context_user $context) : bool {
|
||||
protected static function are_user_context_dependencies_expired(\context_user $context): bool {
|
||||
// The context instanceid is the user's ID.
|
||||
if (isguestuser($context->instanceid) || is_siteadmin($context->instanceid)) {
|
||||
// This is an admin, or the guest and cannot expire.
|
||||
|
@ -889,7 +889,7 @@ class expired_contexts_manager {
|
|||
* @param \stdClass $user
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_context_expired_or_unprotected_for_user(\context $context, \stdClass $user) : bool {
|
||||
public static function is_context_expired_or_unprotected_for_user(\context $context, \stdClass $user): bool {
|
||||
// User/course contexts can't expire if no purpose is set in the system context.
|
||||
if (!data_registry::defaults_set()) {
|
||||
return false;
|
||||
|
@ -972,7 +972,7 @@ class expired_contexts_manager {
|
|||
*
|
||||
* @return manager
|
||||
*/
|
||||
protected function get_privacy_manager() : manager {
|
||||
protected function get_privacy_manager(): manager {
|
||||
if (null === $this->manager) {
|
||||
$this->manager = new manager();
|
||||
$this->manager->set_observer(new \tool_dataprivacy\manager_observer());
|
||||
|
@ -986,7 +986,7 @@ class expired_contexts_manager {
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function get_delete_limit() : int {
|
||||
protected function get_delete_limit(): int {
|
||||
return self::DELETE_LIMIT;
|
||||
}
|
||||
|
||||
|
@ -995,7 +995,7 @@ class expired_contexts_manager {
|
|||
*
|
||||
* @return \progress_trace
|
||||
*/
|
||||
protected function get_progress() : \progress_trace {
|
||||
protected function get_progress(): \progress_trace {
|
||||
if (null === $this->progresstracer) {
|
||||
$this->set_progress(new \text_progress_trace());
|
||||
}
|
||||
|
@ -1009,7 +1009,7 @@ class expired_contexts_manager {
|
|||
* @param \progress_trace $trace
|
||||
* @return $this
|
||||
*/
|
||||
public function set_progress(\progress_trace $trace) : expired_contexts_manager {
|
||||
public function set_progress(\progress_trace $trace): expired_contexts_manager {
|
||||
$this->progresstracer = $trace;
|
||||
|
||||
return $this;
|
||||
|
|
|
@ -76,7 +76,7 @@ class expiry_info {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_fully_expired() : bool {
|
||||
public function is_fully_expired(): bool {
|
||||
return $this->defaultexpiryreached && empty($this->unexpired);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ class expiry_info {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_any_expired() : bool {
|
||||
public function is_any_expired(): bool {
|
||||
if ($this->is_fully_expired()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ class expiry_info {
|
|||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function get_expired_roles() : array {
|
||||
public function get_expired_roles(): array {
|
||||
if ($this->is_default_expired()) {
|
||||
return [];
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ class expiry_info {
|
|||
* @param int $roleid
|
||||
* @return bool
|
||||
*/
|
||||
public function is_role_expired(int $roleid) : bool {
|
||||
public function is_role_expired(int $roleid): bool {
|
||||
return false !== array_search($roleid, $this->expired);
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ class expiry_info {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_default_expired() : bool {
|
||||
public function is_default_expired(): bool {
|
||||
return $this->defaultexpiryreached;
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ class expiry_info {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function is_default_protected() : bool {
|
||||
public function is_default_protected(): bool {
|
||||
return $this->defaultprotected;
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,7 @@ class expiry_info {
|
|||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function get_unexpired_roles() : array {
|
||||
public function get_unexpired_roles(): array {
|
||||
return $this->unexpired;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ class expiry_info {
|
|||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function get_unexpired_protected_roles() : array {
|
||||
public function get_unexpired_protected_roles(): array {
|
||||
return array_keys(array_filter($this->protectedroles));
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ class expiry_info {
|
|||
* Get a list of all overridden roles which are unprotected.
|
||||
* @return int[]
|
||||
*/
|
||||
public function get_unprotected_overridden_roles() : array {
|
||||
public function get_unprotected_overridden_roles(): array {
|
||||
$allroles = array_merge($this->expired, $this->unexpired);
|
||||
|
||||
return array_diff($allroles, $this->protectedroles);
|
||||
|
@ -181,7 +181,7 @@ class expiry_info {
|
|||
* @param expiry_info $child The child record to merge with.
|
||||
* @return $this
|
||||
*/
|
||||
public function merge_with_child(expiry_info $child) : expiry_info {
|
||||
public function merge_with_child(expiry_info $child): expiry_info {
|
||||
if ($child->is_fully_expired()) {
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class filtered_userlist extends \core_privacy\local\request\approved_userlist {
|
|||
* @param int[] $unexpireduserids The list of userids for those users who should not be expired.
|
||||
* @return $this
|
||||
*/
|
||||
public function apply_expired_context_filters(array $expireduserids, array $unexpireduserids) : filtered_userlist {
|
||||
public function apply_expired_context_filters(array $expireduserids, array $unexpireduserids): filtered_userlist {
|
||||
// The current userlist content.
|
||||
$userids = $this->get_userids();
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ class purpose extends persistent {
|
|||
* @param string $prefix The prefix to apply to the field
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_role_override_id(string $prefix = '') : \stdClass {
|
||||
protected function get_role_override_id(string $prefix = ''): \stdClass {
|
||||
$fieldname = "{$prefix}id";
|
||||
|
||||
$fielddata = (object) [
|
||||
|
@ -264,7 +264,7 @@ class purpose extends persistent {
|
|||
* @param string $prefix The prefix to apply to the field
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_role_field(string $prefix = '') : \stdClass {
|
||||
protected function get_role_field(string $prefix = ''): \stdClass {
|
||||
$fieldname = "{$prefix}roleid";
|
||||
|
||||
$fielddata = (object) [
|
||||
|
@ -297,7 +297,7 @@ class purpose extends persistent {
|
|||
* @param string $prefix The prefix to apply to the field
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_lawful_base_field(string $prefix = '') : \stdClass {
|
||||
protected function get_lawful_base_field(string $prefix = ''): \stdClass {
|
||||
$fieldname = "{$prefix}lawfulbases";
|
||||
|
||||
$data = (object) [
|
||||
|
@ -334,7 +334,7 @@ class purpose extends persistent {
|
|||
* @param string $prefix The prefix to apply to the field
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_sensitive_base_field(string $prefix = '') : \stdClass {
|
||||
protected function get_sensitive_base_field(string $prefix = ''): \stdClass {
|
||||
$fieldname = "{$prefix}sensitivedatareasons";
|
||||
|
||||
$data = (object) [
|
||||
|
@ -373,7 +373,7 @@ class purpose extends persistent {
|
|||
* @param string $prefix The name of the main field, and prefix for the subfields.
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_retention_period_fields(string $prefix = '') : \stdClass {
|
||||
protected function get_retention_period_fields(string $prefix = ''): \stdClass {
|
||||
$prefix = "{$prefix}retentionperiod";
|
||||
$data = (object) [
|
||||
'fields' => [],
|
||||
|
@ -411,7 +411,7 @@ class purpose extends persistent {
|
|||
* @param string $prefix The prefix to apply to the field
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function get_protected_field(string $prefix = '') : \stdClass {
|
||||
protected function get_protected_field(string $prefix = ''): \stdClass {
|
||||
$fieldname = "{$prefix}protected";
|
||||
|
||||
return (object) [
|
||||
|
@ -470,7 +470,7 @@ class purpose extends persistent {
|
|||
* @param \stdClass $data
|
||||
* @return \stdClass
|
||||
*/
|
||||
protected function convert_existing_data_to_values(\stdClass $data) : \stdClass {
|
||||
protected function convert_existing_data_to_values(\stdClass $data): \stdClass {
|
||||
$data->lawfulbases = explode(',', $data->lawfulbases);
|
||||
if (!empty($data->sensitivedatareasons)) {
|
||||
$data->sensitivedatareasons = explode(',', $data->sensitivedatareasons);
|
||||
|
|
|
@ -44,7 +44,7 @@ abstract class crud_element {
|
|||
*
|
||||
* @return \action_link[]
|
||||
*/
|
||||
protected final function get_navigation() {
|
||||
final protected function get_navigation() {
|
||||
$back = new \action_link(
|
||||
new \moodle_url('/admin/tool/dataprivacy/dataregistry.php'),
|
||||
get_string('back'),
|
||||
|
@ -62,7 +62,7 @@ abstract class crud_element {
|
|||
* @param \core\persistent $persistent
|
||||
* @return \action_menu
|
||||
*/
|
||||
protected final function action_menu($elementname, $exported, $persistent) {
|
||||
final protected function action_menu($elementname, $exported, $persistent) {
|
||||
|
||||
// Just in case, we are doing funny stuff below.
|
||||
$elementname = clean_param($elementname, PARAM_ALPHA);
|
||||
|
|
|
@ -429,7 +429,7 @@ class data_requests_table extends table_sql {
|
|||
*
|
||||
* @return int The number of data request records.
|
||||
*/
|
||||
public function get_requests_per_page() : int {
|
||||
public function get_requests_per_page(): int {
|
||||
return $this->perpage;
|
||||
}
|
||||
|
||||
|
@ -447,7 +447,7 @@ class data_requests_table extends table_sql {
|
|||
*
|
||||
* @return array The available options for the number of data request to be displayed per page.
|
||||
*/
|
||||
public function get_requests_per_page_options() : array {
|
||||
public function get_requests_per_page_options(): array {
|
||||
return $this->perpageoptions;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -370,7 +370,7 @@ class expired_contexts_table extends table_sql {
|
|||
* @param expired_context $expiredcontext
|
||||
* @return purpose
|
||||
*/
|
||||
protected function get_purpose_for_expiry(expired_context $expiredcontext) : purpose {
|
||||
protected function get_purpose_for_expiry(expired_context $expiredcontext): purpose {
|
||||
$context = context_helper::instance_by_id($expiredcontext->get('contextid'));
|
||||
|
||||
if (empty($this->purposemap[$context->id])) {
|
||||
|
|
|
@ -66,7 +66,7 @@ class provider implements
|
|||
* @param collection $collection The initialised collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
$collection->add_database_table(
|
||||
'tool_dataprivacy_request',
|
||||
[
|
||||
|
@ -103,7 +103,7 @@ class provider implements
|
|||
* @param int $userid The user to search.
|
||||
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
$sql = "SELECT id
|
||||
FROM {context}
|
||||
WHERE instanceid = :userid
|
||||
|
|
|
@ -185,7 +185,7 @@ class purpose extends \core\persistent {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_purpose_overrides() : array {
|
||||
public function get_purpose_overrides(): array {
|
||||
return purpose_override::get_overrides_for_purpose($this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class purpose_override extends \core\persistent {
|
|||
* @param purpose $purpose
|
||||
* @return array
|
||||
*/
|
||||
public static function get_overrides_for_purpose(purpose $purpose) : array {
|
||||
public static function get_overrides_for_purpose(purpose $purpose): array {
|
||||
$cache = \cache::make('tool_dataprivacy', 'purpose_overrides');
|
||||
|
||||
$overrides = [];
|
||||
|
|
|
@ -2165,7 +2165,7 @@ class api_test extends \advanced_testcase {
|
|||
* @param string $course Retention policy for courses.
|
||||
* @param string $activity Retention policy for activities.
|
||||
*/
|
||||
protected function setup_basics(string $system, string $user, string $course = null, string $activity = null) : \stdClass {
|
||||
protected function setup_basics(string $system, string $user, string $course = null, string $activity = null): \stdClass {
|
||||
$this->resetAfterTest();
|
||||
|
||||
$purposes = (object) [
|
||||
|
@ -2321,7 +2321,7 @@ class api_test extends \advanced_testcase {
|
|||
* @param int $status
|
||||
* @return \tool_dataprivacy\data_request
|
||||
*/
|
||||
protected function create_request_with_type_and_status(int $userid, int $type, int $status) : \tool_dataprivacy\data_request {
|
||||
protected function create_request_with_type_and_status(int $userid, int $type, int $status): \tool_dataprivacy\data_request {
|
||||
$request = new \tool_dataprivacy\data_request(0, (object) [
|
||||
'userid' => $userid,
|
||||
'type' => $type,
|
||||
|
|
|
@ -35,7 +35,7 @@ class data_request_test extends data_privacy_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function status_state_provider() : array {
|
||||
public function status_state_provider(): array {
|
||||
return [
|
||||
[
|
||||
'state' => api::DATAREQUEST_STATUS_PENDING,
|
||||
|
@ -138,7 +138,7 @@ class data_request_test extends data_privacy_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function non_resettable_provider() : array {
|
||||
public function non_resettable_provider(): array {
|
||||
$states = [];
|
||||
foreach ($this->status_state_provider() as $thisstatus) {
|
||||
if (!$thisstatus['resettable']) {
|
||||
|
@ -221,7 +221,7 @@ class data_request_test extends data_privacy_testcase {
|
|||
* @param int $status
|
||||
* @return data_request
|
||||
*/
|
||||
public function create_request_for_user_with_status(int $userid, int $type, int $status) : data_request {
|
||||
public function create_request_for_user_with_status(int $userid, int $type, int $status): data_request {
|
||||
$request = new data_request(0, (object) [
|
||||
'userid' => $userid,
|
||||
'type' => $type,
|
||||
|
|
|
@ -33,7 +33,7 @@ class expired_contexts_test extends \advanced_testcase {
|
|||
* @param string $course Retention policy for courses.
|
||||
* @param string $activity Retention policy for activities.
|
||||
*/
|
||||
protected function setup_basics(string $system, string $user, string $course = null, string $activity = null) : \stdClass {
|
||||
protected function setup_basics(string $system, string $user, string $course = null, string $activity = null): \stdClass {
|
||||
$this->resetAfterTest();
|
||||
|
||||
$purposes = (object) [
|
||||
|
@ -59,7 +59,7 @@ class expired_contexts_test extends \advanced_testcase {
|
|||
* @param int $contextlevel
|
||||
* @return purpose
|
||||
*/
|
||||
protected function create_and_set_purpose_for_contextlevel(string $retention, int $contextlevel) : purpose {
|
||||
protected function create_and_set_purpose_for_contextlevel(string $retention, int $contextlevel): purpose {
|
||||
$purpose = new purpose(0, (object) [
|
||||
'name' => 'Test purpose ' . rand(1, 1000),
|
||||
'retentionperiod' => $retention,
|
||||
|
@ -1918,7 +1918,7 @@ class expired_contexts_test extends \advanced_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function can_process_deletion_provider() : array {
|
||||
public function can_process_deletion_provider(): array {
|
||||
return [
|
||||
'Pending' => [
|
||||
expired_context::STATUS_EXPIRED,
|
||||
|
@ -1956,7 +1956,7 @@ class expired_contexts_test extends \advanced_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function is_complete_provider() : array {
|
||||
public function is_complete_provider(): array {
|
||||
return [
|
||||
'Pending' => [
|
||||
expired_context::STATUS_EXPIRED,
|
||||
|
@ -1991,7 +1991,7 @@ class expired_contexts_test extends \advanced_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function is_fully_expired_provider() : array {
|
||||
public function is_fully_expired_provider(): array {
|
||||
return [
|
||||
'Fully expired' => [
|
||||
[
|
||||
|
|
|
@ -58,7 +58,7 @@ class filtered_userlist_test extends \advanced_testcase {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function apply_expired_contexts_filters_provider() : array {
|
||||
public function apply_expired_contexts_filters_provider(): array {
|
||||
return [
|
||||
// Entire list should be preserved.
|
||||
'No overrides' => [
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -42,7 +42,7 @@ class locale {
|
|||
* @return bool TRUE if the locale is available on OS.
|
||||
* @throws coding_exception when $langpackcode parameter is a non-empty string.
|
||||
*/
|
||||
public function check_locale_availability(string $langpackcode) : bool {
|
||||
public function check_locale_availability(string $langpackcode): bool {
|
||||
global $CFG;
|
||||
|
||||
if (empty($langpackcode)) {
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -39,7 +39,7 @@ class helper {
|
|||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public static function get_licensemanager_url() : moodle_url {
|
||||
public static function get_licensemanager_url(): moodle_url {
|
||||
return new moodle_url(self::MANAGER_PATH);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ class helper {
|
|||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public static function get_enable_license_url(string $licenseshortname) : moodle_url {
|
||||
public static function get_enable_license_url(string $licenseshortname): moodle_url {
|
||||
$url = new moodle_url(self::MANAGER_PATH,
|
||||
['action' => manager::ACTION_ENABLE, 'license' => $licenseshortname, 'sesskey' => sesskey()]);
|
||||
|
||||
|
@ -64,7 +64,7 @@ class helper {
|
|||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public static function get_disable_license_url(string $licenseshortname) : moodle_url {
|
||||
public static function get_disable_license_url(string $licenseshortname): moodle_url {
|
||||
$url = new moodle_url(self::MANAGER_PATH,
|
||||
['action' => manager::ACTION_DISABLE, 'license' => $licenseshortname, 'sesskey' => sesskey()]);
|
||||
|
||||
|
@ -76,7 +76,7 @@ class helper {
|
|||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public static function get_create_license_url() : moodle_url {
|
||||
public static function get_create_license_url(): moodle_url {
|
||||
$url = self::get_licensemanager_url();
|
||||
$url->params(['action' => manager::ACTION_CREATE]);
|
||||
return $url;
|
||||
|
@ -89,7 +89,7 @@ class helper {
|
|||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public static function get_update_license_url(string $licenseshortname) : moodle_url {
|
||||
public static function get_update_license_url(string $licenseshortname): moodle_url {
|
||||
$url = self::get_licensemanager_url();
|
||||
$url->params(['action' => manager::ACTION_UPDATE, 'license' => $licenseshortname]);
|
||||
return $url;
|
||||
|
@ -102,7 +102,7 @@ class helper {
|
|||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public static function get_moveup_license_url(string $licenseshortname) : moodle_url {
|
||||
public static function get_moveup_license_url(string $licenseshortname): moodle_url {
|
||||
$url = new moodle_url(self::MANAGER_PATH,
|
||||
['action' => manager::ACTION_MOVE_UP, 'license' => $licenseshortname, 'sesskey' => sesskey()]);
|
||||
|
||||
|
@ -116,7 +116,7 @@ class helper {
|
|||
*
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public static function get_movedown_license_url(string $licenseshortname) : moodle_url {
|
||||
public static function get_movedown_license_url(string $licenseshortname): moodle_url {
|
||||
$url = new moodle_url(self::MANAGER_PATH,
|
||||
['action' => manager::ACTION_MOVE_DOWN, 'license' => $licenseshortname, 'sesskey' => sesskey()]);
|
||||
|
||||
|
@ -130,7 +130,7 @@ class helper {
|
|||
*
|
||||
* @return int $epoch
|
||||
*/
|
||||
public static function convert_version_to_epoch(string $version) : int {
|
||||
public static function convert_version_to_epoch(string $version): int {
|
||||
$date = substr($version, 0, 8);
|
||||
$epoch = strtotime($date);
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class manager {
|
|||
* @param string $action the api action to carry out.
|
||||
* @param string|object $license the license object or shortname of license to carry action out on.
|
||||
*/
|
||||
public function execute(string $action, $license) : void {
|
||||
public function execute(string $action, $license): void {
|
||||
|
||||
admin_externalpage_setup('licensemanager');
|
||||
|
||||
|
@ -140,7 +140,7 @@ class manager {
|
|||
*
|
||||
* @return bool true if license editing complete, false otherwise.
|
||||
*/
|
||||
private function edit(string $action, string $licenseshortname) : bool {
|
||||
private function edit(string $action, string $licenseshortname): bool {
|
||||
|
||||
if ($action != self::ACTION_CREATE && $action != self::ACTION_UPDATE) {
|
||||
throw new \coding_exception('license edit actions are limited to create and update');
|
||||
|
@ -190,7 +190,7 @@ class manager {
|
|||
* @param string $direction which direction to move, up or down.
|
||||
* @param string $licenseshortname the shortname of the license to move up or down order.
|
||||
*/
|
||||
private function change_license_order(string $direction, string $licenseshortname) : void {
|
||||
private function change_license_order(string $direction, string $licenseshortname): void {
|
||||
|
||||
if (!empty($licenseshortname)) {
|
||||
if ($direction == self::ACTION_MOVE_UP) {
|
||||
|
@ -208,7 +208,7 @@ class manager {
|
|||
* @param string $licenseshortname the shortname of the license to create/edit.
|
||||
* @param \tool_licensemanager\form\edit_license $form the form for submitting edit data.
|
||||
*/
|
||||
private function view_license_editor(string $action, string $licenseshortname, edit_license $form) : void {
|
||||
private function view_license_editor(string $action, string $licenseshortname, edit_license $form): void {
|
||||
global $PAGE;
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_licensemanager');
|
||||
|
@ -233,7 +233,7 @@ class manager {
|
|||
/**
|
||||
* View the license manager.
|
||||
*/
|
||||
private function view_license_manager(string $message = null) : void {
|
||||
private function view_license_manager(string $message = null): void {
|
||||
global $PAGE, $OUTPUT;
|
||||
|
||||
$renderer = $PAGE->get_renderer('tool_licensemanager');
|
||||
|
|
|
@ -44,7 +44,7 @@ class renderer extends plugin_renderer_base {
|
|||
*
|
||||
* @return string html fragment for display.
|
||||
*/
|
||||
public function render_create_licence_headers() : string {
|
||||
public function render_create_licence_headers(): string {
|
||||
|
||||
$this->page->navbar->add(get_string('createlicense', 'tool_licensemanager'),
|
||||
helper::get_create_license_url());
|
||||
|
@ -62,7 +62,7 @@ class renderer extends plugin_renderer_base {
|
|||
*
|
||||
* @return string html fragment for display.
|
||||
*/
|
||||
public function render_edit_licence_headers(string $licenseshortname) : string {
|
||||
public function render_edit_licence_headers(string $licenseshortname): string {
|
||||
|
||||
$this->page->navbar->add(get_string('editlicense', 'tool_licensemanager'),
|
||||
helper::get_update_license_url($licenseshortname));
|
||||
|
|
|
@ -41,7 +41,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class provider implements
|
|||
* @param collection $collection The initialised collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
$collection->add_plugintype_link('logstore', [], 'privacy:metadata:logstore');
|
||||
return $collection;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ class provider implements
|
|||
* @param int $userid The user to search.
|
||||
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist {
|
||||
$contextlist = new \core_privacy\local\request\contextlist();
|
||||
static::call_subplugins_method_with_args('add_contexts_for_userid', [$contextlist, $userid]);
|
||||
return $contextlist;
|
||||
|
|
|
@ -51,7 +51,7 @@ class provider implements
|
|||
* @param collection $collection The initialised collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
$collection->add_external_location_link('log', [
|
||||
'eventname' => 'privacy:metadata:log:eventname',
|
||||
'userid' => 'privacy:metadata:log:userid',
|
||||
|
|
|
@ -51,7 +51,7 @@ class provider implements
|
|||
* @param collection $collection The initialised collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
$collection->add_database_table('logstore_standard_log', [
|
||||
'eventname' => 'privacy:metadata:log:eventname',
|
||||
'userid' => 'privacy:metadata:log:userid',
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -54,7 +54,7 @@ class provider implements
|
|||
* @param collection $collection The initialised collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
|
||||
$collection->add_database_table('messageinbound_messagelist', [
|
||||
'messageid' => 'privacy:metadata:messagelist:messageid',
|
||||
|
@ -75,7 +75,7 @@ class provider implements
|
|||
* @param int $userid The user to search.
|
||||
* @return \contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : \core_privacy\local\request\contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): \core_privacy\local\request\contextlist {
|
||||
$contextlist = new \core_privacy\local\request\contextlist();
|
||||
|
||||
// Always add the user context so we're sure we're not dodging user keys, besides it's not costly to do so.
|
||||
|
|
|
@ -60,7 +60,7 @@ class helper {
|
|||
* @param string $phonenumber from the given user input
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_valid_phonenumber(string $phonenumber) : bool {
|
||||
public static function is_valid_phonenumber(string $phonenumber): bool {
|
||||
$phonenumber = self::format_number($phonenumber);
|
||||
return (preg_match("/^\+[1-9]\d{1,14}$/", $phonenumber)) ? true : false;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -789,7 +789,7 @@ class api {
|
|||
*
|
||||
* @return array Subscription information
|
||||
*/
|
||||
public static function get_subscription_information() : ?array {
|
||||
public static function get_subscription_information(): ?array {
|
||||
global $CFG;
|
||||
|
||||
// Use session cache to prevent multiple requests.
|
||||
|
|
|
@ -47,7 +47,7 @@ class provider implements
|
|||
* @param collection $collection The initialised item collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
// There is a one user preference.
|
||||
$collection->add_user_preference('tool_mobile_autologin_request_last',
|
||||
'privacy:metadata:preference:tool_mobile_autologin_request_last');
|
||||
|
@ -61,7 +61,7 @@ class provider implements
|
|||
* @param int $userid The user to search.
|
||||
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
$sql = "SELECT ctx.id
|
||||
FROM {user_private_key} k
|
||||
JOIN {user} u ON k.userid = u.id
|
||||
|
|
|
@ -52,7 +52,7 @@ class provider implements
|
|||
* @param collection $collection An object for storing metadata.
|
||||
* @return collection The metadata.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
$toolmonitorrules = [
|
||||
'description' => 'privacy:metadata:description',
|
||||
'name' => 'privacy:metadata:name',
|
||||
|
@ -90,7 +90,7 @@ class provider implements
|
|||
* @param int $userid The user ID.
|
||||
* @return contextlist The list of context IDs.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
$params = ['useridrules' => $userid, 'useridsubscriptions' => $userid, 'contextuserrule' => CONTEXT_USER,
|
||||
'contextusersub' => CONTEXT_USER];
|
||||
$sql = "SELECT DISTINCT ctx.id
|
||||
|
|
|
@ -40,7 +40,7 @@ class rule_form extends \moodleform {
|
|||
* Mform class definition
|
||||
*
|
||||
*/
|
||||
public function definition () {
|
||||
public function definition() {
|
||||
global $PAGE;
|
||||
|
||||
$mform = $this->_form;
|
||||
|
|
|
@ -38,7 +38,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ class provider implements
|
|||
* @param collection $collection The initialised collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $collection) : collection {
|
||||
public static function get_metadata(collection $collection): collection {
|
||||
$collection->add_database_table(
|
||||
'tool_policy_acceptances',
|
||||
[
|
||||
|
@ -104,7 +104,7 @@ class provider implements
|
|||
* @param int $userid The userid.
|
||||
* @return contextlist The list of contexts containing user info for the user.
|
||||
*/
|
||||
public static function get_contexts_for_userid(int $userid) : contextlist {
|
||||
public static function get_contexts_for_userid(int $userid): contextlist {
|
||||
$contextlist = new contextlist();
|
||||
|
||||
// Policies a user has modified.
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die();
|
|||
require_once($CFG->libdir . '/formslib.php');
|
||||
|
||||
class profiling_import_form extends moodleform {
|
||||
public function definition () {
|
||||
public function definition() {
|
||||
global $CFG;
|
||||
|
||||
$mform = $this->_form;
|
||||
|
|
|
@ -47,33 +47,33 @@ abstract class base_bin {
|
|||
*
|
||||
* @param int $itemid Item ID to retrieve.
|
||||
*/
|
||||
public abstract function get_item($itemid);
|
||||
abstract public function get_item($itemid);
|
||||
|
||||
/**
|
||||
* Returns a list of items in the recycle bin.
|
||||
*/
|
||||
public abstract function get_items();
|
||||
abstract public function get_items();
|
||||
|
||||
/**
|
||||
* Store an item in this recycle bin.
|
||||
*
|
||||
* @param \stdClass $item Item to store.
|
||||
*/
|
||||
public abstract function store_item($item);
|
||||
abstract public function store_item($item);
|
||||
|
||||
/**
|
||||
* Restore an item from the recycle bin.
|
||||
*
|
||||
* @param \stdClass $item The item database record
|
||||
*/
|
||||
public abstract function restore_item($item);
|
||||
abstract public function restore_item($item);
|
||||
|
||||
/**
|
||||
* Delete an item from the recycle bin.
|
||||
*
|
||||
* @param \stdClass $item The item database record
|
||||
*/
|
||||
public abstract function delete_item($item);
|
||||
abstract public function delete_item($item);
|
||||
|
||||
/**
|
||||
* Empty the recycle bin.
|
||||
|
@ -91,15 +91,15 @@ abstract class base_bin {
|
|||
/**
|
||||
* Can we view items in this recycle bin?
|
||||
*/
|
||||
public abstract function can_view();
|
||||
abstract public function can_view();
|
||||
|
||||
/**
|
||||
* Can we restore items in this recycle bin?
|
||||
*/
|
||||
public abstract function can_restore();
|
||||
abstract public function can_restore();
|
||||
|
||||
/**
|
||||
* Can we delete this?
|
||||
*/
|
||||
public abstract function can_delete();
|
||||
abstract public function can_delete();
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ class adhocqueue extends check {
|
|||
* Return result
|
||||
* @return result
|
||||
*/
|
||||
public function get_result() : result {
|
||||
public function get_result(): result {
|
||||
global $DB, $CFG;
|
||||
|
||||
$stats = $DB->get_record_sql('
|
||||
|
|
|
@ -52,7 +52,7 @@ class cronrunning extends check {
|
|||
* Return result
|
||||
* @return result
|
||||
*/
|
||||
public function get_result() : result {
|
||||
public function get_result(): result {
|
||||
global $CFG;
|
||||
|
||||
// Eventually this should replace cron_overdue_warning and
|
||||
|
|
|
@ -52,7 +52,7 @@ class maxfaildelay extends check {
|
|||
* Return result
|
||||
* @return result
|
||||
*/
|
||||
public function get_result() : result {
|
||||
public function get_result(): result {
|
||||
global $CFG;
|
||||
|
||||
$status = result::OK;
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -85,7 +85,7 @@ class running_tasks_table extends \table_sql {
|
|||
* @param \stdClass $row
|
||||
* @return string
|
||||
*/
|
||||
public function col_classname($row) : string {
|
||||
public function col_classname($row): string {
|
||||
$output = $row->classname;
|
||||
if ($row->type == 'scheduled') {
|
||||
if (class_exists($row->classname)) {
|
||||
|
@ -108,7 +108,7 @@ class running_tasks_table extends \table_sql {
|
|||
* @return string
|
||||
* @throws \coding_exception
|
||||
*/
|
||||
public function col_type($row) : string {
|
||||
public function col_type($row): string {
|
||||
if ($row->type == 'scheduled') {
|
||||
$output = \html_writer::span(get_string('scheduled', 'tool_task'), 'badge bg-primary text-white');
|
||||
} else if ($row->type == 'adhoc') {
|
||||
|
@ -126,7 +126,7 @@ class running_tasks_table extends \table_sql {
|
|||
* @param \stdClass $row
|
||||
* @return string
|
||||
*/
|
||||
public function col_time($row) : string {
|
||||
public function col_time($row): string {
|
||||
global $OUTPUT;
|
||||
|
||||
$taskmethod = "{$row->type}_task_from_record";
|
||||
|
@ -150,7 +150,7 @@ class running_tasks_table extends \table_sql {
|
|||
* @param \stdClass $row
|
||||
* @return string
|
||||
*/
|
||||
public function col_timestarted($row) : string {
|
||||
public function col_timestarted($row): string {
|
||||
return userdate($row->timestarted);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die();
|
|||
*
|
||||
* @return array of check objects
|
||||
*/
|
||||
function tool_task_status_checks() : array {
|
||||
function tool_task_status_checks(): array {
|
||||
return [
|
||||
new \tool_task\check\cronrunning(),
|
||||
new \tool_task\check\maxfaildelay(),
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -1199,7 +1199,7 @@ class tool_uploadcourse_course {
|
|||
* @param int $roleid Role ID.
|
||||
* @return bool
|
||||
*/
|
||||
protected function validate_role_context(int $courseid, int $roleid) : bool {
|
||||
protected function validate_role_context(int $courseid, int $roleid): bool {
|
||||
if (empty($this->assignableroles[$courseid])) {
|
||||
$coursecontext = \context_course::instance($courseid);
|
||||
$this->assignableroles[$courseid] = get_assignable_roles($coursecontext, ROLENAME_SHORT);
|
||||
|
@ -1216,7 +1216,7 @@ class tool_uploadcourse_course {
|
|||
* @param int $roleid Role ID.
|
||||
* @return bool
|
||||
*/
|
||||
protected function validate_role_context_level(int $roleid) : bool {
|
||||
protected function validate_role_context_level(int $roleid): bool {
|
||||
if (empty($this->contextlevels[$roleid])) {
|
||||
$this->contextlevels[$roleid] = get_role_contextlevels($roleid);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -39,7 +39,7 @@ class tool_uploadcourse_step1_form extends tool_uploadcourse_base_form {
|
|||
* The standard form definiton.
|
||||
* @return void
|
||||
*/
|
||||
public function definition () {
|
||||
public function definition() {
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('header', 'generalhdr', get_string('general'));
|
||||
|
|
|
@ -39,7 +39,7 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
|
|||
* The standard form definiton.
|
||||
* @return void.
|
||||
*/
|
||||
public function definition () {
|
||||
public function definition() {
|
||||
global $CFG;
|
||||
|
||||
$mform = $this->_form;
|
||||
|
|
|
@ -1739,7 +1739,7 @@ class course_test extends \advanced_testcase {
|
|||
*
|
||||
* @return core_customfield_generator
|
||||
*/
|
||||
protected function get_customfield_generator() : \core_customfield_generator {
|
||||
protected function get_customfield_generator(): \core_customfield_generator {
|
||||
return $this->getDataGenerator()->get_plugin_generator('core_customfield');
|
||||
}
|
||||
|
||||
|
@ -1753,7 +1753,7 @@ class course_test extends \advanced_testcase {
|
|||
* @return \core_customfield\field_controller
|
||||
*/
|
||||
protected function create_custom_field(\core_customfield\category_controller $category, string $type, string $shortname,
|
||||
array $configdata = []) : \core_customfield\field_controller {
|
||||
array $configdata = []): \core_customfield\field_controller {
|
||||
|
||||
return $this->get_customfield_generator()->create_field([
|
||||
'categoryid' => $category->get('id'),
|
||||
|
|
|
@ -470,7 +470,7 @@ class helper_test extends \advanced_testcase {
|
|||
*
|
||||
* @return core_customfield_generator
|
||||
*/
|
||||
protected function get_customfield_generator() : \core_customfield_generator {
|
||||
protected function get_customfield_generator(): \core_customfield_generator {
|
||||
return $this->getDataGenerator()->get_plugin_generator('core_customfield');
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,7 @@ class helper_test extends \advanced_testcase {
|
|||
* @return \core_customfield\field_controller
|
||||
*/
|
||||
protected function create_custom_field(\core_customfield\category_controller $category, string $type, string $shortname,
|
||||
array $configdata = []) : \core_customfield\field_controller {
|
||||
array $configdata = []): \core_customfield\field_controller {
|
||||
|
||||
return $this->get_customfield_generator()->create_field([
|
||||
'categoryid' => $category->get('id'),
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die();
|
|||
require_once $CFG->libdir.'/formslib.php';
|
||||
|
||||
class admin_uploadpicture_form extends moodleform {
|
||||
function definition (){
|
||||
function definition(){
|
||||
global $CFG, $USER;
|
||||
|
||||
$mform =& $this->_form;
|
||||
|
|
|
@ -35,7 +35,7 @@ require_once($CFG->dirroot . '/user/editlib.php');
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_uploaduser_form1 extends moodleform {
|
||||
function definition () {
|
||||
function definition() {
|
||||
$mform = $this->_form;
|
||||
|
||||
$mform->addElement('header', 'settingsheader', get_string('upload'));
|
||||
|
@ -90,7 +90,7 @@ class admin_uploaduser_form1 extends moodleform {
|
|||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_uploaduser_form2 extends moodleform {
|
||||
function definition () {
|
||||
function definition() {
|
||||
global $CFG, $USER;
|
||||
|
||||
$mform = $this->_form;
|
||||
|
|
|
@ -46,7 +46,7 @@ class tour implements \renderable {
|
|||
*
|
||||
* @param toursource $tour The tour being output.
|
||||
*/
|
||||
public function __construct (toursource $tour) {
|
||||
public function __construct(toursource $tour) {
|
||||
$this->tour = $tour;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class provider implements
|
|||
* @param collection $items The initialised item collection to add items to.
|
||||
* @return collection A listing of user data stored through this system.
|
||||
*/
|
||||
public static function get_metadata(collection $items) : collection {
|
||||
public static function get_metadata(collection $items): collection {
|
||||
// There are several user preferences.
|
||||
$items->add_user_preference(\tool_usertours\tour::TOUR_REQUESTED_BY_USER, 'privacy:metadata:preference:requested');
|
||||
$items->add_user_preference(\tool_usertours\tour::TOUR_LAST_COMPLETED_BY_USER, 'privacy:metadata:preference:completed');
|
||||
|
|
|
@ -40,7 +40,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_reason() : string {
|
||||
public static function get_reason(): string {
|
||||
return 'privacy:metadata';
|
||||
}
|
||||
}
|
|
@ -40,7 +40,7 @@ abstract class webservice_test_client_base_form extends moodleform {
|
|||
/**
|
||||
* Definition of the parameters used by this WS function
|
||||
*/
|
||||
protected abstract function test_client_definition();
|
||||
abstract protected function test_client_definition();
|
||||
|
||||
/**
|
||||
* The form definition.
|
||||
|
|
|
@ -79,7 +79,7 @@ abstract class calculable {
|
|||
*
|
||||
* @return \lang_string
|
||||
*/
|
||||
public static abstract function get_name() : \lang_string;
|
||||
abstract public static function get_name(): \lang_string;
|
||||
|
||||
/**
|
||||
* The class id is the calculable class full qualified class name.
|
||||
|
@ -160,7 +160,7 @@ abstract class calculable {
|
|||
* @param array $info The data. Indexed by an id unique across the site. E.g. an activity id.
|
||||
* @return null
|
||||
*/
|
||||
protected final function add_shared_calculation_info(int $sampleid, array $info) {
|
||||
final protected function add_shared_calculation_info(int $sampleid, array $info) {
|
||||
if (is_null($this->calculationinfo)) {
|
||||
// Lazy loading.
|
||||
$this->calculationinfo = new \core_analytics\calculation_info();
|
||||
|
@ -178,7 +178,7 @@ abstract class calculable {
|
|||
* @param int $rangeindex
|
||||
* @return null
|
||||
*/
|
||||
public final function save_calculation_info(\core_analytics\local\time_splitting\base $timesplitting, int $rangeindex) {
|
||||
final public function save_calculation_info(\core_analytics\local\time_splitting\base $timesplitting, int $rangeindex) {
|
||||
if (!is_null($this->calculationinfo)) {
|
||||
$this->calculationinfo->save($this, $timesplitting, $rangeindex);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ abstract class binary extends discrete {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public static final function get_classes() {
|
||||
final public static function get_classes() {
|
||||
return [-1, 1];
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ abstract class community_of_inquiry_activity extends linear {
|
|||
*
|
||||
* @var string The activity name (e.g. assign or quiz)
|
||||
*/
|
||||
public final function get_activity_type() {
|
||||
final public function get_activity_type() {
|
||||
$class = get_class($this);
|
||||
$package = stristr($class, "\\", true);
|
||||
$type = str_replace("mod_", "", $package);
|
||||
|
@ -197,7 +197,7 @@ abstract class community_of_inquiry_activity extends linear {
|
|||
* @param \stdClass|false $user
|
||||
* @return bool
|
||||
*/
|
||||
protected final function any_log($contextid, $user) {
|
||||
final protected function any_log($contextid, $user) {
|
||||
if (empty($this->activitylogs[$contextid])) {
|
||||
return false;
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ abstract class community_of_inquiry_activity extends linear {
|
|||
* @param \stdClass|false $user
|
||||
* @return bool
|
||||
*/
|
||||
protected final function any_write_log($contextid, $user) {
|
||||
final protected function any_write_log($contextid, $user) {
|
||||
if (empty($this->activitylogs[$contextid])) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ abstract class binary extends discrete {
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public static final function get_classes() {
|
||||
final public static function get_classes() {
|
||||
return array(0, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ abstract class base {
|
|||
*
|
||||
* @return \lang_string
|
||||
*/
|
||||
public static abstract function get_name() : \lang_string;
|
||||
abstract public static function get_name(): \lang_string;
|
||||
|
||||
/**
|
||||
* Returns the time splitting method id.
|
||||
|
@ -231,7 +231,7 @@ abstract class base {
|
|||
* @param int $rangeindex
|
||||
* @return string
|
||||
*/
|
||||
public final function append_rangeindex($sampleid, $rangeindex) {
|
||||
final public function append_rangeindex($sampleid, $rangeindex) {
|
||||
return $sampleid . '-' . $rangeindex;
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,7 @@ abstract class base {
|
|||
* @param string $uniquesampleid
|
||||
* @return array array($sampleid, $rangeindex)
|
||||
*/
|
||||
public final function infer_sample_info($uniquesampleid) {
|
||||
final public function infer_sample_info($uniquesampleid) {
|
||||
return explode('-', $uniquesampleid);
|
||||
}
|
||||
|
||||
|
|
|
@ -357,7 +357,7 @@ class manager {
|
|||
*
|
||||
* @return \core_analytics\local\target\base[]
|
||||
*/
|
||||
public static function get_all_targets() : array {
|
||||
public static function get_all_targets(): array {
|
||||
if (self::$alltargets !== null) {
|
||||
return self::$alltargets;
|
||||
}
|
||||
|
@ -909,7 +909,7 @@ class manager {
|
|||
* @param array $model Model declaration
|
||||
* @return string complying with PARAM_ALPHANUM rules and starting with an 'id' prefix
|
||||
*/
|
||||
public static function model_declaration_identifier(array $model) : string {
|
||||
public static function model_declaration_identifier(array $model): string {
|
||||
return 'id'.sha1(serialize($model));
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue