-
Improvement
-
Resolution: Fixed
-
Minor
-
4.4
-
MOODLE_404_STABLE
-
MOODLE_404_STABLE
-
MDL-81180-main -
Currently hook callbacks must be written in the format:
[
|
'hook' => core\hook\after_config::class,
|
'callback' => core\example::class . '::after_config',
|
'priority' => 0,
|
],
|
The callback line must be a string. This means that it is either specified as something like:
'callback' => '\core\example::after_config',
|
Or something like:
'callback' => core\example::class . '::after_config',
|
These both suck to write and for maintainability.
I propose that we additionally support the standard array notation commonly used for callables, that is:
'callback' => [core\example::class, 'after_config'],
|
- links to