Skip to content

Commit 4de1d94

Browse files
author
Vasiliev.A
committed
fix implmentation of isSynchronuos attribute processing
1 parent b7ea0d8 commit 4de1d94

File tree

2 files changed

+9
-10
lines changed
  • app/code/Magento/WebapiAsync/Code/Generator/Config/RemoteServiceReader
  • lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader

2 files changed

+9
-10
lines changed

app/code/Magento/WebapiAsync/Code/Generator/Config/RemoteServiceReader/Communication.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public function read($scope = null)
6767
CommunicationConfig::HANDLER_TYPE => $serviceClass,
6868
CommunicationConfig::HANDLER_METHOD => $serviceMethod,
6969
],
70-
]
70+
],
71+
false
7172
);
7273
$rewriteTopicParams = [
7374
CommunicationConfig::TOPIC_IS_SYNCHRONOUS => false,

lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader/Converter.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ protected function extractTopics($config)
124124
$requestSchema,
125125
$responseSchema
126126
);
127-
$isSynchronous = $this->extractTopicIsSynchronous($topicNode) ?? null;
127+
$isSynchronous = $this->extractTopicIsSynchronous($topicNode);
128128
if ($serviceMethod) {
129129
$output[$topicName] = $this->reflectionGenerator->generateTopicConfigForServiceMethod(
130130
$topicName,
@@ -136,7 +136,7 @@ protected function extractTopics($config)
136136
} elseif ($requestSchema && $responseSchema) {
137137
$output[$topicName] = [
138138
Config::TOPIC_NAME => $topicName,
139-
Config::TOPIC_IS_SYNCHRONOUS => $isSynchronous ?? true,
139+
Config::TOPIC_IS_SYNCHRONOUS => $isSynchronous,
140140
Config::TOPIC_REQUEST => $requestSchema,
141141
Config::TOPIC_REQUEST_TYPE => Config::TOPIC_REQUEST_TYPE_CLASS,
142142
Config::TOPIC_RESPONSE => ($isSynchronous) ? $responseSchema: null,
@@ -145,7 +145,7 @@ protected function extractTopics($config)
145145
} elseif ($requestSchema) {
146146
$output[$topicName] = [
147147
Config::TOPIC_NAME => $topicName,
148-
Config::TOPIC_IS_SYNCHRONOUS => $isSynchronous ?? false,
148+
Config::TOPIC_IS_SYNCHRONOUS => false,
149149
Config::TOPIC_REQUEST => $requestSchema,
150150
Config::TOPIC_REQUEST_TYPE => Config::TOPIC_REQUEST_TYPE_CLASS,
151151
Config::TOPIC_RESPONSE => null,
@@ -265,17 +265,15 @@ protected function parseServiceMethod($serviceMethod, $topicName)
265265
* Extract is_synchronous topic value.
266266
*
267267
* @param \DOMNode $topicNode
268-
* @return boolean|null
268+
* @return bool
269269
*/
270-
protected function extractTopicIsSynchronous($topicNode)
270+
private function extractTopicIsSynchronous($topicNode): bool
271271
{
272272
$attributeName = Config::TOPIC_IS_SYNCHRONOUS;
273273
$topicAttributes = $topicNode->attributes;
274274
if (!$topicAttributes->getNamedItem($attributeName)) {
275-
return null;
275+
return true;
276276
}
277-
$value = $topicAttributes->getNamedItem($attributeName)->nodeValue;
278-
$isSynchronous = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
279-
return $isSynchronous;
277+
return $this->booleanUtils->toBoolean($topicAttributes->getNamedItem($attributeName)->nodeValue);
280278
}
281279
}

0 commit comments

Comments
 (0)