![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-integration/Model/Config/Integration/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Integration\Model\Config\Integration; /** * Converter of api.xml content into array format. * * @deprecated 100.1.0 */ class Converter implements \Magento\Framework\Config\ConverterInterface { /**#@+ * Array keys for config internal representation. */ const API_RESOURCES = 'resource'; const API_RESOURCE_NAME = 'name'; /**#@-*/ /** * {@inheritdoc} */ public function convert($source) { $result = []; /** @var \DOMNodeList $integrations */ $integrations = $source->getElementsByTagName('integration'); /** @var \DOMElement $integration */ foreach ($integrations as $integration) { if ($integration->nodeType != XML_ELEMENT_NODE) { continue; } $integrationName = $integration->attributes->getNamedItem('name')->nodeValue; $result[$integrationName] = []; $result[$integrationName][self::API_RESOURCES] = []; /** @var \DOMNodeList $resources */ $resources = $integration->getElementsByTagName('resource'); /** @var \DOMElement $resource */ foreach ($resources as $resource) { if ($resource->nodeType != XML_ELEMENT_NODE) { continue; } $resource = $resource->attributes->getNamedItem('name')->nodeValue; $result[$integrationName][self::API_RESOURCES][] = $resource; } } return $result; } }