MDL-72292 core: add param type and polishing

This commit is contained in:
Simey Lameze 2022-06-17 09:50:38 +08:00
parent 8583feb724
commit b20cca2690

View file

@ -1203,18 +1203,20 @@ $cache = '.var_export($cache, true).';
* and the value is the new class name. * and the value is the new class name.
* It is only included when we are populating the component cache. After that is not needed. * It is only included when we are populating the component cache. After that is not needed.
* *
* @param string $fulldir * @param string|null $fulldir The directory to the renamed classes.
*/ */
protected static function load_renamed_classes($fulldir) { protected static function load_renamed_classes(?string $fulldir) {
if (isset($fulldir)) { if (is_null($fulldir)) {
$file = $fulldir . '/db/renamedclasses.php'; return;
if (is_readable($file)) { }
$renamedclasses = null;
require($file); $file = $fulldir . '/db/renamedclasses.php';
if (is_array($renamedclasses)) { if (is_readable($file)) {
foreach ($renamedclasses as $oldclass => $newclass) { $renamedclasses = null;
self::$classmaprenames[(string)$oldclass] = (string)$newclass; require($file);
} if (is_array($renamedclasses)) {
foreach ($renamedclasses as $oldclass => $newclass) {
self::$classmaprenames[(string)$oldclass] = (string)$newclass;
} }
} }
} }