@@ -101,6 +101,11 @@ class ServiceInputProcessor implements ServicePayloadConverterInterface
101
101
*/
102
102
private $ defaultPageSizeSetter ;
103
103
104
+ /**
105
+ * @var array
106
+ */
107
+ private $ methodReflectionStorage = [];
108
+
104
109
/**
105
110
* Initialize dependencies.
106
111
*
@@ -153,6 +158,7 @@ public function __construct(
153
158
* @return \Magento\Framework\Reflection\NameFinder
154
159
*
155
160
* @deprecated 100.1.0
161
+ * @see nothing
156
162
*/
157
163
private function getNameFinder ()
158
164
{
@@ -260,6 +266,7 @@ private function getConstructorData(string $className, array $data): array
260
266
* @return object the newly created and populated object
261
267
* @throws \Exception
262
268
* @throws SerializationException
269
+ * @SuppressWarnings(PHPMD.NPathComplexity)
263
270
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
264
271
*/
265
272
protected function _createFromArray ($ className , $ data )
@@ -287,7 +294,10 @@ protected function _createFromArray($className, $data)
287
294
// This use case is for REST only. SOAP request data is already camel cased
288
295
$ camelCaseProperty = SimpleDataObjectConverter::snakeCaseToUpperCamelCase ($ propertyName );
289
296
$ 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 ];
291
301
if ($ methodReflection ->isPublic ()) {
292
302
$ returnType = $ this ->typeProcessor ->getGetterReturnType ($ methodReflection )['type ' ];
293
303
try {
0 commit comments