From f77ac171113b39d99ea4ff06242dd29901e065ab Mon Sep 17 00:00:00 2001 From: Anupama Dharmajan Date: Mon, 17 Jan 2022 08:44:01 +1100 Subject: [PATCH] Fix codechecker errors --- classes/core_userkey_manager.php | 2 -- classes/privacy/provider.php | 2 -- classes/userkey_manager_interface.php | 4 +--- db/upgrade.php | 2 -- login.php | 2 +- logout.php | 2 +- tests/phpunit/auth_plugin_test.php | 2 -- tests/phpunit/core_userkey_manager_test.php | 2 -- tests/phpunit/externallib_test.php | 3 --- tests/phpunit/fake_userkey_manager.php | 5 +---- version.php | 2 +- 11 files changed, 5 insertions(+), 23 deletions(-) diff --git a/classes/core_userkey_manager.php b/classes/core_userkey_manager.php index 36e25db..d15ebc8 100644 --- a/classes/core_userkey_manager.php +++ b/classes/core_userkey_manager.php @@ -24,8 +24,6 @@ namespace auth_userkey; -defined('MOODLE_INTERNAL') || die; - class core_userkey_manager implements userkey_manager_interface { /** diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index d969cfe..8ad305b 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -25,8 +25,6 @@ namespace auth_userkey\privacy; -defined('MOODLE_INTERNAL') || die; - use core_privacy\local\metadata\null_provider; use core_privacy\local\legacy_polyfill; diff --git a/classes/userkey_manager_interface.php b/classes/userkey_manager_interface.php index 2afc481..3274df8 100644 --- a/classes/userkey_manager_interface.php +++ b/classes/userkey_manager_interface.php @@ -24,8 +24,6 @@ namespace auth_userkey; -defined('MOODLE_INTERNAL') || die(); - /** * Interface userkey_manager_interface describes key manager behaviour. * @@ -60,4 +58,4 @@ interface userkey_manager_interface { */ public function validate_key($keyvalue); -} \ No newline at end of file +} diff --git a/db/upgrade.php b/db/upgrade.php index 5400790..efb5a5b 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -22,8 +22,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -defined('MOODLE_INTERNAL') || die; - function xmldb_auth_userkey_upgrade($oldversion) { global $DB; diff --git a/login.php b/login.php index 7956ff4..b6e7733 100644 --- a/login.php +++ b/login.php @@ -28,4 +28,4 @@ if (!is_enabled_auth('userkey')) { print_error(get_string('pluginisdisabled', 'auth_userkey')); } -get_auth_plugin('userkey')->user_login_userkey(); \ No newline at end of file +get_auth_plugin('userkey')->user_login_userkey(); diff --git a/logout.php b/logout.php index 026f6ad..2e5cb0e 100644 --- a/logout.php +++ b/logout.php @@ -28,4 +28,4 @@ if (!is_enabled_auth('userkey')) { print_error(get_string('pluginisdisabled', 'auth_userkey')); } -get_auth_plugin('userkey')->user_logout_userkey(); \ No newline at end of file +get_auth_plugin('userkey')->user_logout_userkey(); diff --git a/tests/phpunit/auth_plugin_test.php b/tests/phpunit/auth_plugin_test.php index 26a5dfc..647769b 100644 --- a/tests/phpunit/auth_plugin_test.php +++ b/tests/phpunit/auth_plugin_test.php @@ -22,8 +22,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -defined('MOODLE_INTERNAL') || die(); - /** * Tests for auth_plugin_userkey class. * diff --git a/tests/phpunit/core_userkey_manager_test.php b/tests/phpunit/core_userkey_manager_test.php index abf9ad8..c95bd6b 100644 --- a/tests/phpunit/core_userkey_manager_test.php +++ b/tests/phpunit/core_userkey_manager_test.php @@ -22,8 +22,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -defined('MOODLE_INTERNAL') || die(); - use auth_userkey\core_userkey_manager; /** diff --git a/tests/phpunit/externallib_test.php b/tests/phpunit/externallib_test.php index f6a269c..5e29425 100644 --- a/tests/phpunit/externallib_test.php +++ b/tests/phpunit/externallib_test.php @@ -22,9 +22,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -defined('MOODLE_INTERNAL') || die(); - - class auth_userkey_externallib_testcase extends advanced_testcase { /** * User object. diff --git a/tests/phpunit/fake_userkey_manager.php b/tests/phpunit/fake_userkey_manager.php index acae81a..3120be7 100644 --- a/tests/phpunit/fake_userkey_manager.php +++ b/tests/phpunit/fake_userkey_manager.php @@ -24,9 +24,6 @@ namespace auth_userkey; -defined('MOODLE_INTERNAL') || die(); - - class fake_userkey_manager implements userkey_manager_interface { public function create_key($userid, $allowedips = null) { @@ -40,4 +37,4 @@ class fake_userkey_manager implements userkey_manager_interface { public function validate_key($keyvalue) { // TODO: Implement validate_key() method. } -} \ No newline at end of file +} diff --git a/version.php b/version.php index 9d5a850..e7777bb 100644 --- a/version.php +++ b/version.php @@ -29,4 +29,4 @@ $plugin->release = 2022011600; // Match release exactly to version. $plugin->requires = 2017051500; // Requires Moodle 3.3 version. $plugin->component = 'auth_userkey'; // Full name of the plugin (used for diagnostics). $plugin->maturity = MATURITY_STABLE; -$plugin->supported = [33, 311]; // A range of branch numbers of supported moodle versions. \ No newline at end of file +$plugin->supported = [33, 311]; // A range of branch numbers of supported moodle versions.