/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Composer/MagentoComponent.php
33 строки
992 B
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\Composer; /** * Magento component. */ class MagentoComponent { /** * Get matched Magento component or empty array, if it's not a Magento component * * @param string $key * @return string[] ['type' => '<type>', 'area' => '<area>', 'name' => '<name>'] * Ex.: ['type' => 'module', 'name' => 'catalog'] * ['type' => 'theme', 'area' => 'frontend', 'name' => 'blank'] */ public static function matchMagentoComponent($key) { $typePattern = 'module|theme|language|framework'; $areaPattern = 'frontend|adminhtml'; $namePattern = '[a-z0-9_-]+'; $regex = '/^magento\/(?P<type>' . $typePattern . ')(?:-(?P<area>' . $areaPattern . '))?(?:-(?P<name>' . $namePattern . '))?$/'; if (preg_match($regex, $key, $matches)) { return $matches; } return []; } }