MDL-76356 various: avoid implicit conversion to int
PHP before version 8.1 automatically converted to int if the function parameter (or array key) is expected to be int. PHP 8.1 shows notice in this case
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
66dcb1683b
commit
ff5fc3820a
@@ -285,7 +285,8 @@ abstract class base {
|
||||
}
|
||||
|
||||
if (isset($plugin->incompatible) && $plugin->incompatible !== null) {
|
||||
if ((ctype_digit($plugin->incompatible) || is_int($plugin->incompatible)) && (int) $plugin->incompatible > 0) {
|
||||
if (((is_string($plugin->incompatible) && ctype_digit($plugin->incompatible)) || is_int($plugin->incompatible))
|
||||
&& (int) $plugin->incompatible > 0) {
|
||||
$this->pluginincompatible = intval($plugin->incompatible);
|
||||
} else {
|
||||
throw new coding_exception('Incorrect syntax in plugin incompatible declaration in '."$this->name");
|
||||
|
||||
Reference in New Issue
Block a user