From bb4030ff27227e601bb056b7e3340ecc7c0373ff Mon Sep 17 00:00:00 2001 From: David Monllao Date: Tue, 17 Apr 2018 13:35:52 +0200 Subject: [PATCH] MDL-61899 tool_dataprivacy: Fix cibot complains --- admin/tool/dataprivacy/amd/src/expand_contract.js | 2 +- admin/tool/dataprivacy/classes/data_registry.php | 6 ------ admin/tool/dataprivacy/classes/local/helper.php | 1 + .../classes/output/data_registry_compliance_page.php | 2 ++ admin/tool/dataprivacy/classes/output/renderer.php | 2 +- admin/tool/dataprivacy/classes/privacy/provider.php | 6 +++--- admin/tool/dataprivacy/classes/request_contextlist.php | 4 ++-- .../dataprivacy/classes/task/process_data_request_task.php | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/admin/tool/dataprivacy/amd/src/expand_contract.js b/admin/tool/dataprivacy/amd/src/expand_contract.js index ad48c8796f8..41b7e506eaf 100644 --- a/admin/tool/dataprivacy/amd/src/expand_contract.js +++ b/admin/tool/dataprivacy/amd/src/expand_contract.js @@ -86,4 +86,4 @@ define(['jquery', 'core/url', 'core/str'], function($, url, str) { }); } }; -}); \ No newline at end of file +}); diff --git a/admin/tool/dataprivacy/classes/data_registry.php b/admin/tool/dataprivacy/classes/data_registry.php index 57ca421f2e1..cdf9de11e46 100644 --- a/admin/tool/dataprivacy/classes/data_registry.php +++ b/admin/tool/dataprivacy/classes/data_registry.php @@ -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. diff --git a/admin/tool/dataprivacy/classes/local/helper.php b/admin/tool/dataprivacy/classes/local/helper.php index bf5254b554c..77664b8c42b 100644 --- a/admin/tool/dataprivacy/classes/local/helper.php +++ b/admin/tool/dataprivacy/classes/local/helper.php @@ -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; diff --git a/admin/tool/dataprivacy/classes/output/data_registry_compliance_page.php b/admin/tool/dataprivacy/classes/output/data_registry_compliance_page.php index e34468c4534..58665811cfa 100644 --- a/admin/tool/dataprivacy/classes/output/data_registry_compliance_page.php +++ b/admin/tool/dataprivacy/classes/output/data_registry_compliance_page.php @@ -41,6 +41,8 @@ class data_registry_compliance_page implements renderable, templatable { /** * Constructor. + * + * @param array $metadata */ public function __construct($metadata) { $this->metadata = $metadata; diff --git a/admin/tool/dataprivacy/classes/output/renderer.php b/admin/tool/dataprivacy/classes/output/renderer.php index 3c857bb35ce..3199777e6e5 100644 --- a/admin/tool/dataprivacy/classes/output/renderer.php +++ b/admin/tool/dataprivacy/classes/output/renderer.php @@ -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 */ diff --git a/admin/tool/dataprivacy/classes/privacy/provider.php b/admin/tool/dataprivacy/classes/privacy/provider.php index 05a2562db6b..59ca8c89822 100644 --- a/admin/tool/dataprivacy/classes/privacy/provider.php +++ b/admin/tool/dataprivacy/classes/privacy/provider.php @@ -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'), diff --git a/admin/tool/dataprivacy/classes/request_contextlist.php b/admin/tool/dataprivacy/classes/request_contextlist.php index bd757426b42..5764b7e11f8 100644 --- a/admin/tool/dataprivacy/classes/request_contextlist.php +++ b/admin/tool/dataprivacy/classes/request_contextlist.php @@ -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 */ diff --git a/admin/tool/dataprivacy/classes/task/process_data_request_task.php b/admin/tool/dataprivacy/classes/task/process_data_request_task.php index 9a471d6bd70..6148f0100c0 100644 --- a/admin/tool/dataprivacy/classes/task/process_data_request_task.php +++ b/admin/tool/dataprivacy/classes/task/process_data_request_task.php @@ -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); }