@@ -124,7 +124,7 @@ protected function extractTopics($config)
124
124
$ requestSchema ,
125
125
$ responseSchema
126
126
);
127
- $ isSynchronous = $ this ->extractTopicIsSynchronous ($ topicNode ) ?? null ;
127
+ $ isSynchronous = $ this ->extractTopicIsSynchronous ($ topicNode );
128
128
if ($ serviceMethod ) {
129
129
$ output [$ topicName ] = $ this ->reflectionGenerator ->generateTopicConfigForServiceMethod (
130
130
$ topicName ,
@@ -136,7 +136,7 @@ protected function extractTopics($config)
136
136
} elseif ($ requestSchema && $ responseSchema ) {
137
137
$ output [$ topicName ] = [
138
138
Config::TOPIC_NAME => $ topicName ,
139
- Config::TOPIC_IS_SYNCHRONOUS => $ isSynchronous ?? true ,
139
+ Config::TOPIC_IS_SYNCHRONOUS => $ isSynchronous ,
140
140
Config::TOPIC_REQUEST => $ requestSchema ,
141
141
Config::TOPIC_REQUEST_TYPE => Config::TOPIC_REQUEST_TYPE_CLASS ,
142
142
Config::TOPIC_RESPONSE => ($ isSynchronous ) ? $ responseSchema : null ,
@@ -145,7 +145,7 @@ protected function extractTopics($config)
145
145
} elseif ($ requestSchema ) {
146
146
$ output [$ topicName ] = [
147
147
Config::TOPIC_NAME => $ topicName ,
148
- Config::TOPIC_IS_SYNCHRONOUS => $ isSynchronous ?? false ,
148
+ Config::TOPIC_IS_SYNCHRONOUS => false ,
149
149
Config::TOPIC_REQUEST => $ requestSchema ,
150
150
Config::TOPIC_REQUEST_TYPE => Config::TOPIC_REQUEST_TYPE_CLASS ,
151
151
Config::TOPIC_RESPONSE => null ,
@@ -265,17 +265,15 @@ protected function parseServiceMethod($serviceMethod, $topicName)
265
265
* Extract is_synchronous topic value.
266
266
*
267
267
* @param \DOMNode $topicNode
268
- * @return boolean|null
268
+ * @return bool
269
269
*/
270
- protected function extractTopicIsSynchronous ($ topicNode )
270
+ private function extractTopicIsSynchronous ($ topicNode ): bool
271
271
{
272
272
$ attributeName = Config::TOPIC_IS_SYNCHRONOUS ;
273
273
$ topicAttributes = $ topicNode ->attributes ;
274
274
if (!$ topicAttributes ->getNamedItem ($ attributeName )) {
275
- return null ;
275
+ return true ;
276
276
}
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 );
280
278
}
281
279
}
0 commit comments