From 72aac063046d0c93ebfb51616cf42eb035c12e51 Mon Sep 17 00:00:00 2001 From: Peter Burnett Date: Thu, 16 Jan 2020 11:58:31 +1000 Subject: [PATCH] MDL-59562 core: updated type hint of new function --- lib/classes/plugin_manager.php | 4 ++-- lib/classes/plugininfo/base.php | 4 ++-- lib/tests/plugininfo/base_test.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index 55fcf184efb..7ac652d77a2 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -927,9 +927,9 @@ class core_plugin_manager { * * @param \core\plugininfo\base $plugin the plugin we are checking * @param int $branch the moodle branch to check support for - * @return bool + * @return string */ - public function check_explicitly_supported($plugin, $branch) : bool { + public function check_explicitly_supported($plugin, $branch) : string { // Check for correctly formed supported. if (isset($plugin->pluginsupported)) { // Broken apart for readability. diff --git a/lib/classes/plugininfo/base.php b/lib/classes/plugininfo/base.php index 71e5a70d485..75d980f35ef 100644 --- a/lib/classes/plugininfo/base.php +++ b/lib/classes/plugininfo/base.php @@ -254,7 +254,7 @@ abstract class base { if (is_array($plugin->supported) && $isint && $isrange) { $this->pluginsupported = $plugin->supported; } else { - throw new coding_exception('Incorrect syntax in $plugin->supported in '."$this->name"); + throw new coding_exception('Incorrect syntax in plugin supported declaration in '."$this->name"); } } @@ -262,7 +262,7 @@ abstract class base { if ((ctype_digit($plugin->incompatible) || is_int($plugin->incompatible)) && (int) $plugin->incompatible > 0) { $this->pluginincompatible = intval($plugin->incompatible); } else { - throw new coding_exception('Incorrect syntax in $plugin->incompatible in '."$this->name"); + throw new coding_exception('Incorrect syntax in plugin incompatible declaration in '."$this->name"); } } diff --git a/lib/tests/plugininfo/base_test.php b/lib/tests/plugininfo/base_test.php index 508c14d58b0..d5b805fa992 100644 --- a/lib/tests/plugininfo/base_test.php +++ b/lib/tests/plugininfo/base_test.php @@ -81,7 +81,7 @@ class base_testcase extends \advanced_testcase { $pluginman->add_fake_plugin_info($plugininfo); $this->expectException(\coding_exception::class); - $this->expectExceptionMessage('Incorrect syntax in $plugin->supported in example'); + $this->expectExceptionMessage('Incorrect syntax in plugin supported declaration in example'); $plugininfo->load_disk_version(); } @@ -147,7 +147,7 @@ class base_testcase extends \advanced_testcase { $pluginman->add_fake_plugin_info($plugininfo); $this->expectException(\coding_exception::class); - $this->expectExceptionMessage('Incorrect syntax in $plugin->incompatible in example'); + $this->expectExceptionMessage('Incorrect syntax in plugin incompatible declaration in example'); $plugininfo->load_disk_version(); } -- 2.43.0