File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
lib/internal/Magento/Framework/ObjectManager/Code/Generator Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -246,11 +246,11 @@ protected function _getGetMethod()
246
246
'parameters ' => [
247
247
[
248
248
'name ' => 'id ' ,
249
- 'type ' => $ parameterReflection ->getType (),
249
+ 'type ' => $ this -> getTypeHintText ( $ parameterReflection ->getType () ),
250
250
],
251
251
],
252
252
'body ' => $ body ,
253
- 'returnType ' => $ methodReflection ->getReturnType (),
253
+ 'returnType ' => $ this -> getTypeHintText ( $ methodReflection ->getReturnType () ),
254
254
'docblock ' => [
255
255
'shortDescription ' => 'load entity ' ,
256
256
'tags ' => [
@@ -722,9 +722,9 @@ private function getMethodParamAndReturnType($methodName)
722
722
if (!empty ($ params [0 ])) {
723
723
/** @var ParameterReflection $parameterReflection */
724
724
$ parameterReflection = $ params [0 ];
725
- $ result ['paramType ' ] = $ parameterReflection ->getType ();
725
+ $ result ['paramType ' ] = $ this -> getTypeHintText ( $ parameterReflection ->getType () );
726
726
}
727
- $ result ['returnType ' ] = $ methodReflection ->getReturnType ();
727
+ $ result ['returnType ' ] = $ this -> getTypeHintText ( $ methodReflection ->getReturnType () );
728
728
729
729
return $ result ;
730
730
}
@@ -742,4 +742,15 @@ private function getClassMethods($name)
742
742
}
743
743
return $ this ->methodList ;
744
744
}
745
+
746
+ /**
747
+ * Get the text of the type hint.
748
+ *
749
+ * @param \ReflectionType|null $type
750
+ * @return string|null
751
+ */
752
+ private function getTypeHintText ($ type )
753
+ {
754
+ return $ type instanceof \ReflectionType ? $ type ->getName () : $ type ;
755
+ }
745
756
}
You can’t perform that action at this time.
0 commit comments