![]() 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/framework/ObjectManager/Config/Mapper/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\ObjectManager\Config\Mapper; use Magento\Framework\Config\Converter\Dom\Flat as FlatConverter; use Magento\Framework\Config\Dom\ArrayNodeConfig; use Magento\Framework\Config\Dom\NodePathMatcher; /** * Parser of a DI argument node that returns its array representation with no data loss */ class ArgumentParser { /** * @var FlatConverter */ private $converter; /** * Build and return array representation of DI argument node * * @param \DOMNode $argumentNode * @return array|string */ public function parse(\DOMNode $argumentNode) { // Base path is specified to use more meaningful XPaths in config return $this->getConverter()->convert($argumentNode, 'argument'); } /** * Retrieve instance of XML converter, suitable for DI argument nodes * * @return FlatConverter */ protected function getConverter() { if (!$this->converter) { $arrayNodeConfig = new ArrayNodeConfig(new NodePathMatcher(), ['argument(/item)+' => 'name']); $this->converter = new FlatConverter($arrayNodeConfig); } return $this->converter; } }