MDL-81521 core: Update all possibly data providers to be static

Note: Some data providers could not be automatically be converted to
being static. These will be handled in a separate issue.
This commit is contained in:
Andrew Nicols
2024-11-19 09:30:51 +08:00
parent eaa25cf51b
commit 3d51aed3e2
387 changed files with 1442 additions and 1404 deletions
+5 -5
View File
@@ -2077,7 +2077,7 @@ class accesslib_test extends advanced_testcase {
*
* @return array
*/
public function deprecated_capabilities_use_cases() {
public static function deprecated_capabilities_use_cases(): array {
return [
'capability missing' => [
'fake/access:missingcapability',
@@ -2895,7 +2895,7 @@ class accesslib_test extends advanced_testcase {
get_enrolled_users($systemcontext, '', USERSWITHOUTGROUP);
}
public function get_enrolled_sql_provider() {
public static function get_enrolled_sql_provider(): array {
return array(
array(
// Two users who are enrolled.
@@ -4348,7 +4348,7 @@ class accesslib_test extends advanced_testcase {
*
* @return array
*/
public function get_get_with_capability_join_override_cases() {
public static function get_get_with_capability_join_override_cases(): array {
return [
'no overrides' => [true, []],
'one override' => [true, ['moodle/course:viewscales']],
@@ -4550,7 +4550,7 @@ class accesslib_test extends advanced_testcase {
*
* @return array
*/
public function is_parent_of_provider(): array {
public static function is_parent_of_provider(): array {
$provideboth = function(string $desc, string $contextpath, string $testpath, bool $expected): array {
return [
"includeself: true; {$desc}" => [
@@ -4653,7 +4653,7 @@ class accesslib_test extends advanced_testcase {
*
* @return array
*/
public function is_child_of_provider(): array {
public static function is_child_of_provider(): array {
$provideboth = function(string $desc, string $contextpath, string $testpath, bool $expected): array {
return [
"includeself: true; {$desc}" => [