Skip to content

Commit c7a3b3f

Browse files
committed
MC-33069: Stabilize Unit tests
1 parent e702c94 commit c7a3b3f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

lib/internal/Magento/Framework/MessageQueue/Code/Generator/RemoteServiceGenerator.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected function _getClassMethods()
136136
$parameterName = $methodParameter->getName();
137137
$parameter = [
138138
'name' => $parameterName,
139-
'type' => $methodParameter->getType(),
139+
'type' => $this->convertMethodType($methodParameter->getType()),
140140
];
141141
if ($methodParameter->isDefaultValueAvailable()) {
142142
$parameter['defaultValue'] = $methodParameter->getDefaultValue() !== null
@@ -155,7 +155,7 @@ protected function _getClassMethods()
155155
$annotations = [['name' => 'inheritdoc']];
156156
$method = [
157157
'name' => $methodName,
158-
'returnType' => $methodReflection->getReturnType(),
158+
'returnType' => $this->convertMethodType($methodReflection->getReturnType()),
159159
'parameters' => $methodParameters,
160160
'body' => $methodBody,
161161
'docblock' => ['tags' => $annotations],
@@ -165,6 +165,17 @@ protected function _getClassMethods()
165165
return $methods;
166166
}
167167

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+
168179
/**
169180
* @inheritDoc
170181
*/

0 commit comments

Comments
 (0)