From 7e00aa725a7aff16ecad6e664c7ac15eeb310995 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 15 Aug 2017 15:39:33 +0800 Subject: [PATCH] MDL-59204 analytics: changed get_name so that it returns a lang_string This was done for indicators, targets and time splitting methods so that we can get the string identifier and component in order to display a help_icon. The functions were also made abstract, removing the default implementation. Indicators, targets and time splitting methods should define this function. --- analytics/classes/calculable.php | 10 ++++------ analytics/classes/local/time_splitting/base.php | 13 +++++++------ .../tests/fixtures/test_indicator_fullname.php | 14 ++++++++++++++ analytics/tests/fixtures/test_indicator_max.php | 14 ++++++++++++++ analytics/tests/fixtures/test_indicator_min.php | 14 ++++++++++++++ analytics/tests/fixtures/test_indicator_random.php | 14 ++++++++++++++ .../fixtures/test_static_target_shortname.php | 14 ++++++++++++++ analytics/tests/fixtures/test_target_shortname.php | 14 ++++++++++++++ course/classes/analytics/indicator/no_teacher.php | 10 ++++++---- .../analytics/indicator/any_access_after_end.php | 10 ++++++---- .../indicator/any_access_before_start.php | 10 ++++++---- .../analytics/indicator/any_write_action.php | 10 ++++++---- lib/classes/analytics/indicator/read_actions.php | 10 ++++++---- lib/classes/analytics/target/course_dropout.php | 10 ++++++---- lib/classes/analytics/target/no_teaching.php | 10 ++++++---- lib/classes/analytics/time_splitting/deciles.php | 12 ++++++++---- .../analytics/time_splitting/deciles_accum.php | 12 ++++++++---- .../analytics/time_splitting/no_splitting.php | 12 ++++++++---- lib/classes/analytics/time_splitting/quarters.php | 12 ++++++++---- .../analytics/time_splitting/quarters_accum.php | 12 ++++++++---- .../analytics/time_splitting/single_range.php | 12 ++++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/cognitive_depth.php | 10 ++++++---- .../classes/analytics/indicator/social_breadth.php | 10 ++++++---- .../analytics/indicator/user_profile_set.php | 10 ++++++---- .../analytics/indicator/user_track_forums.php | 10 ++++++---- 65 files changed, 449 insertions(+), 240 deletions(-) diff --git a/analytics/classes/calculable.php b/analytics/classes/calculable.php index a3e3720d7d4..63ea392e5c1 100644 --- a/analytics/classes/calculable.php +++ b/analytics/classes/calculable.php @@ -66,17 +66,15 @@ abstract class calculable { protected $sampledata = array(); /** - * Returns a visible name for the indicator. + * Returns a lang_string object representing the name for the indicator or target. * * Used as column identificator. * - * Defaults to the indicator class name. + * If there is a corresponding '_help' string this will be shown as well. * - * @return string + * @return \lang_string */ - public static function get_name() { - return '\\' . get_called_class(); - } + public static abstract function get_name() : \lang_string; /** * The class id is the calculable class full qualified class name. diff --git a/analytics/classes/local/time_splitting/base.php b/analytics/classes/local/time_splitting/base.php index 23adfb1f6d1..a5cf7dc5612 100644 --- a/analytics/classes/local/time_splitting/base.php +++ b/analytics/classes/local/time_splitting/base.php @@ -77,14 +77,15 @@ abstract class base { abstract protected function define_ranges(); /** - * The time splitting method name. + * Returns a lang_string object representing the name for the time splitting method. * - * It is very recommendable to overwrite this method as this name appears in the UI. - * @return string + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public function get_name() { - return $this->get_id(); - } + public static abstract function get_name() : \lang_string; /** * Returns the time splitting method id. diff --git a/analytics/tests/fixtures/test_indicator_fullname.php b/analytics/tests/fixtures/test_indicator_fullname.php index 2487407c083..761d40b482b 100644 --- a/analytics/tests/fixtures/test_indicator_fullname.php +++ b/analytics/tests/fixtures/test_indicator_fullname.php @@ -33,6 +33,20 @@ defined('MOODLE_INTERNAL') || die(); */ class test_indicator_fullname extends \core_analytics\local\indicator\linear { + /** + * Returns a lang_string object representing the name for the indicator. + * + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string + */ + public static function get_name() : \lang_string { + // Using a string that exists and contains a corresponding '_help' string. + return new \lang_string('allowstealthmodules'); + } + /** * include_averages * diff --git a/analytics/tests/fixtures/test_indicator_max.php b/analytics/tests/fixtures/test_indicator_max.php index 60102fdc77b..ee506e48b82 100644 --- a/analytics/tests/fixtures/test_indicator_max.php +++ b/analytics/tests/fixtures/test_indicator_max.php @@ -33,6 +33,20 @@ defined('MOODLE_INTERNAL') || die(); */ class test_indicator_max extends \core_analytics\local\indicator\binary { + /** + * Returns a lang_string object representing the name for the indicator. + * + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string + */ + public static function get_name() : \lang_string { + // Using a string that exists and contains a corresponding '_help' string. + return new \lang_string('allowstealthmodules'); + } + /** * calculate_sample * diff --git a/analytics/tests/fixtures/test_indicator_min.php b/analytics/tests/fixtures/test_indicator_min.php index 1d11f59fffa..ba3c33b2380 100644 --- a/analytics/tests/fixtures/test_indicator_min.php +++ b/analytics/tests/fixtures/test_indicator_min.php @@ -33,6 +33,20 @@ defined('MOODLE_INTERNAL') || die(); */ class test_indicator_min extends \core_analytics\local\indicator\binary { + /** + * Returns a lang_string object representing the name for the indicator. + * + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string + */ + public static function get_name() : \lang_string { + // Using a string that exists and contains a corresponding '_help' string. + return new \lang_string('allowstealthmodules'); + } + /** * calculate_sample * diff --git a/analytics/tests/fixtures/test_indicator_random.php b/analytics/tests/fixtures/test_indicator_random.php index a94be7424be..8b934dda8db 100644 --- a/analytics/tests/fixtures/test_indicator_random.php +++ b/analytics/tests/fixtures/test_indicator_random.php @@ -33,6 +33,20 @@ defined('MOODLE_INTERNAL') || die(); */ class test_indicator_random extends \core_analytics\local\indicator\binary { + /** + * Returns a lang_string object representing the name for the indicator. + * + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string + */ + public static function get_name() : \lang_string { + // Using a string that exists and contains a corresponding '_help' string. + return new \lang_string('allowstealthmodules'); + } + /** * calculate_sample * diff --git a/analytics/tests/fixtures/test_static_target_shortname.php b/analytics/tests/fixtures/test_static_target_shortname.php index 015cbcc01b8..59a90bb0ec8 100644 --- a/analytics/tests/fixtures/test_static_target_shortname.php +++ b/analytics/tests/fixtures/test_static_target_shortname.php @@ -38,6 +38,20 @@ require_once(__DIR__ . '/test_target_shortname.php'); */ class test_static_target_shortname extends test_target_shortname { + /** + * Returns a lang_string object representing the name for the indicator. + * + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string + */ + public static function get_name() : \lang_string { + // Using a string that exists and contains a corresponding '_help' string. + return new \lang_string('allowstealthmodules'); + } + /** * based_on_assumptions * diff --git a/analytics/tests/fixtures/test_target_shortname.php b/analytics/tests/fixtures/test_target_shortname.php index 016a59488ee..bd3be06f034 100644 --- a/analytics/tests/fixtures/test_target_shortname.php +++ b/analytics/tests/fixtures/test_target_shortname.php @@ -33,6 +33,20 @@ defined('MOODLE_INTERNAL') || die(); */ class test_target_shortname extends \core_analytics\local\target\binary { + /** + * Returns a lang_string object representing the name for the indicator. + * + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string + */ + public static function get_name() : \lang_string { + // Using a string that exists and contains a corresponding '_help' string. + return new \lang_string('allowstealthmodules'); + } + /** * predictions * diff --git a/course/classes/analytics/indicator/no_teacher.php b/course/classes/analytics/indicator/no_teacher.php index 78e3597d8ba..99051c771dc 100644 --- a/course/classes/analytics/indicator/no_teacher.php +++ b/course/classes/analytics/indicator/no_teacher.php @@ -43,12 +43,14 @@ class no_teacher extends \core_analytics\local\indicator\binary { protected $teacherroleids = null; /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:noteacher', 'moodle'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:noteacher', 'moodle'); } /** diff --git a/lib/classes/analytics/indicator/any_access_after_end.php b/lib/classes/analytics/indicator/any_access_after_end.php index 77adcc28c32..1cab86399b2 100644 --- a/lib/classes/analytics/indicator/any_access_after_end.php +++ b/lib/classes/analytics/indicator/any_access_after_end.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class any_access_after_end extends \core_analytics\local\indicator\binary { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:accessesafterend'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:accessesafterend'); } /** diff --git a/lib/classes/analytics/indicator/any_access_before_start.php b/lib/classes/analytics/indicator/any_access_before_start.php index e5cada01a85..4b30f559486 100644 --- a/lib/classes/analytics/indicator/any_access_before_start.php +++ b/lib/classes/analytics/indicator/any_access_before_start.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class any_access_before_start extends \core_analytics\local\indicator\binary { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:accessesbeforestart'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:accessesbeforestart'); } /** diff --git a/lib/classes/analytics/indicator/any_write_action.php b/lib/classes/analytics/indicator/any_write_action.php index 21aab2cccd6..7a27d16c2e6 100644 --- a/lib/classes/analytics/indicator/any_write_action.php +++ b/lib/classes/analytics/indicator/any_write_action.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class any_write_action extends \core_analytics\local\indicator\binary { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:anywrite'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:anywrite'); } /** diff --git a/lib/classes/analytics/indicator/read_actions.php b/lib/classes/analytics/indicator/read_actions.php index 77641fa7e31..7b9ac397d3a 100644 --- a/lib/classes/analytics/indicator/read_actions.php +++ b/lib/classes/analytics/indicator/read_actions.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class read_actions extends \core_analytics\local\indicator\linear { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:readactions'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:readactions'); } /** diff --git a/lib/classes/analytics/target/course_dropout.php b/lib/classes/analytics/target/course_dropout.php index 8a021eb46fe..855be381043 100644 --- a/lib/classes/analytics/target/course_dropout.php +++ b/lib/classes/analytics/target/course_dropout.php @@ -41,12 +41,14 @@ require_once($CFG->dirroot . '/completion/completion_completion.php'); class course_dropout extends \core_analytics\local\target\binary { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('target:coursedropout'); + public static function get_name() : \lang_string { + return new \lang_string('target:coursedropout'); } /** diff --git a/lib/classes/analytics/target/no_teaching.php b/lib/classes/analytics/target/no_teaching.php index 58f043a79b5..024be61ff98 100644 --- a/lib/classes/analytics/target/no_teaching.php +++ b/lib/classes/analytics/target/no_teaching.php @@ -45,12 +45,14 @@ class no_teaching extends \core_analytics\local\target\binary { } /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('target:noteachingactivity'); + public static function get_name() : \lang_string { + return new \lang_string('target:noteachingactivity'); } /** diff --git a/lib/classes/analytics/time_splitting/deciles.php b/lib/classes/analytics/time_splitting/deciles.php index d9848477ca5..3e21df93349 100644 --- a/lib/classes/analytics/time_splitting/deciles.php +++ b/lib/classes/analytics/time_splitting/deciles.php @@ -36,12 +36,16 @@ defined('MOODLE_INTERNAL') || die(); class deciles extends \core_analytics\local\time_splitting\equal_parts { /** - * get_name + * Returns a lang_string object representing the name for the time splitting method. * - * @return string + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public function get_name() { - return get_string('timesplitting:deciles'); + public static function get_name() : \lang_string { + return new \lang_string('timesplitting:deciles'); } /** diff --git a/lib/classes/analytics/time_splitting/deciles_accum.php b/lib/classes/analytics/time_splitting/deciles_accum.php index afd402872ad..b0ffc58cdf7 100644 --- a/lib/classes/analytics/time_splitting/deciles_accum.php +++ b/lib/classes/analytics/time_splitting/deciles_accum.php @@ -36,12 +36,16 @@ defined('MOODLE_INTERNAL') || die(); class deciles_accum extends \core_analytics\local\time_splitting\accumulative_parts { /** - * get_name + * Returns a lang_string object representing the name for the time splitting method. * - * @return string + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public function get_name() { - return get_string('timesplitting:decilesaccum'); + public static function get_name() : \lang_string { + return new \lang_string('timesplitting:decilesaccum'); } /** diff --git a/lib/classes/analytics/time_splitting/no_splitting.php b/lib/classes/analytics/time_splitting/no_splitting.php index 3a3a4eb4b93..0d2e614eb10 100644 --- a/lib/classes/analytics/time_splitting/no_splitting.php +++ b/lib/classes/analytics/time_splitting/no_splitting.php @@ -40,12 +40,16 @@ defined('MOODLE_INTERNAL') || die(); class no_splitting extends \core_analytics\local\time_splitting\base { /** - * get_name + * Returns a lang_string object representing the name for the time splitting method. * - * @return string + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public function get_name() { - return get_string('timesplitting:nosplitting'); + public static function get_name() : \lang_string { + return new \lang_string('timesplitting:nosplitting'); } /** diff --git a/lib/classes/analytics/time_splitting/quarters.php b/lib/classes/analytics/time_splitting/quarters.php index 91410d2e695..9245f2b9d7a 100644 --- a/lib/classes/analytics/time_splitting/quarters.php +++ b/lib/classes/analytics/time_splitting/quarters.php @@ -36,12 +36,16 @@ defined('MOODLE_INTERNAL') || die(); class quarters extends \core_analytics\local\time_splitting\equal_parts { /** - * get_name + * Returns a lang_string object representing the name for the time spliting method. * - * @return string + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public function get_name() { - return get_string('timesplitting:quarters'); + public static function get_name() : \lang_string { + return new \lang_string('timesplitting:quarters'); } /** diff --git a/lib/classes/analytics/time_splitting/quarters_accum.php b/lib/classes/analytics/time_splitting/quarters_accum.php index 7b07744355e..475c92ddf9b 100644 --- a/lib/classes/analytics/time_splitting/quarters_accum.php +++ b/lib/classes/analytics/time_splitting/quarters_accum.php @@ -36,12 +36,16 @@ defined('MOODLE_INTERNAL') || die(); class quarters_accum extends \core_analytics\local\time_splitting\accumulative_parts { /** - * get_name + * Returns a lang_string object representing the name for the time spliting method. * - * @return string + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public function get_name() { - return get_string('timesplitting:quartersaccum'); + public static function get_name() : \lang_string { + return new \lang_string('timesplitting:quartersaccum'); } /** diff --git a/lib/classes/analytics/time_splitting/single_range.php b/lib/classes/analytics/time_splitting/single_range.php index 6fd49b6f46a..01d9d0dd1f9 100644 --- a/lib/classes/analytics/time_splitting/single_range.php +++ b/lib/classes/analytics/time_splitting/single_range.php @@ -36,12 +36,16 @@ defined('MOODLE_INTERNAL') || die(); class single_range extends \core_analytics\local\time_splitting\base { /** - * get_name + * Returns a lang_string object representing the name for the time spliting method. * - * @return string + * Used as column identificator. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public function get_name() { - return get_string('timesplitting:singlerange'); + public static function get_name() : \lang_string { + return new \lang_string('timesplitting:singlerange'); } /** diff --git a/mod/assign/classes/analytics/indicator/cognitive_depth.php b/mod/assign/classes/analytics/indicator/cognitive_depth.php index e2051470fe0..98aa899c22b 100644 --- a/mod/assign/classes/analytics/indicator/cognitive_depth.php +++ b/mod/assign/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_assign'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_assign'); } /** diff --git a/mod/assign/classes/analytics/indicator/social_breadth.php b/mod/assign/classes/analytics/indicator/social_breadth.php index a728dc99ba4..787428590ea 100644 --- a/mod/assign/classes/analytics/indicator/social_breadth.php +++ b/mod/assign/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_assign'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_assign'); } /** diff --git a/mod/book/classes/analytics/indicator/cognitive_depth.php b/mod/book/classes/analytics/indicator/cognitive_depth.php index 06331c783f1..705a537666f 100644 --- a/mod/book/classes/analytics/indicator/cognitive_depth.php +++ b/mod/book/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_book'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_book'); } /** diff --git a/mod/book/classes/analytics/indicator/social_breadth.php b/mod/book/classes/analytics/indicator/social_breadth.php index 6b0b240f73c..45ec925e8d6 100644 --- a/mod/book/classes/analytics/indicator/social_breadth.php +++ b/mod/book/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_book'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_book'); } /** diff --git a/mod/chat/classes/analytics/indicator/cognitive_depth.php b/mod/chat/classes/analytics/indicator/cognitive_depth.php index 21216d3761f..4cfaa8244bf 100644 --- a/mod/chat/classes/analytics/indicator/cognitive_depth.php +++ b/mod/chat/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_chat'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_chat'); } /** diff --git a/mod/chat/classes/analytics/indicator/social_breadth.php b/mod/chat/classes/analytics/indicator/social_breadth.php index c6f3bc4244e..4d92426784d 100644 --- a/mod/chat/classes/analytics/indicator/social_breadth.php +++ b/mod/chat/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_chat'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_chat'); } /** diff --git a/mod/choice/classes/analytics/indicator/cognitive_depth.php b/mod/choice/classes/analytics/indicator/cognitive_depth.php index bf403edcfc2..f325b0221be 100644 --- a/mod/choice/classes/analytics/indicator/cognitive_depth.php +++ b/mod/choice/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_choice'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_choice'); } /** diff --git a/mod/choice/classes/analytics/indicator/social_breadth.php b/mod/choice/classes/analytics/indicator/social_breadth.php index 1aeceff828b..0afd60195aa 100644 --- a/mod/choice/classes/analytics/indicator/social_breadth.php +++ b/mod/choice/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_choice'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_choice'); } /** diff --git a/mod/data/classes/analytics/indicator/cognitive_depth.php b/mod/data/classes/analytics/indicator/cognitive_depth.php index 03dd9fc888a..29b6fbbdae4 100644 --- a/mod/data/classes/analytics/indicator/cognitive_depth.php +++ b/mod/data/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_data'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_data'); } /** diff --git a/mod/data/classes/analytics/indicator/social_breadth.php b/mod/data/classes/analytics/indicator/social_breadth.php index d9b58ae9f96..0c2da043172 100644 --- a/mod/data/classes/analytics/indicator/social_breadth.php +++ b/mod/data/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_data'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_data'); } /** diff --git a/mod/feedback/classes/analytics/indicator/cognitive_depth.php b/mod/feedback/classes/analytics/indicator/cognitive_depth.php index 59fffaaac9c..93bb252a6e4 100644 --- a/mod/feedback/classes/analytics/indicator/cognitive_depth.php +++ b/mod/feedback/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_feedback'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_feedback'); } /** diff --git a/mod/feedback/classes/analytics/indicator/social_breadth.php b/mod/feedback/classes/analytics/indicator/social_breadth.php index b635c68a961..0ad198e1dca 100644 --- a/mod/feedback/classes/analytics/indicator/social_breadth.php +++ b/mod/feedback/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_feedback'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_feedback'); } /** diff --git a/mod/folder/classes/analytics/indicator/cognitive_depth.php b/mod/folder/classes/analytics/indicator/cognitive_depth.php index 1684b0f8c1a..b3f49daf8f5 100644 --- a/mod/folder/classes/analytics/indicator/cognitive_depth.php +++ b/mod/folder/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_folder'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_folder'); } /** diff --git a/mod/folder/classes/analytics/indicator/social_breadth.php b/mod/folder/classes/analytics/indicator/social_breadth.php index e9aac8b554f..932e162b4b7 100644 --- a/mod/folder/classes/analytics/indicator/social_breadth.php +++ b/mod/folder/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_folder'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_folder'); } /** diff --git a/mod/forum/classes/analytics/indicator/cognitive_depth.php b/mod/forum/classes/analytics/indicator/cognitive_depth.php index 5fec08f814d..8696dfb6e65 100644 --- a/mod/forum/classes/analytics/indicator/cognitive_depth.php +++ b/mod/forum/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_forum'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_forum'); } /** diff --git a/mod/forum/classes/analytics/indicator/social_breadth.php b/mod/forum/classes/analytics/indicator/social_breadth.php index c641dec7aa0..a7508b28ef3 100644 --- a/mod/forum/classes/analytics/indicator/social_breadth.php +++ b/mod/forum/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_forum'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_forum'); } /** diff --git a/mod/glossary/classes/analytics/indicator/cognitive_depth.php b/mod/glossary/classes/analytics/indicator/cognitive_depth.php index da65c9ea474..f7f1b2c2ec2 100644 --- a/mod/glossary/classes/analytics/indicator/cognitive_depth.php +++ b/mod/glossary/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_glossary'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_glossary'); } /** diff --git a/mod/glossary/classes/analytics/indicator/social_breadth.php b/mod/glossary/classes/analytics/indicator/social_breadth.php index 465247a0e25..b1e64b7d32a 100644 --- a/mod/glossary/classes/analytics/indicator/social_breadth.php +++ b/mod/glossary/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_glossary'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_glossary'); } /** diff --git a/mod/imscp/classes/analytics/indicator/cognitive_depth.php b/mod/imscp/classes/analytics/indicator/cognitive_depth.php index 68891296eb7..39fa772a714 100644 --- a/mod/imscp/classes/analytics/indicator/cognitive_depth.php +++ b/mod/imscp/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_imscp'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_imscp'); } /** diff --git a/mod/imscp/classes/analytics/indicator/social_breadth.php b/mod/imscp/classes/analytics/indicator/social_breadth.php index f3ca5a6bf26..953875fe370 100644 --- a/mod/imscp/classes/analytics/indicator/social_breadth.php +++ b/mod/imscp/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_imscp'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_imscp'); } /** diff --git a/mod/label/classes/analytics/indicator/cognitive_depth.php b/mod/label/classes/analytics/indicator/cognitive_depth.php index be6eba11c33..3daa74b533a 100644 --- a/mod/label/classes/analytics/indicator/cognitive_depth.php +++ b/mod/label/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_label'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_label'); } /** diff --git a/mod/label/classes/analytics/indicator/social_breadth.php b/mod/label/classes/analytics/indicator/social_breadth.php index d1ad54a3cab..18afd3f742b 100644 --- a/mod/label/classes/analytics/indicator/social_breadth.php +++ b/mod/label/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_label'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_label'); } /** diff --git a/mod/lesson/classes/analytics/indicator/cognitive_depth.php b/mod/lesson/classes/analytics/indicator/cognitive_depth.php index d128a5c82e6..012d42013a9 100644 --- a/mod/lesson/classes/analytics/indicator/cognitive_depth.php +++ b/mod/lesson/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_lesson'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_lesson'); } /** diff --git a/mod/lesson/classes/analytics/indicator/social_breadth.php b/mod/lesson/classes/analytics/indicator/social_breadth.php index 199964799bd..83fd27a2d51 100644 --- a/mod/lesson/classes/analytics/indicator/social_breadth.php +++ b/mod/lesson/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_lesson'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_lesson'); } /** diff --git a/mod/lti/classes/analytics/indicator/cognitive_depth.php b/mod/lti/classes/analytics/indicator/cognitive_depth.php index 5be637782c8..bcfe466a5c0 100644 --- a/mod/lti/classes/analytics/indicator/cognitive_depth.php +++ b/mod/lti/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_lti'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_lti'); } /** diff --git a/mod/lti/classes/analytics/indicator/social_breadth.php b/mod/lti/classes/analytics/indicator/social_breadth.php index 2e7d61d142d..24e7c5fdbf6 100644 --- a/mod/lti/classes/analytics/indicator/social_breadth.php +++ b/mod/lti/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_lti'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_lti'); } /** diff --git a/mod/page/classes/analytics/indicator/cognitive_depth.php b/mod/page/classes/analytics/indicator/cognitive_depth.php index dd020f98710..b98820447ec 100644 --- a/mod/page/classes/analytics/indicator/cognitive_depth.php +++ b/mod/page/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_page'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_page'); } /** diff --git a/mod/page/classes/analytics/indicator/social_breadth.php b/mod/page/classes/analytics/indicator/social_breadth.php index bb4f4bfea4e..852d348dc96 100644 --- a/mod/page/classes/analytics/indicator/social_breadth.php +++ b/mod/page/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_page'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_page'); } /** diff --git a/mod/quiz/classes/analytics/indicator/cognitive_depth.php b/mod/quiz/classes/analytics/indicator/cognitive_depth.php index c65a5ccb735..86d5155da2f 100644 --- a/mod/quiz/classes/analytics/indicator/cognitive_depth.php +++ b/mod/quiz/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_quiz'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_quiz'); } /** diff --git a/mod/quiz/classes/analytics/indicator/social_breadth.php b/mod/quiz/classes/analytics/indicator/social_breadth.php index 535a9f81036..b110426610a 100644 --- a/mod/quiz/classes/analytics/indicator/social_breadth.php +++ b/mod/quiz/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_quiz'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_quiz'); } /** diff --git a/mod/resource/classes/analytics/indicator/cognitive_depth.php b/mod/resource/classes/analytics/indicator/cognitive_depth.php index 186f7a98394..28b4a664468 100644 --- a/mod/resource/classes/analytics/indicator/cognitive_depth.php +++ b/mod/resource/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_resource'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_resource'); } /** diff --git a/mod/resource/classes/analytics/indicator/social_breadth.php b/mod/resource/classes/analytics/indicator/social_breadth.php index 6f52ddbd273..dd62403b92d 100644 --- a/mod/resource/classes/analytics/indicator/social_breadth.php +++ b/mod/resource/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_resource'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_resource'); } /** diff --git a/mod/scorm/classes/analytics/indicator/cognitive_depth.php b/mod/scorm/classes/analytics/indicator/cognitive_depth.php index 70013bf2e45..2ea656cdd58 100644 --- a/mod/scorm/classes/analytics/indicator/cognitive_depth.php +++ b/mod/scorm/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_scorm'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_scorm'); } /** diff --git a/mod/scorm/classes/analytics/indicator/social_breadth.php b/mod/scorm/classes/analytics/indicator/social_breadth.php index 4434fb6ee64..c45096a0de1 100644 --- a/mod/scorm/classes/analytics/indicator/social_breadth.php +++ b/mod/scorm/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_scorm'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_scorm'); } /** diff --git a/mod/survey/classes/analytics/indicator/cognitive_depth.php b/mod/survey/classes/analytics/indicator/cognitive_depth.php index 81317f9666d..b991e1b1354 100644 --- a/mod/survey/classes/analytics/indicator/cognitive_depth.php +++ b/mod/survey/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_survey'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_survey'); } /** diff --git a/mod/survey/classes/analytics/indicator/social_breadth.php b/mod/survey/classes/analytics/indicator/social_breadth.php index 4b01b085307..b1bc1fdacc0 100644 --- a/mod/survey/classes/analytics/indicator/social_breadth.php +++ b/mod/survey/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_survey'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_survey'); } /** diff --git a/mod/url/classes/analytics/indicator/cognitive_depth.php b/mod/url/classes/analytics/indicator/cognitive_depth.php index ff64b52638b..46c256bf27e 100644 --- a/mod/url/classes/analytics/indicator/cognitive_depth.php +++ b/mod/url/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_url'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_url'); } /** diff --git a/mod/url/classes/analytics/indicator/social_breadth.php b/mod/url/classes/analytics/indicator/social_breadth.php index be6488418f2..d4038a8cc2d 100644 --- a/mod/url/classes/analytics/indicator/social_breadth.php +++ b/mod/url/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_url'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_url'); } /** diff --git a/mod/wiki/classes/analytics/indicator/cognitive_depth.php b/mod/wiki/classes/analytics/indicator/cognitive_depth.php index 697d3fc2fb4..c84a33a014f 100644 --- a/mod/wiki/classes/analytics/indicator/cognitive_depth.php +++ b/mod/wiki/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_wiki'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_wiki'); } /** diff --git a/mod/wiki/classes/analytics/indicator/social_breadth.php b/mod/wiki/classes/analytics/indicator/social_breadth.php index 63c89a2313c..44269f35429 100644 --- a/mod/wiki/classes/analytics/indicator/social_breadth.php +++ b/mod/wiki/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_wiki'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_wiki'); } /** diff --git a/mod/workshop/classes/analytics/indicator/cognitive_depth.php b/mod/workshop/classes/analytics/indicator/cognitive_depth.php index dfcd9e89a8d..90f64c8966d 100644 --- a/mod/workshop/classes/analytics/indicator/cognitive_depth.php +++ b/mod/workshop/classes/analytics/indicator/cognitive_depth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class cognitive_depth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:cognitivedepth', 'mod_workshop'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_workshop'); } /** diff --git a/mod/workshop/classes/analytics/indicator/social_breadth.php b/mod/workshop/classes/analytics/indicator/social_breadth.php index a3548c08dfb..0f5d74808f2 100644 --- a/mod/workshop/classes/analytics/indicator/social_breadth.php +++ b/mod/workshop/classes/analytics/indicator/social_breadth.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class social_breadth extends activity_base { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:socialbreadth', 'mod_workshop'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_workshop'); } /** diff --git a/user/classes/analytics/indicator/user_profile_set.php b/user/classes/analytics/indicator/user_profile_set.php index f9a6aa75d72..c41921d8c76 100644 --- a/user/classes/analytics/indicator/user_profile_set.php +++ b/user/classes/analytics/indicator/user_profile_set.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class user_profile_set extends \core_analytics\local\indicator\linear { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:completeduserprofile'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:completeduserprofile'); } /** diff --git a/user/classes/analytics/indicator/user_track_forums.php b/user/classes/analytics/indicator/user_track_forums.php index 29b4e76dee6..68ebe9ee85f 100644 --- a/user/classes/analytics/indicator/user_track_forums.php +++ b/user/classes/analytics/indicator/user_track_forums.php @@ -36,12 +36,14 @@ defined('MOODLE_INTERNAL') || die(); class user_track_forums extends \core_analytics\local\indicator\binary { /** - * get_name + * Returns the name. * - * @return string + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string */ - public static function get_name() { - return get_string('indicator:userforumstracking'); + public static function get_name() : \lang_string { + return new \lang_string('indicator:userforumstracking'); } /**