- /**
- * Converts the incoming data into scalar or an array of scalars format.
- *
- * If the data provided is null, then an empty array is returned. Otherwise, if the data is an object, it is
- * assumed to be a Data Object and converted to an associative array with keys representing the properties of the
- * Data Object.
- * Nested Data Objects are also converted. If the data provided is itself an array, then we iterate through the
- * contents and convert each piece individually.
- *
- * @param mixed $data
- * @param string $serviceClassName
- * @param string $serviceMethodName
- * @return array|int|string|bool|float Scalar or array of scalars
- */
- public function process($data, $serviceClassName, $serviceMethodName)
- {
- /** @var string $dataType */
- $dataType = $this->methodsMapProcessor->getMethodReturnType($serviceClassName, $serviceMethodName);
- return $this->convertValue($data, $dataType);
- }