From f10786bfb0dff66cfeb8d9f98d042d23bc314369 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 20 Feb 2018 14:38:36 +0400 Subject: Update function 'local_webhooks_create_record' --- externallib.php | 9 ++++----- lib.php | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/externallib.php b/externallib.php index 39f06e3..0c5cc3d 100644 --- a/externallib.php +++ b/externallib.php @@ -388,8 +388,8 @@ class local_webhooks_external extends external_api { /** * Create an entry in the database. * - * @param array $service - * @return number + * @param array $service + * @return boolean * @since Moodle 2.9 Options available * @since Moodle 2.2 */ @@ -413,8 +413,7 @@ class local_webhooks_external extends external_api { $record->events[$value["name"]] = $value["value"]; } - $result = local_webhooks_create_record($record); - return $result; + return local_webhooks_create_record($record); } /** @@ -424,7 +423,7 @@ class local_webhooks_external extends external_api { * @since Moodle 2.2 */ public static function create_record_returns() { - return new external_value(PARAM_INT, "Service identifier."); + return new external_value(PARAM_BOOL, "The result of the operation."); } /** diff --git a/lib.php b/lib.php index 9c82e2c..331ffbd 100644 --- a/lib.php +++ b/lib.php @@ -123,8 +123,8 @@ function local_webhooks_get_list_events() { /** * Create an entry in the database. * - * @param object $record - * @return number + * @param object $record + * @return boolean */ function local_webhooks_create_record($record) { global $DB; @@ -141,7 +141,7 @@ function local_webhooks_create_record($record) { /* Event notification */ local_webhooks_events::service_added($result); - return $result; + return boolval($result); } /** -- cgit v1.2.3