![]() 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/View/Layout/Argument/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\View\Layout\Argument; use Magento\Framework\Config\Converter\Dom\Flat as FlatConverter; use Magento\Framework\Config\Dom\ArrayNodeConfig; use Magento\Framework\Config\Dom\NodePathMatcher; /** * Parser of a layout argument node that returns its array representation with no data loss */ class Parser { /** * @var FlatConverter */ private $converter; /** * Build and return array representation of layout 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 layout argument nodes * * @return FlatConverter */ protected function getConverter() { if (!$this->converter) { $arrayNodeConfig = new ArrayNodeConfig( new NodePathMatcher(), [ 'argument/param' => 'name', 'argument(/item)+' => 'name', 'argument(/item)+/param' => 'name', 'argument(/argument)+' => 'name', 'argument((/argument)+(/item)+)+' => 'name', 'argument((/argument)+(/item)+)+/param' => 'name' ], ['argument/updater'] ); $this->converter = new FlatConverter($arrayNodeConfig); } return $this->converter; } }