Skip to content

Commit d802328

Browse files
author
Bartosz Kubicki
committed
Another fix after CR
1 parent 00a03e9 commit d802328

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/internal/Magento/Framework/MessageQueue/Test/Unit/Topology/Config/QueueConfigItem/DataMapperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* Copyright © Magento, Inc. All rights reserved.
75
* See COPYING.txt for license details.
86
*/
97

8+
declare(strict_types=1);
9+
1010
namespace Magento\Framework\MessageQueue\Test\Unit\Topology\Config\QueueConfigItem;
1111

1212
use Magento\Framework\Communication\ConfigInterface as CommunicationConfig;

lib/internal/Magento/Framework/MessageQueue/Topology/Config/QueueConfigItem/DataMapper.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* Copyright © Magento, Inc. All rights reserved.
75
* See COPYING.txt for license details.
86
*/
7+
8+
declare(strict_types=1);
9+
910
namespace Magento\Framework\MessageQueue\Topology\Config\QueueConfigItem;
1011

1112
use Magento\Framework\Communication\ConfigInterface as CommunicationConfig;
@@ -67,7 +68,7 @@ public function __construct(
6768
public function getMappedData(): array
6869
{
6970
if (null === $this->mappedData) {
70-
$this->mappedData = [];
71+
$mappedData = [];
7172
foreach ($this->configData->get() as $exchange) {
7273
$connection = $exchange['connection'];
7374
foreach ($exchange['bindings'] as $binding) {
@@ -78,10 +79,11 @@ public function getMappedData(): array
7879
(array)$binding['arguments'],
7980
(string)$connection
8081
);
81-
$this->mappedData = array_merge($this->mappedData, $queueItems);
82+
$mappedData[] = $queueItems;
8283
}
8384
}
8485
}
86+
$this->mappedData = array_merge([], ...$mappedData);
8587
}
8688

8789
return $this->mappedData;
@@ -158,7 +160,7 @@ private function matchSynchronousTopics(string $wildcard): array
158160
$topicDefinitions = array_filter(
159161
$this->communicationConfig->getTopics(),
160162
function ($item) {
161-
return (bool) $item[CommunicationConfig::TOPIC_IS_SYNCHRONOUS];
163+
return (bool)$item[CommunicationConfig::TOPIC_IS_SYNCHRONOUS];
162164
}
163165
);
164166

0 commit comments

Comments
 (0)