public getLegacyRootModuleFileConverter ( ) : Webmozart\Json\Conversion\JsonConverter | ||
Результат | Webmozart\Json\Conversion\JsonConverter | The module file converter. |
public function getLegacyRootModuleFileConverter()
{
if (!$this->legacyRootModuleFileConverter) {
$this->legacyRootModuleFileConverter = $this->createValidatingConverter(new MigratingConverter($this->getRootModuleFileConverter(), RootModuleFileConverter::VERSION, $this->getModuleFileMigrationManager()), function (stdClass $jsonData) {
if (isset($jsonData->{'$schema'})) {
return $jsonData->{'$schema'};
}
// BC with 1.0
return 'http://puli.io/schema/1.0/manager/module';
});
}
return $this->legacyRootModuleFileConverter;
}
/** * @param string $className The name of the class to convert. * * @return JsonConverter The JSON converter. */ public function getJsonConverter($className) { switch ($className) { case 'Puli\\Manager\\Api\\Config\\ConfigFile': return $this->container->getConfigFileConverter(); case 'Puli\\Manager\\Api\\Module\\ModuleFile': return $this->container->getLegacyModuleFileConverter(); case 'Puli\\Manager\\Api\\Module\\RootModuleFile': return $this->container->getLegacyRootModuleFileConverter(); default: throw new InvalidArgumentException(sprintf('Could not find converter for class "%s".', $className)); } }