getOutputCompilationService($outputTestFormat); /** @var CompilationDataService $systemCompilationService */ $systemCompilationService = $this->getServiceLocator()->get(CompilationDataService::SERVICE_ID); if (get_class($outputCompilationService) === get_class($systemCompilationService)) { return null; } return new CompiledTestConverterService($systemCompilationService, $outputCompilationService); } /** * @param $outputTestFormat * @return CompilationDataService * @throws UnsupportedCompiledTestFormatException */ private function getOutputCompilationService($outputTestFormat) { $outputTestFormat = strtolower(trim($outputTestFormat)); switch ($outputTestFormat) { case self::COMPILED_TEST_FORMAT_PHP: $outputCompilationService = new PhpCodeCompilationDataService(); break; case self::COMPILED_TEST_FORMAT_PHP_SERIALIZED: $outputCompilationService = new PhpSerializationCompilationDataService(); break; case self::COMPILED_TEST_FORMAT_XML: $outputCompilationService = new XmlCompilationDataService(); break; default: throw new UnsupportedCompiledTestFormatException( "Unsupported compiled test format provided: {$outputTestFormat}" ); } return $this->propagate($outputCompilationService); } }