/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Autoload/AutoloaderRegistry.php
46 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2014 Adobe * All Rights Reserved. */ namespace Magento\Framework\Autoload; use InvalidArgumentException; use Magento\Framework\Autoload\AutoloaderInterface; /** * Registry to store a static member autoloader */ class AutoloaderRegistry { /** * @var AutoloaderInterface */ protected static $autoloader; /** * Registers the given autoloader as a static member * * @param AutoloaderInterface $newAutoloader * @return void */ public static function registerAutoloader(AutoloaderInterface $newAutoloader): void { self::$autoloader = $newAutoloader; } /** * Returns the registered autoloader * * @throws InvalidArgumentException * @return AutoloaderInterface */ public static function getAutoloader(): AutoloaderInterface { if (!self::$autoloader instanceof AutoloaderInterface) { throw new InvalidArgumentException('Autoloader is not registered, cannot be retrieved.'); } return self::$autoloader; } }