File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
lib/internal/Magento/Framework/MessageQueue/Code/Generator Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ protected function _getClassMethods()
136
136
$ parameterName = $ methodParameter ->getName ();
137
137
$ parameter = [
138
138
'name ' => $ parameterName ,
139
- 'type ' => $ methodParameter ->getType (),
139
+ 'type ' => $ this -> convertMethodType ( $ methodParameter ->getType () ),
140
140
];
141
141
if ($ methodParameter ->isDefaultValueAvailable ()) {
142
142
$ parameter ['defaultValue ' ] = $ methodParameter ->getDefaultValue () !== null
@@ -155,7 +155,7 @@ protected function _getClassMethods()
155
155
$ annotations = [['name ' => 'inheritdoc ' ]];
156
156
$ method = [
157
157
'name ' => $ methodName ,
158
- 'returnType ' => $ methodReflection ->getReturnType (),
158
+ 'returnType ' => $ this -> convertMethodType ( $ methodReflection ->getReturnType () ),
159
159
'parameters ' => $ methodParameters ,
160
160
'body ' => $ methodBody ,
161
161
'docblock ' => ['tags ' => $ annotations ],
@@ -165,6 +165,17 @@ protected function _getClassMethods()
165
165
return $ methods ;
166
166
}
167
167
168
+ /**
169
+ * Converts method type if needed.
170
+ *
171
+ * @param mixed $type
172
+ * @return string|null
173
+ */
174
+ private function convertMethodType ($ type )
175
+ {
176
+ return $ type instanceof \ReflectionNamedType ? $ type ->getName () : $ type ;
177
+ }
178
+
168
179
/**
169
180
* @inheritDoc
170
181
*/
You can’t perform that action at this time.
0 commit comments