protected function handleDataPreProcessor($source, $targetType, $currentPropertyPath)
    {
        if ($this->serviceFactory->has(ServiceInterface::SERVICE_DATA_PRE_PROCESSOR)) {
            /** @var DataPreProcessorService $dataProcessorService */
            $dataProcessorService = $this->serviceFactory->get(ServiceInterface::SERVICE_DATA_PRE_PROCESSOR);

            $processor = $dataProcessorService->getDataPreProcessor($source, $targetType);
            $source = $processor->getData();
            $processorResult = $processor->getResult();

            if ($processorResult->hasErrors()) {
                $this->messages->forProperty(implode('.', $currentPropertyPath))->merge($processorResult);
            }
        }

        return $source;
    }
protected function handleDataPreProcessor($source, $targetType, $currentPropertyPath)
    {
        if ($this->serviceFactory->has(ServiceInterface::SERVICE_DATA_PRE_PROCESSOR)) {
            /** @var DataPreProcessorService $dataProcessorService */
            $dataProcessorService = $this->serviceFactory->get(ServiceInterface::SERVICE_DATA_PRE_PROCESSOR);

            $processor = $dataProcessorService->getDataPreProcessor($source, $targetType);
            $source = $processor->getData();
            $processorResult = $processor->getResult();

            if ($processorResult->hasErrors()) {
                $this->messages->forProperty(implode('.', $currentPropertyPath))->merge($processorResult);
            }
        }

        return $source;
    }
protected function handleDataPreProcessor ( $ source , $ targetType , $ currentPropertyPath ) { if ( $ this -> serviceFactory -> has ( ServiceInterface :: SERVICE_DATA_PRE_PROCESSOR ) ) { /** @var DataPreProcessorService $dataProcessorService */ $ dataProcessorService = $ this -> serviceFactory -> get ( ServiceInterface :: SERVICE_DATA_PRE_PROCESSOR ) ; $ processor = $ dataProcessorService -> getDataPreProcessor ( $ source , $ targetType ) ; $ source = $ processor -> getData ( ) ; $ processorResult = $ processor -> getResult ( ) ; if ( $ processorResult -> hasErrors ( ) ) { $ this -> messages -> forProperty ( implode ( '.' , $ currentPropertyPath ) ) -> merge ( $ processorResult ) ; } } return $ source ; }
Will check if the target type is a class, then call functions which will
check the interfaces of the class.

@param mixed $source
@param mixed $targetType
@param array $currentPropertyPath
@return array
Will check if the target type is a class then call functions which will check the interfaces of the class .