1313use Magento \Framework \Api \SimpleDataObjectConverter ;
1414use Magento \Framework \App \ObjectManager ;
1515use Magento \Framework \Exception \InputException ;
16- use Magento \Framework \Exception \LocalizedException ;
1716use Magento \Framework \Exception \SerializationException ;
1817use Magento \Framework \ObjectManager \ConfigInterface ;
1918use Magento \Framework \ObjectManagerInterface ;
@@ -98,7 +97,7 @@ class ServiceInputProcessor implements ServicePayloadConverterInterface
9897 private $ defaultPageSize ;
9998
10099 /**
101- * @var DefaultPageSizeSetter
100+ * @var DefaultPageSizeSetter|null
102101 */
103102 private $ defaultPageSizeSetter ;
104103
@@ -177,19 +176,19 @@ private function getNameFinder()
177176 * @param string $serviceMethodName name of the method that we are trying to call
178177 * @param array $inputArray data to send to method in key-value format
179178 * @return array list of parameters that can be used to call the service method
180- * @throws Exception
181- * @throws LocalizedException
179+ * @throws WebapiException
182180 */
183181 public function process ($ serviceClassName , $ serviceMethodName , array $ inputArray )
184182 {
185183 $ inputData = [];
186184 $ inputError = [];
187-
188185 foreach ($ this ->methodsMap ->getMethodParams ($ serviceClassName , $ serviceMethodName ) as $ param ) {
189186 $ paramName = $ param [MethodsMap::METHOD_META_NAME ];
190187 $ snakeCaseParamName = strtolower (preg_replace ("/(?<= \\w)(?=[A-Z])/ " , "_$1 " , $ paramName ));
191188 if (isset ($ inputArray [$ paramName ]) || isset ($ inputArray [$ snakeCaseParamName ])) {
192- $ paramValue = $ inputArray [$ paramName ] ?? $ inputArray [$ snakeCaseParamName ];
189+ $ paramValue = isset ($ inputArray [$ paramName ])
190+ ? $ inputArray [$ paramName ]
191+ : $ inputArray [$ snakeCaseParamName ];
193192
194193 try {
195194 $ inputData [] = $ this ->convertValue ($ paramValue , $ param [MethodsMap::METHOD_META_TYPE ]);
@@ -204,9 +203,7 @@ public function process($serviceClassName, $serviceMethodName, array $inputArray
204203 }
205204 }
206205 }
207-
208206 $ this ->processInputError ($ inputError );
209-
210207 return $ inputData ;
211208 }
212209
@@ -217,7 +214,7 @@ public function process($serviceClassName, $serviceMethodName, array $inputArray
217214 * @param array $data
218215 * @return array
219216 * @throws \ReflectionException
220- * @throws LocalizedException
217+ * @throws \Magento\Framework\Exception\ LocalizedException
221218 */
222219 private function getConstructorData (string $ className , array $ data ): array
223220 {
@@ -491,7 +488,7 @@ protected function _createDataObjectForTypeAndArrayValue($type, $customAttribute
491488 * @param mixed $data
492489 * @param string $type Convert given value to the this type
493490 * @return mixed
494- * @throws LocalizedException
491+ * @throws \Magento\Framework\Exception\ LocalizedException
495492 */
496493 public function convertValue ($ data , $ type )
497494 {
0 commit comments