Skip to content

Commit a925cb7

Browse files
committed
Adhere to Moodle code checker.
1 parent b790e64 commit a925cb7

14 files changed

+24
-4
lines changed

classes/ai_manager_utils.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ class ai_manager_utils {
5555
* @param bool $includedeleted if log entries which are marked as deleted, should be included in the result
5656
* @param string $fields Comma separated list of SQL fields that should be contained in the result, defaults to all fields
5757
* @param array $purposes Array of purpose name strings that should be returned. If empty, all purposes will be returned.
58+
* @param int $limit the maximum number of records to return, sorted by timecreated descending.
59+
* If 0, all records will be returned.
5860
* @return array array of records of the log table
5961
*/
6062
public static function get_log_entries(
@@ -122,8 +124,7 @@ public static function get_log_entries(
122124
/**
123125
* Retrieves the entries from the request_log table and structures it for delivering them to the "view prompts" table.
124126
*
125-
* External function that delivers this data: @param int $contextid The main context id the prompts should be retrieved
126-
*
127+
* @param int $contextid the main context id the prompts should be retrieved for
127128
* @param int $userid the id of the user to retrieve the prompts
128129
* @param int $time the time since when the prompts should be retrieved
129130
* @return array complex structured array containing the prompts
@@ -309,7 +310,9 @@ public static function get_connector_instance_by_purpose(string $purpose, ?int $
309310
* API function to get all needed information about the AI configuration for a user.
310311
*
311312
* @param stdClass $user the user to retrieve the information for
313+
* @param int $contextid the contextid on which the availability should be determined
312314
* @param ?string $tenant the tenant to retrieve the information for. If null, the current tenant will be used
315+
* @param ?array $selectedpurposes array of purpose strings to check. If empty all purposes will be checked
313316
* @return array complex associative array containing all the needed configurations
314317
*/
315318
public static function get_ai_config(

classes/base_purpose.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function format_output(string $output): string {
182182
* Formats the given prompt text based on the provided sanitized options.
183183
*
184184
* @param string $prompttext The prompt text to be formatted.
185-
* @param array $sanitizedoptions An array of sanitized options for formatting.
185+
* @param request_options $requestoptions The request_options object containing the request options.
186186
*
187187
* @return string The formatted prompt text as string.
188188
*/

classes/external/get_ai_config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public static function execute_parameters(): external_function_parameters {
7070
* Retrieve the purpose config.
7171
*
7272
* @param ?string $tenant the tenant to use, only useful for accounts which can access/manage more than their own tenant
73+
* @param int $contextid the contextid for which the config should be retrieved, if 0 the system context is used
74+
* @param ?array $purposes if set, only the config for the given purposes
7375
* @return array associative array containing the result of the request
7476
*/
7577
public static function execute(?string $tenant = null, int $contextid = 0, ?array $purposes = null): array {

classes/external/get_prompts.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public static function execute_parameters(): external_function_parameters {
6262
* @param int $contextid The context in which the prompts should be retrieved, should either be a course context or below or a
6363
* tenant context
6464
* @param int $userid The id of the user to retrieve the prompts for
65+
* @param int $time The unix time stamp since when prompts should be retrieved, if 0 all prompts will be retrieved
6566
*
6667
* @return array associative array containing the result of the request
6768
*/

classes/external/submit_query.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public static function execute_parameters(): external_function_parameters {
5555
*
5656
* @param string $purpose the purpose to use
5757
* @param string $prompt the user's prompt
58+
* @param string $component the component from which the request is being made, e.g. 'mod_forum'
59+
* @param int $contextid the context id of the context from which the request is
5860
* @param string $options additional options which should be passed to the request to the AI tool
5961
* @return array associative array containing the result of the request
6062
*/

classes/external/vertex_cache_status.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public static function execute_parameters(): external_function_parameters {
5959
* Retrieve the purpose config.
6060
*
6161
* @param string $serviceaccountinfo The service account info stringified JSON
62+
* @param bool|null $newstatus The new status to set the caching config to
6263
* @return array associative array containing the result of the request
6364
*/
6465
public static function execute(string $serviceaccountinfo, ?bool $newstatus = null): array {

classes/hook/purpose_usage.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class purpose_usage {
4545
/**
4646
* Getter for the component/plugin display name.
4747
*
48+
* @param string $component The component for which the display name should be retrieved
4849
* @return string The localized display name of the component
4950
*/
5051
public function get_component_displayname(string $component): string {

classes/local/aitool_option_temperature.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class aitool_option_temperature {
3131
* Extends the form definition of the edit instance form by adding the temperature option.
3232
*
3333
* @param \MoodleQuickForm $mform the mform object
34+
* @param array $modelswithouttemperature array with model names for which the temperature option should be hidden
3435
*/
3536
public static function extend_form_definition(\MoodleQuickForm $mform, array $modelswithouttemperature = []): void {
3637
$radioarray = [];

classes/local/aitool_option_vertexai_authhandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
class aitool_option_vertexai_authhandler {
3232
/**
3333
* Constructor for the auth handler.
34+
*
35+
* @param int $instanceid The ID of the instance being used. Will be used as key for the cache handling.
36+
* @param string $serviceaccountinfo The serviceaccountinfo stringified JSON
3437
*/
3538
public function __construct(
3639
/** @var int The ID of the instance being used. Will be used as key for the cache handling. */

classes/local/view_prompts_table.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class view_prompts_table extends table_sql {
4545
* @param string $uniqid a unique id to use for the table
4646
* @param tenant $tenant the tenant to display the table for
4747
* @param moodle_url $baseurl the current base url on which the table is being displayed
48+
* @param \context $context the context in which the table is being displayed
4849
*/
4950
public function __construct(
5051
string $uniqid,

0 commit comments

Comments
 (0)