Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit b7ea0d8

Browse files
author
Vasiliev.A
committed
fix formatting, fix unused method param $isSynchronous
1 parent 703b2fb commit b7ea0d8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,16 @@ protected function extractTopics($config)
130130
$topicName,
131131
$serviceMethod[ConfigParser::TYPE_NAME],
132132
$serviceMethod[ConfigParser::METHOD_NAME],
133-
$handlers
133+
$handlers,
134+
$isSynchronous
134135
);
135136
} elseif ($requestSchema && $responseSchema) {
136137
$output[$topicName] = [
137138
Config::TOPIC_NAME => $topicName,
138139
Config::TOPIC_IS_SYNCHRONOUS => $isSynchronous ?? true,
139140
Config::TOPIC_REQUEST => $requestSchema,
140141
Config::TOPIC_REQUEST_TYPE => Config::TOPIC_REQUEST_TYPE_CLASS,
141-
Config::TOPIC_RESPONSE => $responseSchema,
142+
Config::TOPIC_RESPONSE => ($isSynchronous) ? $responseSchema: null,
142143
Config::TOPIC_HANDLERS => $handlers
143144
];
144145
} elseif ($requestSchema) {

lib/internal/Magento/Framework/Communication/Config/ReflectionGenerator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ public function generateTopicConfigForServiceMethod(
8181
$returnType = ($returnType != 'void' && $returnType != 'null') ? $returnType : null;
8282
if (!isset($isSynchronous)) {
8383
$isSynchronous = $returnType ? true : false;
84+
} else {
85+
$returnType = ($isSynchronous) ? $returnType : null;
8486
}
8587
return [
8688
Config::TOPIC_NAME => $topicName,
@@ -89,12 +91,13 @@ public function generateTopicConfigForServiceMethod(
8991
Config::TOPIC_REQUEST_TYPE => Config::TOPIC_REQUEST_TYPE_METHOD,
9092
Config::TOPIC_RESPONSE => $returnType,
9193
Config::TOPIC_HANDLERS => $handlers
92-
? : [self::DEFAULT_HANDLER => $methodMetadata[Config::SCHEMA_METHOD_HANDLER]]
94+
?: [self::DEFAULT_HANDLER => $methodMetadata[Config::SCHEMA_METHOD_HANDLER]]
9395
];
9496
}
9597

9698
/**
9799
* Generate topic name based on service type and method name.
100+
*
98101
* Perform the following conversion:
99102
* \Magento\Customer\Api\RepositoryInterface + getById =>
100103
* magento.customer.api.repositoryInterface.getById

0 commit comments

Comments
 (0)