Skip to content

Commit ab1b1de

Browse files
committed
#26479 Clear notice if Autoloader was not registered properly, instead of passing the error to higher levels
1 parent c2e2646 commit ab1b1de

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/internal/Magento/Framework/Autoload/AutoloaderRegistry.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public static function registerAutoloader(AutoloaderInterface $newAutoloader)
3434
* @throws \Exception
3535
* @return AutoloaderInterface
3636
*/
37-
public static function getAutoloader()
37+
public static function getAutoloader(): AutoloaderInterface
3838
{
39-
if (self::$autoloader !== null) {
40-
return self::$autoloader;
41-
} else {
39+
if (!self::$autoloader instanceof AutoloaderInterface) {
4240
throw new \Exception('Autoloader is not registered, cannot be retrieved.');
4341
}
42+
43+
return self::$autoloader;
4444
}
4545
}

0 commit comments

Comments
 (0)