Skip to content

Commit c465273

Browse files
atihanovaa-kashk
authored andcommitted
1 parent 5dc13c3 commit c465273

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
*
@@ -287,7 +292,10 @@ protected function _createFromArray($className, $data)
287292
// This use case is for REST only. SOAP request data is already camel cased
288293
$camelCaseProperty = SimpleDataObjectConverter::snakeCaseToUpperCamelCase($propertyName);
289294
$methodName = $this->getNameFinder()->getGetterMethodName($class, $camelCaseProperty);
290-
$methodReflection = $class->getMethod($methodName);
295+
if (!isset($this->methodReflectionStorage[$className . $methodName])) {
296+
$this->methodReflectionStorage[$className . $methodName] = $class->getMethod($methodName);
297+
}
298+
$methodReflection = $this->methodReflectionStorage[$className . $methodName];
291299
if ($methodReflection->isPublic()) {
292300
$returnType = $this->typeProcessor->getGetterReturnType($methodReflection)['type'];
293301
try {

0 commit comments

Comments
 (0)