/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Communication/Config/CompositeReader.php
59 строк
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2016 Adobe * All Rights Reserved. */ namespace Magento\Framework\Communication\Config; use Magento\Framework\Config\ReaderInterface; /** * Composite reader for communication config. */ class CompositeReader implements ReaderInterface { /** * @var ReaderInterface[] */ private $readers; /** * Initialize dependencies. * * @param array $readers */ public function __construct(array $readers) { usort( $readers, function ($firstItem, $secondItem) { if (!isset($firstItem['sortOrder']) || !isset($secondItem['sortOrder'])) { return 0; } return $firstItem['sortOrder'] <=> $secondItem['sortOrder']; } ); $this->readers = []; foreach ($readers as $readerInfo) { if (!isset($readerInfo['reader'])) { continue; } $this->readers[] = $readerInfo['reader']; } } /** * Read config. * * @param string|null $scope * @return array */ public function read($scope = null) { $result = []; foreach ($this->readers as $reader) { $result = array_replace_recursive($result, $reader->read($scope)); } return $result; } }