-
Improvement
-
Resolution: Fixed
-
Minor
-
3.0
-
MOODLE_30_STABLE
-
MOODLE_30_STABLE
-
MDL-50260-remove-code-optional_param -
Easy
-
function optional_param($parname, $default, $type) {
|
if (func_num_args() != 3 or empty($parname) or empty($type)) {
|
throw new coding_exception('optional_param requires $parname, $default + $type to be specified (parameter: '.$parname.')');
|
}
|
if (!isset($default)) {
|
$default = null;
|
}
|
The check
if (!isset($default)) {
|
is not needed there, there is no way $default can be undefined since we check func_num_args() != 3 .
- is a regression caused by
-
MDL-26796 stop accepting arrays in required_param() and optional_param()
-
- Closed
-