diff --git a/vendor/magento/framework/Component/ComponentRegistrar.php b/vendor/magento/framework/Component/ComponentRegistrar.php index dfbff69ecb64c..1cbb6c6056a44 100644 --- a/vendor/magento/framework/Component/ComponentRegistrar.php +++ b/vendor/magento/framework/Component/ComponentRegistrar.php @@ -13,17 +13,18 @@ */ class ComponentRegistrar implements ComponentRegistrarInterface { - /**#@+ + /** * Different types of components */ - const MODULE = 'module'; - const LIBRARY = 'library'; - const THEME = 'theme'; - const LANGUAGE = 'language'; - const SETUP = 'setup'; - /**#@- */ + public const MODULE = 'module'; + public const LIBRARY = 'library'; + public const THEME = 'theme'; + public const LANGUAGE = 'language'; + public const SETUP = 'setup'; - /**#@- */ + /** + * @var array[] + */ private static $paths = [ self::MODULE => [], self::LIBRARY => [], @@ -63,11 +64,19 @@ public function getPaths($type) } /** - * @inheritdoc + * Get path of a component if it is already registered + * + * @param string $type + * @param string $componentName + * @return null|string */ public function getPath($type, $componentName) { self::validateType($type); + if (!is_string($componentName)) { + return null; + } + return self::$paths[$type][$componentName] ?? null; }