MDL-61899 tool_dataprivacy: Fix cibot complains

This commit is contained in:
David Monllao 2018-04-17 13:35:52 +02:00 committed by Eloy Lafuente (stronk7)
parent 0d41df6b5a
commit bb4030ff27
8 changed files with 11 additions and 14 deletions

View File

@ -86,4 +86,4 @@ define(['jquery', 'core/url', 'core/str'], function($, url, str) {
});
}
};
});
});

View File

@ -59,7 +59,6 @@ class data_registry {
/**
* Returns purpose and category var names from a context class name
*
* @access private
* @param string $classname
* @return string[]
*/
@ -75,7 +74,6 @@ class data_registry {
*
* The caller code is responsible of checking that $contextlevel is an integer.
*
* @access private
* @param int $contextlevel
* @return int|false[]
*/
@ -102,7 +100,6 @@ class data_registry {
*
* At least the system defaults need to be set.
*
* @access private
* @return bool
*/
public static function defaults_set() {
@ -116,7 +113,6 @@ class data_registry {
/**
* Returns all site categories that are visible to the current user.
*
* @access private
* @return \coursecat[]
*/
public static function get_site_categories() {
@ -144,7 +140,6 @@ class data_registry {
* Important to note that it returns course-level assigned roles
* if the provided context level is below course.
*
* @access private
* @param \context $context
* @return array
*/
@ -169,7 +164,6 @@ class data_registry {
/**
* Returns the effective value given a context instance
*
* @access private
* @param \context $context
* @param string $element 'category' or 'purpose'
* @param int|false $forcedvalue Use this value as if this was this context instance value.

View File

@ -22,6 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace tool_dataprivacy\local;
defined('MOODLE_INTERNAL') || die();
use coding_exception;
use moodle_exception;

View File

@ -41,6 +41,8 @@ class data_registry_compliance_page implements renderable, templatable {
/**
* Constructor.
*
* @param array $metadata
*/
public function __construct($metadata) {
$this->metadata = $metadata;

View File

@ -94,7 +94,7 @@ class renderer extends plugin_renderer_base {
/**
* Render the data compliance registry.
*
* @param data_registry_page $page
* @param data_registry_compliance_page $page
* @return string html for the page
* @throws moodle_exception
*/

View File

@ -80,8 +80,8 @@ class provider implements
* @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin.
*/
public static function get_contexts_for_userid(int $userid) : contextlist {
$sql = "SELECT id
FROM {context}
$sql = "SELECT id
FROM {context}
WHERE instanceid = :userid
AND contextlevel = :contextlevel";
@ -136,7 +136,7 @@ class provider implements
$contextdatatowrite[] = $data;
}
// {User context} / Privacy and policies / Data requests.
// User context / Privacy and policies / Data requests.
$subcontext = [
get_string('privacyandpolicies', 'admin'),
get_string('datarequests', 'tool_dataprivacy'),

View File

@ -57,8 +57,8 @@ class request_contextlist extends persistent {
/**
* Creates a new relation, but does not persist it.
*
* @param $requestid
* @param $contextlistid
* @param int $requestid
* @param int $contextlistid
* @return $this
* @throws \coding_exception
*/

View File

@ -107,7 +107,7 @@ class process_data_request_task extends adhoc_task {
// Get the collection of approved_contextlist objects needed for core_privacy data deletion.
$approvedclcollection = api::get_approved_contextlist_collection_for_request($requestpersistent);
// Delete the data
// Delete the data.
$manager = new \core_privacy\manager();
$manager->delete_data_for_user($approvedclcollection);
}