dataProcessorRegistry->getDataProcessor($processors[$key]) ?? $this->getDataProcessor($processors[$key]); $processorConfiguration = $processors[$key . '.'] ?? []; $variables = $dataProcessor->process( $cObject, $configuration, $processorConfiguration, $variables ); } } return $variables; } private function getDataProcessor(string $serviceName): DataProcessorInterface { if (!$this->container->has($serviceName)) { // assume serviceName is the class name if it is not available in the container return $this->instantiateDataProcessor($serviceName); } $dataProcessor = $this->container->get($serviceName); if (!$dataProcessor instanceof DataProcessorInterface) { throw new \UnexpectedValueException( 'Processor with service name "' . $serviceName . '" ' . 'must implement interface "' . DataProcessorInterface::class . '"', 1635927108 ); } return $dataProcessor; } private function instantiateDataProcessor(string $className): DataProcessorInterface { if (!class_exists($className)) { throw new \UnexpectedValueException('Processor class or service name "' . $className . '" does not exist!', 1427455378); } if (!in_array(DataProcessorInterface::class, class_implements($className) ?: [], true)) { throw new \UnexpectedValueException( 'Processor with class name "' . $className . '" ' . 'must implement interface "' . DataProcessorInterface::class . '"', 1427455377 ); } return GeneralUtility::makeInstance($className); } }