@@ -101,6 +101,11 @@ class ServiceInputProcessor implements ServicePayloadConverterInterface
101101 */
102102 private $ defaultPageSizeSetter ;
103103
104+ /**
105+ * @var array
106+ */
107+ private $ methodReflectionStorage = [];
108+
104109 /**
105110 * Initialize dependencies.
106111 *
@@ -153,6 +158,7 @@ public function __construct(
153158 * @return \Magento\Framework\Reflection\NameFinder
154159 *
155160 * @deprecated 100.1.0
161+ * @see nothing
156162 */
157163 private function getNameFinder ()
158164 {
@@ -260,6 +266,7 @@ private function getConstructorData(string $className, array $data): array
260266 * @return object the newly created and populated object
261267 * @throws \Exception
262268 * @throws SerializationException
269+ * @SuppressWarnings(PHPMD.NPathComplexity)
263270 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
264271 */
265272 protected function _createFromArray ($ className , $ data )
@@ -287,7 +294,10 @@ protected function _createFromArray($className, $data)
287294 // This use case is for REST only. SOAP request data is already camel cased
288295 $ camelCaseProperty = SimpleDataObjectConverter::snakeCaseToUpperCamelCase ($ propertyName );
289296 $ methodName = $ this ->getNameFinder ()->getGetterMethodName ($ class , $ camelCaseProperty );
290- $ methodReflection = $ class ->getMethod ($ methodName );
297+ if (!isset ($ this ->methodReflectionStorage [$ className . $ methodName ])) {
298+ $ this ->methodReflectionStorage [$ className . $ methodName ] = $ class ->getMethod ($ methodName );
299+ }
300+ $ methodReflection = $ this ->methodReflectionStorage [$ className . $ methodName ];
291301 if ($ methodReflection ->isPublic ()) {
292302 $ returnType = $ this ->typeProcessor ->getGetterReturnType ($ methodReflection )['type ' ];
293303 try {
0 commit comments