From fbaf6a2245194a533e88e4075030d7251eb7f02e Mon Sep 17 00:00:00 2001 From: Brendan Heywood Date: Wed, 30 Oct 2019 15:20:20 +1100 Subject: [PATCH] Added support for require_admin since MDL-58439 --- moodle/Sniffs/Files/RequireLoginSniff.php | 2 +- moodle/tests/moodlestandard_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moodle/Sniffs/Files/RequireLoginSniff.php b/moodle/Sniffs/Files/RequireLoginSniff.php index f496ee89..6ea7f789 100644 --- a/moodle/Sniffs/Files/RequireLoginSniff.php +++ b/moodle/Sniffs/Files/RequireLoginSniff.php @@ -23,7 +23,7 @@ */ class moodle_Sniffs_Files_RequireLoginSniff implements PHP_CodeSniffer_Sniff { - public $loginfunctions = ['require_login', 'require_course_login', 'admin_externalpage_setup']; + public $loginfunctions = ['require_login', 'require_course_login', 'require_admin', 'admin_externalpage_setup']; public $ignorewhendefined = ['NO_MOODLE_COOKIES', 'CLI_SCRIPT', 'ABORT_AFTER_CONFIG']; /** * Register for open tag (only process once per file). diff --git a/moodle/tests/moodlestandard_test.php b/moodle/tests/moodlestandard_test.php index 086c878e..5331c0b8 100644 --- a/moodle/tests/moodlestandard_test.php +++ b/moodle/tests/moodlestandard_test.php @@ -669,7 +669,7 @@ public function test_moodle_files_requirelogin_problem() { $this->set_errors(array()); $this->set_warnings(array( - 25 => 'check (require_login, require_course_login, admin_externalpage_setup) following config inclusion. None found' + 25 => 'check (require_login, require_course_login, require_admin, admin_externalpage_setup) following config inclusion. None found' )); $this->verify_cs_results();