@@ -106,8 +106,8 @@ protected function extractTopics($config)
106
106
$ serviceMethod = $ this ->getServiceMethodBySchema ($ topicNode );
107
107
$ requestResponseSchema = $ serviceMethod
108
108
? $ this ->reflectionGenerator ->extractMethodMetadata (
109
- $ serviceMethod [' type ' ],
110
- $ serviceMethod [' method ' ]
109
+ $ serviceMethod [ConfigParser:: TYPE_NAME ],
110
+ $ serviceMethod [ConfigParser:: METHOD_NAME ]
111
111
)
112
112
: null ;
113
113
$ requestSchema = $ this ->extractTopicRequestSchema ($ topicNode );
@@ -129,8 +129,8 @@ protected function extractTopics($config)
129
129
if ($ serviceMethod ) {
130
130
$ output [$ topicName ] = $ this ->reflectionGenerator ->generateTopicConfigForServiceMethod (
131
131
$ topicName ,
132
- $ serviceMethod [' type ' ],
133
- $ serviceMethod [' method ' ],
132
+ $ serviceMethod [ConfigParser:: TYPE_NAME ],
133
+ $ serviceMethod [ConfigParser:: METHOD_NAME ],
134
134
$ handlers
135
135
);
136
136
} else if ($ requestSchema && $ responseSchema ) {
@@ -239,12 +239,24 @@ protected function getServiceMethodBySchema($topicNode)
239
239
}
240
240
$ topicName = $ topicAttributes ->getNamedItem ('name ' )->nodeValue ;
241
241
$ serviceMethod = $ topicAttributes ->getNamedItem ('schema ' )->nodeValue ;
242
+ return $ this ->parseServiceMethod ($ serviceMethod , $ topicName );
243
+ }
244
+
245
+ /**
246
+ * Parse service method name, also ensure that it exists.
247
+ *
248
+ * @param string $serviceMethod
249
+ * @param string $topicName
250
+ * @return array Contains class name and method name
251
+ */
252
+ protected function parseServiceMethod ($ serviceMethod , $ topicName )
253
+ {
242
254
$ parsedServiceMethod = $ this ->getConfigParser ()->parseServiceMethod ($ serviceMethod );
243
255
$ this ->xmlValidator ->validateServiceMethod (
244
256
$ serviceMethod ,
245
257
$ topicName ,
246
- $ parsedServiceMethod [' type ' ],
247
- $ parsedServiceMethod [' method ' ]
258
+ $ parsedServiceMethod [ConfigParser:: TYPE_NAME ],
259
+ $ parsedServiceMethod [ConfigParser:: METHOD_NAME ]
248
260
);
249
261
return $ parsedServiceMethod ;
250
262
}
0 commit comments