/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
setup/src/Magento/Setup/Module/Di/Code/Scanner/InterceptedInstancesScanner.php
43 строки
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 11:23
22 окт 2025, 11:23
6c2f6e6
Код
Авторство
О чём код?
<?php /** * Copyright 2015 Adobe * All Rights Reserved. */ namespace Magento\Setup\Module\Di\Code\Scanner; class InterceptedInstancesScanner implements ScannerInterface { /** * Get array of class names * * @param array $files * @return array */ public function collectEntities(array $files) { $interceptedInstances = []; foreach ($files as $fileName) { $dom = new \DOMDocument(); $dom->loadXML(file_get_contents($fileName)); $xpath = new \DOMXPath($dom); /** @var $node \DOMNode */ foreach ($xpath->query('//type/plugin|//virtualType/plugin') as $node) { $parentTypeNode = $node->parentNode->attributes->getNamedItem('name'); if ($parentTypeNode === null) { continue; } if (!isset($interceptedInstances[$parentTypeNode->nodeValue])) { $interceptedInstances[$parentTypeNode->nodeValue] = []; } $pluginTypeNode = $node->attributes->getNamedItem('type'); if ($pluginTypeNode !== null) { $interceptedInstances[$parentTypeNode->nodeValue][] = $pluginTypeNode->nodeValue; } } } return $interceptedInstances; } }