Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions app/code/Magento/Analytics/Model/StoreConfigurationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,21 @@ public function __construct(
*/
public function getReport()
{
$configReport = $this->generateReportForScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0);
$reportsPerScope = [$this->generateReportForScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0)];

/** @var WebsiteInterface $website */
foreach ($this->storeManager->getWebsites() as $website) {
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
$configReport = array_merge(
$this->generateReportForScope(ScopeInterface::SCOPE_WEBSITES, $website->getId()),
$configReport
);
$reportsPerScope[] = $this->generateReportForScope(ScopeInterface::SCOPE_WEBSITES, $website->getId());
}

/** @var StoreInterface $store */
foreach ($this->storeManager->getStores() as $store) {
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
$configReport = array_merge(
$this->generateReportForScope(ScopeInterface::SCOPE_STORES, $store->getId()),
$configReport
);
$reportsPerScope[] = $this->generateReportForScope(ScopeInterface::SCOPE_STORES, $store->getId());
}

// Each scope used to be prepended to the report, so the most specific scope comes first
$configReport = array_merge(...array_reverse($reportsPerScope));

return new \IteratorIterator(new \ArrayIterator($configReport));
}

Expand Down