diff --git a/lib/internal/Magento/Framework/Autoload/AutoloaderRegistry.php b/lib/internal/Magento/Framework/Autoload/AutoloaderRegistry.php index 7a7e3501f89bd..037d8c2181dbf 100644 --- a/lib/internal/Magento/Framework/Autoload/AutoloaderRegistry.php +++ b/lib/internal/Magento/Framework/Autoload/AutoloaderRegistry.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\Autoload; +use InvalidArgumentException; use Magento\Framework\Autoload\AutoloaderInterface; /** @@ -23,7 +24,7 @@ class AutoloaderRegistry * @param AutoloaderInterface $newAutoloader * @return void */ - public static function registerAutoloader(AutoloaderInterface $newAutoloader) + public static function registerAutoloader(AutoloaderInterface $newAutoloader): void { self::$autoloader = $newAutoloader; } @@ -31,13 +32,13 @@ public static function registerAutoloader(AutoloaderInterface $newAutoloader) /** * Returns the registered autoloader * - * @throws \Exception + * @throws InvalidArgumentException * @return AutoloaderInterface */ public static function getAutoloader(): AutoloaderInterface { if (!self::$autoloader instanceof AutoloaderInterface) { - throw new \Exception('Autoloader is not registered, cannot be retrieved.'); + throw new InvalidArgumentException('Autoloader is not registered, cannot be retrieved.'); } return self::$autoloader;